Skip to main content

Create a Free Windows VM (B1s) server in Azure and host .Net Core website 2024

Create a Free Windows VM (B1s) in Azure

Create a Free Windows VM (B1s) server in Azure and host .Net Core website 2024

To create a free Windows VM in Azure (B1s tier) and install and host a .NET Core application, follow these steps:

Step 1: Create a Free Windows VM (B1s) in Azure

  1. Login to Azure Portal:

  2. Create a Virtual Machine:

    • Click on "Create a resource" > "Compute" > "Virtual Machine."
    • Fill out the basics:
      • Subscription: Select your free subscription.
      • Resource Group: Create a new resource group or select an existing one.
      • Virtual Machine Name: Give your VM a name.
      • Region: Choose a region where the B1s instance is available.
      • Image: Select "Windows Server 2019 Datacenter" or "Windows Server 2022 Datacenter".
      • Size: Click "Change size" and select "B1s" (part of the free tier if you’re eligible).
      • Administrator Account: Set a username and password for your VM.
  3. Networking:

    • Ensure that the VM has a public IP address to access it via RDP.
    • Configure inbound port rules:
      • Allow RDP (3389) to connect remotely.
      • Later, you’ll also need to allow HTTP (80) and HTTPS (443) for web access.
  4. Create the VM:

    • Review and click on "Create" to deploy the VM.
    • Wait until the deployment completes.

Step 2: Connect to the VM

  1. Connect via RDP:
    • Once the VM is running, click on "Connect" > "RDP" in the Azure portal.
    • Download the RDP file and open it.
    • Use the credentials you set earlier to log in.

Step 3: Install .NET Core Hosting Bundle

  1. Download .NET Core Runtime:

    • Open a browser in the VM and go to the .NET Download page.
    • Download the appropriate .NET Core Hosting Bundle (Runtime + IIS support) for your application.
  2. Install IIS:

    • Open Server Manager > "Add roles and features."
    • Select Web Server (IIS) and proceed with the installation.
  3. Install .NET Core Hosting Bundle:

    • Run the .NET Core Hosting Bundle installer you downloaded.
    • This will install the .NET Core Runtime and configure IIS to host .NET Core applications.

Step 4: Deploy and Host .NET Core Application

  1. Publish .NET Core Application:

    • On your local machine, publish your .NET Core application.
    • Run the following command in your project directory:
      bash dotnet publish -c Release -o ./publish
    • This will create a folder named publish with all the files required to run your application.
  2. Transfer Files to the VM:

    • Use Remote Desktop to copy the published files from your local machine to the VM, or use tools like WinSCP to upload them.
  3. Set Up IIS to Host the Application:

    • Open IIS Manager on the VM.
    • Right-click on Default Website (or create a new one) and select Add Application.
    • Set the alias, select the physical path (point to your publish folder), and choose the correct application pool.
    • Ensure that the application pool is using No Managed Code since it is a .NET Core application.
  4. Configure Firewall and Networking:

    • Go to the Networking tab of your VM in the Azure portal.
    • Add inbound port rules for HTTP (80) and HTTPS (443).
    • Ensure the Windows Firewall on the VM allows these ports.

Step 5: Test the Application

  • Open a browser and navigate to the public IP address of your VM.
  • If everything is set up correctly, you should see your .NET Core application running.

This setup will allow you to host your .NET Core application on a free Windows VM using the Azure free tier.


Comments

Popular posts from this blog

What is OOP (objects oriented programming) in C#

 What is OOP? in C# OOP is Object Oriented programming miens contain methods and data in objects it's called objects oriented programming(OOP) OOP Advantages Provides clear visibility and code for the programs easier to maintain, modify and debug Faster development easier and faster to execute create reusable code make your code neat and clean and easy to understand What is Class and objects in C# Class and object are the two main points of OOP (object oriented programming), when fruit is a class then Apple, Guava, Banana,  is object, when the individual objects are created they inherits all variables and method form the class, class is a template for the objects and object is instance of the class If you like this blog so pls share and  Write Comments  about Your experience, Thank You.

Make api in DotNet Core in 10sec | Create universal api for SQL server

Make API in Dot Net Core in 10sec | Create universal API for SQL server Universal API is great concept for app and angular developer need only connect to data base add table name and access table crud operation using API's  If you like this blog so pls share and  Write Comments  about Your experience, Thank You.

How to Optimize Your LinkedIn Profile as a Software Developer: Tips for Success

How to Optimize Your LinkedIn Profile as a Software Developer: Tips for Success To make your LinkedIn profile more attractive and discoverable as a software developer, you should focus on creating a compelling profile that showcases your skills, experience, and potential. Below are some specific strategies: 1. Professional Profile Picture Use a clear, professional photo where you look approachable and confident. A headshot with a neutral background works well. 2. Headline Your headline should be more than just your job title. Make it a powerful value proposition. Consider including: Your current role, tech stack, or specialization. Highlight key skills (e.g., "JavaScript | React | Node.js | Full-Stack Developer"). Optional: Include a personal tagline (e.g., "Building innovative web applications that solve real-world problems"). Example: "Full-Stack Developer | React, Node.js, Python | Passionate About Clean Code & Scalable Systems" 3. Summary (About Se...