AZURE PowerShell – PowerShell CMDLETs for Azure Subscription – Azure Administration

Hi All,
Greetings for the day!!!
We are discussing an AZURE Subscription. In last couple of articles we discussed
AZURE Subscription – Azure : simplifying concepts – discussing Azure Subscription in detail- helps in preparing Azure certifications and interviews
Azure : creating Azure free account – https://knowledge-junction.in/2023/02/18/azure-creating-azure-free-account/
In this article we will discuss POWERSHELL CMDLETs required for administration of AZURE Subscriptions . Here we are discussing simple CMDLETs and example. This is to start.
Connect-AzAccount
- The Connect-AzAccount cmdlet connects to Azure with an authenticated account for use with cmdlets from the Az PowerShell modules
- It connects to default subscription
- Syntax :

Connect-AzAccount
[-Environment <String>]
[-Credential <PSCredential>]
[-CertificateThumbprint <String>]
[-ApplicationId <String>]
[-CertificatePath <String>]
[-AccessToken <String>]
[-GraphAccessToken <String>]
[-FederatedToken <String>]
[-Tenant <String>]
[-AccountId <String>]
[-Subscription <String>]
[-AuthScope <String>]
[-ContextName <String>]
[-SkipContextPopulation]
[-MaxContextPopulation <Int32>]
[-UseDeviceAuthentication]
[-Force]
[-Scope <ContextModificationScope>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Get-AzSubscription
- List all subscriptions which current account have permissions
- Returns
- Subscription Name
- Subscription Id
- Home Tenant
- State
- Syntax:
Get-AzSubscription
[-SubscriptionId <String>]
[-TenantId <String>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzSubscription
[-SubscriptionName <String>]
[-TenantId <String>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzContext
- Gets the Active Directory account, Active Directory tenant, Azure subscription, and the targeted Azure environment
- Syntax:

Get-AzContext
[-DefaultProfile <IAzureContextContainer>]
[[-Name] <String>]
[<CommonParameters>]
Get-AzContext
[-ListAvailable]
[-RefreshContextFromTokenCache]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Set-AzContext
- Sets the tenant, subscription, and environment for cmdlets to use in the current session
- Syntax
- Example – Since here I have only one subscription – I am copying example from Microsoft documentation
Set-AzContext -Subscription "xxxx-xxxx-xxxx-xxxx"
Name Account SubscriptionName Environment TenantId
---- ------- ---------------- ----------- --------
Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x...
REFERENCES
Thanks for reading !!! ENJOY BEAUTIFUL LIFE 🙂
1 Response
[…] Preparing AZ-104 : Creating Resource group from PowerShell and related CMDLETs – Azure Administration […]