2CupsofJoe

Microsoft Studies: Azure Cloud Shell

πŸš€ Login and Run Your First Command

Step 1: Access Cloud Shell

Go here:

πŸ‘‰ https://shell.azure.com/

Sign in with your Azure account.


Step 2: Choose Your Shell

You’ll be prompted to choose:

πŸ‘‰ For this example, we’ll use PowerShell, but you can switch anytime.


Step 3: Check Your Azure Subscriptions

Get-AzSubscription

What does this do?

πŸ’‘ Think of it as:
πŸ‘‰ β€œShow me all the Azure accounts I can use.”


⚠️ IMPORTANT: Select the Correct Subscription

Before creating resources, make sure you're working in the correct subscription.

πŸ‘‰ If you don’t do this:


βœ… Set Your Active Subscription (Azure CLI)

az account list --output table

This shows all your subscriptions.

Then set the one you want:

az account set --subscription "Your-Subscription-Name"

βœ… (Alternative) Set Subscription in PowerShell

Set-AzContext -Subscription "Your-Subscription-Name"

πŸ—οΈ Create Your First Resource

Now let’s create something simple: a Resource Group.

What is a Resource Group?

A resource group is like a container that holds Azure resources (VMs, storage, etc.).


βœ… Create a Resource Group

az group create --location westus --resource-group rg-001

What’s happening here?

Part Meaning
az Azure CLI command
group create Create a resource group
--location westus Region where it's created
--resource-group rg-001 Name of the resource group

❌ Delete the Resource Group (Cleanup)

az group delete --name rg-001

πŸ’‘ This removes the resource group and everything inside it.

⚠️ Always delete test resources to avoid unexpected charges.