Azure Management scripts
This repository stores some PowerShell scripts for managing Microsoft Azure. Often, it's helpful to use little scripts to manage Azure subscriptions, to get or to deploy resources and to automate specific tasks. I plan to extend this collection from time to time.
Install the Azure PowerShell Az module
As prerequesits, you need to have the Azure PowerShell Az module installed on your computer. The new Azure PowerShell Az module is available since December 2018 and, as the documentation says, offers shorter commands, improved stability, and cross-platform support since it's running on the .NET Standard library which means it runs on PowerShell 5.x and PowerShell 6.x (PS 6.x can run on Linux, macOS, and Windows). I see, "Az" is shorter than "AzureRM"… ;) Anyway, Az also offers feature parity and an easy migration path from AzureRM, see more at Introducing the new Azure PowerShell Az module.
Connect to Azure
(Un)install or update the PowerShell module, as described at Working with the new Azure PowerShell Az module or at docs.microsoft.com. Once installed, use the Connect-AzAccount command and sign-in with your credentials:
When working with multiple subscriptions, get a list of all subscriptions as here:
Select a subscription
Select the desired Azure subscription by name:
Set-AzContext -Subscription '<subscriptionname>'
Run your scripts
After that, run your PowerShell Az scripts, as for example get-subscription-inventory.ps1.