Azure Powershell: Basic CmdLets

Get-AzureSubscription  -Current   # List current subscription
Get-AzureSubscription  # List all subscriptions

——————————————————————————————————————————–LOGIN

– Either: Login-AzureRmAccount
Select-AzureRmSubscription -SubscriptionName GS-DevOps
Set-AzureRmContext -SubscriptionName GS-DevOps

– or: Add-AzureAccount (You can add as many accounts to Azure PowerShell)

– or: Get-AzurePublishSettingsFile

Import-AzurePublishSettingsFile C:\Users\GS\Downloads\mysubs.publishsettings

——-

Just to make sure that everything has gone right run the following cmdlet:
Get-AzureAccount / Get-AzureSubscription  -Current / Get-AzureSubscription

————————————————————————

# Select Subscription
Set-AzureRmContext -SubscriptionId 38d8d050-5c50-4eba-b06b-16124ec3b55c
Select-AzureSubscription -SubscriptionName GS-Devops
Select-AzureSubscription -Current -SubscriptionName GS-Devops

———————————————————————-

To get a list of resource groups in your subscription, use Get-AzureRmResourceGroup.

 

 

Leave a comment