Azure PowerShell Commands (111 Commands)

Check out the list of a few important Azure PowerShell Commands with examples and Video tutorials. Along with that, check out the Lists of real-time Azure PowerShell errors and their solutions with video tutorials that I got while working with these PowerShell commands.

NameDescription
Get-AzureADDeviceCan help you to retrieve the details of the lists of devices from your Azure AD.
New-AzureADDeviceHelps you to create a brand new device in your Azure Active Directory.
Set-AzureADDeviceUpdates the details of your Azure AD device.
Remove-AzureADDeviceRemove an Azure AD device.
Get-AzureADPolicyRetrieve the details of your Azure AD Policy.
New-AzureADPolicyCreate a brand new Azure AD Policy using this PowerShell command.
Set-AzureADPolicyUpdate your Azure AD Policy.
Remove-AzureADPolicyDelete any unwanted Azure AD policy using this PowerShell command.
Get-AzureADDirectoryRoleRetrieve the details of a directory role from your Azure Active Directory using this command.
Update-AzADUserUpdate the entities in the Azure Active Directory users.
Get-AzureADObjectByObjectIdThis command will retrieve the details of a directory role from your Azure Active Directory.
Disconnect-AzureADHelps you to disconnect your current session from your Azure Active Directory tenant.
Connect-AzureADHelps you to use Azure AD cmdlet requests by connecting with an authenticated account.
Get-AzureADUserMembershipUse this command to get the specified user membership in the Azure AD.
Get-AzureADUserHelps you to get user details from your Azure Active Directory.
Get-AzADUserCan get you the list of AD users.
Remove-AzADGroupUse this command to remove the entity from the Azure AD groups.
Get-AzADApplicationHelps get the objects’ details based on the specified Object IDs.
New-AzADApplicationUse the New-AzADApplication PowerShell cmdlet to add the new entity to your applications.
Get-AzADGroup Use this command to get the lists of Azure Active Directory Groups.
Get-AzSecuritySettingIt will get you the security settings in the Azure Security Center.
Get-AzTenantGet the list of entities from the applications.
New-AzTagIt helps you quickly create a predefined Azure tag.
Get-AzTagCan help you to retrieve the lists of predefined Azure tags from your subscription.
Add-AzRouteConfigUse this command to add a route to a specified Azure route table.
Get-AzRouteTableThis can help you to retrieve the route tables under a Resource Group.
Get-AzStorageContainerHelps you to retrieve the lists of Azure storage containers.
Remove-AzStorageContainerHelps you to remove the storage container that you have specified with this command.
New-AzStorageContextGet the lists of storage queues associated with the specified storage account.
Get-AzADServicePrincipalUse this command to get the entities from the service principals.
New-AzADSpCredentialIt helps you to add a credential to an existing service principal.
Update-AzConfigUpdate the configs of your Azure PowerShell using this command.
Uninstall-AzureRmHelps you to uninstall or remove all the AzureRm modules from your machine
Set-AzDefaultHelps you to create an Azure Storage context quickly.
Save-AzContextCan help you to save the Az context of your current Azure session into a specified location or path.
Get-AzEnvironmentRetrieve the endpoints and the metadata for the instance of the Azure services.
Get-AzProviderFeatureUse this command to add edit or set the default to your current Azure Context.
Get-AzPolicyAssignmentRetrieve the policy assignments.
Clear-AzDefaultHelps to clear the current context default values set by the user.
Clear-AzConfigHelps you to retrieve the feature details like Feature name, Registration State, Provider name, etc. in a second.
New-AzManagementGroupClear all the configuration values set by the user using this command.
Set-AzResourceGroupCreate a management group in seconds using this command.
Remove-AzResourceRemoves the specified Azure resource.
New-AzRoleAssignmentHelps you to assign an RBAC role to a specific principal for a specified scope.
Remove-AzResourceLockRemoves a lock from an Azure resource.
New-AzResourceModify your Azure resource group in seconds.
Export-AzResourceGroupSave your resource group as a template with a JSON file format.
Get-AzRoleDefinitionRetrieve the list of Azure RBAC roles that are available that you can assign.
Get-AzRoleAssignmentQuickly create an Azure resource like a website or an Azure SQL database/server in a resource group.
Get-AzResourceProviderQuickly get the Azure resource provider.
Get-AzResourceLockRetrieve the Azure resource locks.
Get-AzResourceGet a list of all the Azure resources.
Get-AzConfigRetrieve the lists of all the configs of your Azure PowerShell.
Get-AzContextRetrieve the metadata details.
Add-AzureAccountAdd the Azure account to the Windows PowerShell.
Set-AzContextIt helps you set the subscription, tenant, and environments for different PowerShell commands for your current PowerShell session.
connect-AzAccountIt helps you help you connect to Azure with one particular authenticated account.
Disconnect-AzAccountDisconnect an Azure account that you are connected to currently.
Clear-AzContextDelete/clear all the Azure credentials, subscription and account details, etc.
Get-AzLocationRetrieve the location details and their supported resource providers.
Get-AzDeploymentRetrieve the deployment details under the current subscription.
Start-ADSyncSyncCycleHelps to force Sync Azure AD Connect or to run a sync cycle manually.
Get-AzureADMSGroupGet the details of the Azure AD groups via the MS Graph.
Set-AzureADMSGroupModify different properties of the Azure AD group.
Get-AzureADServicePrincipalRetrieve the list of service principals from your Azure Active Directory.
Get-AzureADMSDeletedDirectoryObjectGet the soft deleted AD object from the Azure Active Directory.
Get-AzSubscriptionRetrieve the List of Azure Subscriptions.
Get-azurermsubscriptionGet the subscription details that the current account can access.
Connect-AzureRMAccountHelps to connect to the authenticated account for using the Azure RM cmdlets.
Select-AzureSubscriptionCan get you the lists of all the role assignments under your subscription or a specific scope.
New-AzureADMSInvitationCan help you to invite an external user to your Azure Active directory.
Connect-msolserviceCan help you to initiate a connection to your Azure Active Directory.
Get-AzMetricCan help you to retrieve the metric values of an Azure resource.
Get-AzSqlDatabaseHelp you to set and clear your current and default Azure subscriptions.
Get-AzSqlServerHelp you retrieve the Azure SQL database lists from your Azure SQL Database Server.
Get-AzStorageTableCan help you to create a storage table quickly.
Set-AzStorageAccountUse this Azure PowerShell command to modify or update your Azure Storage account.
Get-AzActivityLogCan help you to get the lists of available storage tables associated with the specified Storage account.
Get-AzADGroupMemberHelp you retrieve the Activity Log event lists from your Azure Subscription.
New-AzADGroupCan help you to create a new Azure AD group.
New-AzADUserCan help you to create a new Azure AD user.
Add-AzADGroupMemberHelps you to add members to an Azure AD group.
Get-AzADAppCredentialHelp you to list the members from an Azure AD group.
Start-AzVMIt helps to start your Azure VM.
Get-AzWebAppIt helps you to retrieve information about your Azure Web App.
Set-AzWebAppIt can help you modify your Azure Web App.
Get-AzApplicationInsightsIt helps you to return the Application Insights components.
Get-AzAppServicePlanIt helps to retrieve an Azure App Service plan in the resource group that you have specified.
Get-AduserIt helps you quickly find the AD users in your domain.
Get-AzVirtualNetworkIt helps you helps to retrieve the lists of virtual networks under a resource group.
Get-AzVirtualNetworkSubnetConfigIt helps you to retrieve the details of a subnet inside a Virtual network.
New-AzAppServicePlanIt helps you retrieve the details of a subnet inside a virtual network.
Get-AzKeyVaultSecretIt can help you quickly create an App service plan for a specific region.
Get-AzDiskIt helps you to retrieve the properties of a Managed disk.
Name Description
Azure Powershell change subscriptionLearn how the Select-AZSubscription command can be used to change the Azure subscription.
How to get tenant id in Azure using PowerShellCheck out how to get tenant id in Azure using PowerShell.
Azure PowerShell List Resource GroupsLearn how to list Resource Groups using the PowerShell command Get-AzResourceGroup.

