Azure Automation Snippet Pack

I’ve created a set of 20 Azure snippets (in the form of reusable functions) to get you started with Azure PowerShell automation.
There are snippets for authentication, installation, virtual machines, storage and SQL and all of them use the new Azure PowerShell AZ module which is the replacement for the AzureRM module.

Highlights:

              

 

    • New-AzureContextFile
      • Login to Azure and save the current authentication information to use in PowerShell scripts
    • Use-AzureContextFile
      • Login to Azure via credential (context) File
    • Check-AZmodule
      • Check if the latest available Azure Powershell AZ modules are installed
    • Install-AZmodule
      • Install the AZ module (with auto-elevation)

                

 

    • Create-AzureVM
      • Creates a new Azure virtual machine with all necessary resources
    • Remove-AzureVM
      • Removes a virtual machine and all attached resources
    • List-VmSize
      • Retrieves a up-to-date list of all available Azure Virtual Machine sizes in a given location
    • List-VmSkus
      • Retrieves a up-to-date list of all Azure virtual machine offers and their SKUs for a certain or all publishers in a given location

                  

 

    • New-AzureSQLDB
      • Creates a new SQL instance including firewall rule and database
    • New-GeoReplication
      • Configure an active geo-replication for a single database

                

 

    • Azure File Share Backup
      • Creates a backup for all file shares protected by Azure Backup in a subscription
    • Set-AzureBlobContent
      • Upload Files to an Azure blob

Download

You can download the snippet pack here: CodeManager CMB File

  • The CMB-file can be installed quickly in CodeManager v7 via Snippet Backup->Restore.
  • It contains ISE-snippets, so you can use them directly in ISE, but they can be used with CodeManager with any editor (like VSCode) of course.
  • If you wish, you can open CMB files with any ZIP-capable program

 

Have a nice day!
Denniver