Good Starter Links
Azure Documentation (All) – https://docs.microsoft.com/en-us/azure/
Connect to Azure PS
Azure had many PowerShell module and this includes the new AZ module, existing Azure AD, Azure Graph and regular Azure PowerShell module. All of these are listed below:
AzureAD
AzureAZ
Azure/Graph
Azure PowerShell
Initial PowerShell connection
For new connections to Azure, using the Azure AZ module is recommended. This is because Microsoft is again transitioning modules and background infrastructure to this new model. Below are the steps needed to connect to the Azure AZ module:



Once connected we can explore available Azure cmdlets (AZ Module).
Get-Command | Where {$_.Source -Like 'Az.*'}
We see that there are quite a few groupings of Azure AZ module cmdlets. The groupings are indicative of which part of Azure you may need to work on. Networking cmdlets are vastly different that say the SQL Azure cmdlets. Hence we have logical cmdlet groupings which also lead to easier cmdlet discovery.
For example, if we wanted to find all the Azure AZ module cmdlets that related to Networking, we can do so with this one-liner
get-command | where {$_.Source -like 'Az.Network'}
And if we wanted a cmdlet count, we could run this:
(get-command | where {$_.Source -like 'Az.Network'}).Count
Which then returns that there are currently 462 Network related cmdlets. How do we know what AZ Modules are available? Well, we can query for them like so:
(get-command | where {$_.Source -like 'Az.*'}).Source |Sort-Object -Unique
Which reveals that there are 50 Module groupings in the Azure AZ PowerShell Module:
Az.Accounts Az.Advisor Az.Aks Az.AnalysisServices Az.ApiManagement Az.ApplicationInsights Az.Automation Az.Batch Az.Billing Az.Cdn Az.CognitiveServices Az.Compute Az.ContainerInstance Az.ContainerRegistry Az.DataFactory Az.DataLakeAnalytics Az.DataLakeStore Az.DeploymentManager Az.DevTestLabs Az.Dns Az.EventGrid Az.EventHub Az.FrontDoor Az.HDInsight Az.IotHub Az.KeyVault Az.LogicApp Az.MachineLearning Az.ManagedServices Az.MarketplaceOrdering Az.Media Az.Monitor Az.Network Az.NotificationHubs Az.OperationalInsights Az.PolicyInsights Az.PowerBIEmbedded Az.RecoveryServices Az.RedisCache Az.Relay Az.Resources Az.ServiceBus Az.ServiceFabric Az.SignalR Az.Sql Az.Storage Az.StorageSync Az.StreamAnalytics Az.TrafficManager Az.Websites
While that seems like quite a few modules it would appear necessary to classify these cmdlets like so because there are thousands of cmdlets.
$Sources = (get-command | where {$_.Source -like 'Az.*'}).Source |Sort-Object -Unique Foreach ($Source in $Sources){ $Count = (Get-command | Where {$_.Source -eq $Source}).Count Write-Host "$Source,$Count" }
Az.Accounts,40 Az.Advisor,5 Az.Aks,7 Az.AnalysisServices,28 Az.ApiManagement,118 Az.ApplicationInsights,12 Az.Automation,89 Az.Batch,81 Az.Billing,13 Az.Cdn,36 Az.CognitiveServices,14 Az.Compute,196 Az.ContainerInstance,4 Az.ContainerRegistry,16 Az.DataFactory,76 Az.DataLakeAnalytics,65 Az.DataLakeStore,87 Az.DeploymentManager,24 Az.DevTestLabs,10 Az.Dns,11 Az.EventGrid,19 Az.EventHub,32 Az.FrontDoor,23 Az.HDInsight,42 Az.IotHub,48 Az.KeyVault,63 Az.LogicApp,51 Az.MachineLearning,23 Az.ManagedServices,6 Az.MarketplaceOrdering,2 Az.Media,11 Az.Monitor,52 Az.Network,462 Az.NotificationHubs,32 Az.OperationalInsights,48 Az.PolicyInsights,7 Az.PowerBIEmbedded,15 Az.RecoveryServices,175 Az.RedisCache,23 Az.Relay,20 Az.Resources,105 Az.ServiceBus,47 Az.ServiceFabric,29 Az.SignalR,10 Az.Sql,269 Az.Storage,112 Az.StorageSync,20 Az.StreamAnalytics,21 Az.TrafficManager,22 Az.Websites,53
Between these 50 groupings we have 2774 cmdlets to choose from which is quite a lot. With a bit more research and effort we can see what these cmdlets are used for:
Search Terms – AZ.Accounts
Reveals this article from Microsoft’s Docs pages:
https://docs.microsoft.com/en-us/powershell/module/az.accounts/?view=azps-3.5.0
Notice that the ‘Az.Accounts’ module name is listed in the link above. Could we simply replace that for the entire list of modules? Would these links work? Let’s see with PowerShell and using the Invoke-WebRequest cmdlet:
$Sources = (Get-Command | Where {$_.Source -like 'Az.*'}).Source |Sort-Object -Unique Foreach ($Source in $Sources){ $Link = "https://docs.microsoft.com/en-us/powershell/module/$Source/?view=azps-3.5.0" $StatusCode = (Invoke-WebRequest $Link).StatusCode If ($StatusCode -eq '200') { Write-Host "Valid" -ForegroundColor Green -NoNewline Write-Host ",$Source,$Link" } Else { Write-Host "InValid" -ForegroundColor Red -NoNewline WQrite-Host ",$Source,$Link" } }
The answer is, yes!
Valid(?) | Module | Web Link to documentation |
---|---|---|
Valid | Az.Accounts | https://docs.microsoft.com/en-us/powershell/module/Az.Accounts/?view=azps-3.5.0 |
Valid | Az.Advisor | https://docs.microsoft.com/en-us/powershell/module/Az.Advisor/?view=azps-3.5.0 |
Valid | Az.Aks | https://docs.microsoft.com/en-us/powershell/module/Az.Aks/?view=azps-3.5.0 |
Valid | Az.AnalysisServices | https://docs.microsoft.com/en-us/powershell/module/Az.AnalysisServices/?view=azps-3.5.0 |
Valid | Az.ApiManagement | https://docs.microsoft.com/en-us/powershell/module/Az.ApiManagement/?view=azps-3.5.0 |
Valid | Az.ApplicationInsights | https://docs.microsoft.com/en-us/powershell/module/Az.ApplicationInsights/?view=azps- |
Valid | Az.Automation | https://docs.microsoft.com/en-us/powershell/module/Az.Automation/?view=azps-3.5.0 |
Valid | Az.Batch | https://docs.microsoft.com/en-us/powershell/module/Az.Batch/?view=azps-3.5.0 |
Valid | Az.Billing | https://docs.microsoft.com/en-us/powershell/module/Az.Billing/?view=azps-3.5.0 |
Valid | Az.Cdn | https://docs.microsoft.com/en-us/powershell/module/Az.Cdn/?view=azps-3.5.0 |
Valid | Az.CognitiveServices | https://docs.microsoft.com/en-us/powershell/module/Az.CognitiveServices/?view=azps-3.5. |
Valid | Az.Compute | https://docs.microsoft.com/en-us/powershell/module/Az.Compute/?view=azps-3.5.0 |
Valid | Az.ContainerInstance | https://docs.microsoft.com/en-us/powershell/module/Az.ContainerInstance/?view=azps-3.5. |
Valid | Az.ContainerRegistry | https://docs.microsoft.com/en-us/powershell/module/Az.ContainerRegistry/?view=azps-3.5. |
Valid | Az.DataFactory | https://docs.microsoft.com/en-us/powershell/module/Az.DataFactory/?view=azps-3.5.0 |
Valid | Az.DataLakeAnalytics | https://docs.microsoft.com/en-us/powershell/module/Az.DataLakeAnalytics/?view=azps-3.5. |
Valid | Az.DataLakeStore | https://docs.microsoft.com/en-us/powershell/module/Az.DataLakeStore/?view=azps-3.5.0 |
Valid | Az.DeploymentManager | https://docs.microsoft.com/en-us/powershell/module/Az.DeploymentManager/?view=azps-3.5. |
Valid | Az.DevTestLabs | https://docs.microsoft.com/en-us/powershell/module/Az.DevTestLabs/?view=azps-3.5.0 |
Valid | Az.Dns | https://docs.microsoft.com/en-us/powershell/module/Az.Dns/?view=azps-3.5.0 |
Valid | Az.EventGrid | https://docs.microsoft.com/en-us/powershell/module/Az.EventGrid/?view=azps-3.5.0 |
Valid | Az.EventHub | https://docs.microsoft.com/en-us/powershell/module/Az.EventHub/?view=azps-3.5.0 |
Valid | Az.FrontDoor | https://docs.microsoft.com/en-us/powershell/module/Az.FrontDoor/?view=azps-3.5.0 |
Valid | Az.HDInsight | https://docs.microsoft.com/en-us/powershell/module/Az.HDInsight/?view=azps-3.5.0 |
Valid | Az.IotHub | https://docs.microsoft.com/en-us/powershell/module/Az.IotHub/?view=azps-3.5.0 |
Valid | Az.KeyVault | https://docs.microsoft.com/en-us/powershell/module/Az.KeyVault/?view=azps-3.5.0 |
Valid | Az.LogicApp | https://docs.microsoft.com/en-us/powershell/module/Az.LogicApp/?view=azps-3.5.0 |
Valid | Az.MachineLearning | https://docs.microsoft.com/en-us/powershell/module/Az.MachineLearning/?view=azps-3.5.0 |
Valid | Az.ManagedServices | https://docs.microsoft.com/en-us/powershell/module/Az.ManagedServices/?view=azps-3.5.0 |
Valid | Az.MarketplaceOrdering | https://docs.microsoft.com/en-us/powershell/module/Az.MarketplaceOrdering/?view=azps- |
Valid | Az.Media | https://docs.microsoft.com/en-us/powershell/module/Az.Media/?view=azps-3.5.0 |
Valid | Az.Monitor | https://docs.microsoft.com/en-us/powershell/module/Az.Monitor/?view=azps-3.5.0 |
Valid | Az.Network | https://docs.microsoft.com/en-us/powershell/module/Az.Network/?view=azps-3.5.0 |
Valid | Az.NotificationHubs | https://docs.microsoft.com/en-us/powershell/module/Az.NotificationHubs/?view=azps-3.5.0 |
Valid | Az.OperationalInsights | https://docs.microsoft.com/en-us/powershell/module/Az.OperationalInsights/?view=azps- |
Valid | Az.PolicyInsights | https://docs.microsoft.com/en-us/powershell/module/Az.PolicyInsights/?view=azps-3.5.0 |
Valid | Az.PowerBIEmbedded | https://docs.microsoft.com/en-us/powershell/module/Az.PowerBIEmbedded/?view=azps-3.5.0 |
Valid | Az.RecoveryServices | https://docs.microsoft.com/en-us/powershell/module/Az.RecoveryServices/?view=azps-3.5.0 |
Valid | Az.RedisCache | https://docs.microsoft.com/en-us/powershell/module/Az.RedisCache/?view=azps-3.5.0 |
Valid | Az.Relay | https://docs.microsoft.com/en-us/powershell/module/Az.Relay/?view=azps-3.5.0 |
Valid | Az.Resources | https://docs.microsoft.com/en-us/powershell/module/Az.Resources/?view=azps-3.5.0 |
Valid | Az.ServiceBus | https://docs.microsoft.com/en-us/powershell/module/Az.ServiceBus/?view=azps-3.5.0 |
Valid | Az.ServiceFabric | https://docs.microsoft.com/en-us/powershell/module/Az.ServiceFabric/?view=azps-3.5.0 |
Valid | Az.SignalR | https://docs.microsoft.com/en-us/powershell/module/Az.SignalR/?view=azps-3.5.0 |
Valid | Az.Sql | https://docs.microsoft.com/en-us/powershell/module/Az.Sql/?view=azps-3.5.0 |
Valid | Az.Storage | https://docs.microsoft.com/en-us/powershell/module/Az.Storage/?view=azps-3.5.0 |
Valid | Az.StorageSync | https://docs.microsoft.com/en-us/powershell/module/Az.StorageSync/?view=azps-3.5.0 |
Valid | Az.StreamAnalytics | https://docs.microsoft.com/en-us/powershell/module/Az.StreamAnalytics/?view=azps-3.5.0 |
Valid | Az.TrafficManager | https://docs.microsoft.com/en-us/powershell/module/Az.TrafficManager/?view=azps-3.5.0 |
Valid | Az.Websites | https://docs.microsoft.com/en-us/powershell/module/Az.Websites/?view=azps-3.5.0 |
Next Week
Next week we will look at some Get-Cmdlets to start exploring the various modules within Azure. For example – Azure Locations, Storage options and more.