.NET Tutorial - Deploy a microservice to Azure

Create Azure resources

Create a resource group

A resource group is used to organize a set of resources related to a single app.

Run the following command to create a resource group on the West US region:

Terminal
az group create --name MyMicroserviceResources --location westus

If you want to use a different location on the previous command, you can run the following command to see which regions are available on your account and pick one closer to you:

Terminal
az account list-locations -o table

If you want to use a different subscription for the session you can get a list of all subscriptions by running the following command:

Terminal
az account list --all

Then you can run the following command to set a specific subscription for the session:

Terminal
az account set -s NAME_OR_ID

Create an AKS cluster

Run the following command to create an AKS cluster in the resource group:

It's normal for this command to take several minutes to complete.

Terminal
az aks create --resource-group MyMicroserviceResources --name MyMicroserviceCluster --node-count 1 --enable-addons http_application_routing --generate-ssh-keys

Run the following command to download the credentials to deploy to your AKS cluster:

Terminal
az aks get-credentials --resource-group MyMicroserviceResources --name MyMicroserviceCluster
Continue