Azure PowerShell Errors

NameDescription
The term ‘connect-azaccount’ is not recognizedCheck out how to fix the error “The term ‘connect-azaccount’ is not recognized”.”
The term ‘New-AzureStorageContext’ is not recognized errorLearn, how to fix the error “new-azurestoragecontext is not recognized”.
No match was found for the specified search criteria and module name ‘MSOnline’Learn to fix the error “No match was found for the specified search criteria and module name ‘MSOnline’”.
Login-AzureRmAccount is not recognizedCheck out how to fix the error “the term login-azurermaccount is not recognized”.
The term ‘Get-AzHost’ is not recognizedCheck out the steps to fix the error “Get-AzHost is not recognized”.
Connect-Msolservice is not recognizedLearn to fix the error “Connect-Msolservice is not recognized”.
Running scripts is disabled on this systemLearn how to fix the error “Running scripts is disabled on this system”.
Method ‘get_serializationsettings’ in type ‘microsoft.azure.managementLearn how to fix the error “Method ‘get_serializationsettings’ in type ‘microsoft.azure.management”
The Term ‘Connect-AzureRmAccount’ is Not RecognizedLearn how to fix the error “The Term ‘Connect-AzureRmAccount’ is Not Recognized”.
The term ‘Select-AzureSubscription’ is not recognized as the name of a cmdletLearn how to fix the error “The term ‘Select-AzureSubscription’ is not recognized”.
The term ‘connect-azuread’ is not recognized as the name of a cmdletLearn how to fix the error “connect-azuread is not recognized”.
Set-AzContext : Please provide a valid tenant or a valid subscription.Check out how to fix the error “please provide a valid tenant or a valid subscription.”
The ‘Set-AzContext’ command was found in the module ‘Az.Accounts’ but the module could not be loaded.Learn how to fix the error “The ‘Set-AzContext’ command was found in the module ‘Az.Accounts’”.
The specified module ‘ActiveDirectory’ was not loadedLearn how to fix the error “The specified module ‘ActiveDirectory’ was not loaded”.
The specified module ‘ADSync’ was not loaded because no valid module file was found in any module directory errorLearn how to fix the error “The specified module ‘ADSync’ was not loaded”.
The term ‘get-aduser’ is not recognized as the name of a cmdlet in Windows 10 PowerShellCheck out how to fix the error “the term ‘get-aduser’ is not recognized as the name”.
New-AzResourceGroup: A positional parameter cannot be found that accepts argumentLearn how to fix the error “a positional parameter cannot be found that accepts argument”.
The term ‘Get-AzQuota’ is not recognized as the name of a cmdletCheck out how to fix the error “The term ‘Get-AzQuota’ is not recognized”.
Get-AzStorageFile: Can not find your Azure storage credentialLearn to fix the error “can not find your azure storage credential”.
Install-packageprovider no match was found for the specified search criteria for the provider ‘nuget’Check out how to fix the error “no match was found for the specified search criteria for the provider ‘nuget’”.
Get-AzStorageBlob: Could not get the storage contextLearn how to fix the error “could not get the storage context”.
Unable to cast object of type ‘Newtonsoft.Json.Linq.JObject’to type ‘Microsoft.Azure.Management.ManagementGroups.Models.ManagementGroup’Learn how to fix the error “unable to cast object of type”.
The ‘Set-AzSqlDatabase’ command was found in the module ‘Az.Sql’Learn how to fix the error “The Set-AzSqlDatabase command was found”.
The ‘Get-AzResourceGroup’ command was found in the module ‘Az.Resources’Learn how to fix the error “Set-AzSqlDatabase command was found”.
The term ‘Get-VM’ is not recognized as the name of a cmdletLearn how to fix the error “get-vm is not recognized”.
The term ‘Get-ADSyncScheduler’ is not recognizedLearn how to fix the error “get-adsyncscheduler is not recognized”.
The Specified Module ‘AzureRM’ Was Not LoadedLearn how to fix the error “AzureRM Was Not Loaded”.
The term ‘get-azuresubscription’ is not recognizedCheck out how to fix the error “get-azuresubscription is not recognized”.
Get-AzVm : ‘this.Client.SubscriptionId’ cannot be nullLearn how to fix the error “this.Client.SubscriptionId cannot be null”.
The term ‘Get-AzTableRow’ is not recognized as the name of a cmdletLearn how to fix the error “The term Get-AzTableRow is not recognized”.
No match was found for the specified search criteria and module names ‘AzTable’Learn how to fix the error “No match was found for the specified search criteria and module names ‘AzTable’”
No match was found for the specified search criteria and module name ‘Az’Check out how to fix the error “No match was found for the specified search criteria and module name ‘Az’”.
The term ‘Start-ADSyncSyncCycle’ is not recognized errorLearn how to fix the error “the term ‘start-adsyncsynccycle’ is not recognized as the name of a cmdlet,”.
The following commands are already available on this systemLearn how to fix the error “the following commands are already available on this system”.
The term ‘Get-AzureAccount’ is not recognized errorCheck out the error “The term Get-AzureAccount is not recognized”.
Method ‘get_SerializationSettings’ error when Login-AzureRMAccountLearn how to fix the error “Method ‘get_SerializationSettings’ error when Login-AzureRMAccount”.
The term ‘New-AzResourceGroup’ is not recognized as the name of a cmdletCheck out the error “The term ‘New-AzResourceGroup’ is not recognized”.
New-AzureRmResourceGroup: ‘this.Client.SubscriptionId’ cannot be nullLearn how to fix the error “New-AzureRmResourceGroup: ‘this.Client.SubscriptionId’ cannot be null”.
The term ‘Get-AzureRmVM’ is not recognized as the name of a cmdletCheck out how to fix the error “The term ‘Get-AzureRmVM’ is not recognized”.
The term ‘Get-AzureADDirectorySettingTemplate’ is not recognized as the name of a cmdletLearn how to fix error “Get-AzureADDirectorySettingTemplate is not recognized”.
The term ‘get-azureadgroup’ is not recognized as the name of a cmdletLearn how to fix the error “The term get-azureadgroup is not recognized”.
No match was found for the specified search criteria and module name ‘AzureAD’Learn how to fix the error “No match was found for the specified search criteria and module name ‘AzureAD’”.
The ‘New-AzResourceGroup’ command was found in the module ‘Az.Resources’Learn how to fix the error “The ‘New-AzResourceGroup’ command was found”.
Unable to find package providers (NuGet)Check out how to fix the error “Unable to find package providers (NuGet)”.
Administrator rights are required to install modulesLearn to fix the error “Administrator rights are required to install modules”.
Get-AzureADDirectorySetting not recognizedLearn how to fix the error Get-AzureADDirectorySetting is not recognized.

Conclusion

This article discussed a list of helpful Azure PowerShell Commands with their syntax and usage examples. We also discussed a list of real-time Azure PowerShell Errors and their solutions that I came across while working with these Azure PowerShell Commands.

Thanks for taking the time to read this article !!!