In some situations, you may need to move a script/Runbook between subscriptions or even customers. We can always edit the Runbook and copy and paste the content. However, there are more elegant ways to copy a Runbook using either Azure Portal or PowerShell. Using the Azure Portal, go to the desired Runbook properties blade. Click on Export and the .ps1 file (if it is a PowerShell file) will be downloaded to your workstation, as depicted in the image below.
If you want to perform that from a PowerShell session, then the cmdlet to complete the task is Export-AzAutomationRunbook.
Note: At the time of writing, the -OutputFolder does not recognize the Linux file system of Azure Cloud Shell and it fails to create the file.
More Quick Tips articles
- Restarting your Azure Application Gateway with PowerShell
- Renaming your repos in Azure DevOps
- Visual Studio Code keyboard shortcut to manage your code
- Using Azure ephemeral disks when provisioning VMs with ARM
- Checking services availability in Azure and Azure Stack Hub