Provisioning an Azure Resource Group
14 Mar 2023
Before we rent a web server from Microsoft Azure’s cloud, we’ll need set up a home for our web server in Azure called a “Resource Group.”
Prerequisites
- Have an account in Azure.
- Log your computer’s command line into that Azure account.
Create a resource group
Pick a unique name that you’d like to give your Azure resource group.
For this exercise, I called mine “my-hello-web-rg
.”
With Azure PowerShell
If (Get-AzResourceGroup -Name "my-hello-web-rg") {} Else { New-AzResourceGroup -Name "my-hello-web-rg" -Location "centralus"; }
With the Azure CLI
In a Windows PowerShell command prompt
If ((az group exists --name "my-hello-web-rg") -eq 'true') {} Else { az group create --name "my-hello-web-rg" --location "centralus"; }
In a Linux-style command prompt
if [ "true" == $(az group exists --name "my-hello-web-rg") ]; then :; else az group create --name "my-hello-web-rg" --location "centralus"; fi;
Find the name of an existing resource group (A Cloud Guru)
If you’re using an A Cloud Guru (“ACG”) account, you probably aren’t allowed to create resource groups in Azure.
Instead, run one of the following two commands to figure out the name of the one and only resource group that A Cloud Guru pre-provisioned for you:
With Azure PowerShell
Get-AzResourceGroup | Select-Object -Property "ResourceGroupName"
With the Azure CLI
az group list --query "[0].name"
Posts in this series
- Part 1 - Source code that builds locally into a Node.js Hello World webapp
- Part 2 - Locally unit-testing source code for a Node.js Hello World webapp
- Part 3 - Protecting Git branches in Azure DevOps repositories
- Part 4 - Making Azure DevOps Pipelines build a Hello World webapp from Git-tracked source code changes
- Part 5 - Failing Azure DevOps Pipeline builds if unit tests fail
- Part 6 - Logging your command line into Azure
- Part 7 - This Article
- Part 8 - Provisioning Azure App Services to host your Hello World webapp
- Part 9 - Provisioning Azure AD Service Principals that can deploy built webapps onto your Azure App Service resources
- Part 10 - Provisioning Azure DevOps Service Connections that let ADO Release Pipelines leverage Azure AD Service Principals for sensitive CI/CD tasks
- Part 11 - Deploying a built webapp onto Azure App Service with ADO Release Pipelines