Azure Automation – Using The Assets

After yesterdays post about getting started I’ve gotten some questions about the assets library. Thought I’d explain how to use some of the assets (or at least how I’ve figured it out I’d say, might be totally off but at least it works)…

Looking at the assets library we have a “Connection”-object containing our subscription ID. This could be an ID to another subscription, might be useful for IT to deploy services to a developers subscription or something like that.

We also have a “Certificate”-object where we also uploaded the corresponding certificate to our collection of management certificates in Azure, this needs to be done on the right subscription then if you’re managing multiple ones, keep that in mind…

<# .DESCRIPTION .NOTES Author: Joachim Nässlander, TSP Datacenter, Microsoft #>

workflow Start_Azure_Demo_VM
{
param()

$MyConnection = “Internal Subscription Connection” # <— The name of your Connection object in assets
$MyCert = “InternalSubscriptionCertificate” # <— The name of your Certificate object in assets

# Get the Azure Automation Connection
$Con = Get-AutomationConnection -Name $MyConnection # <— Connect to your subscription
$SubscriptionID = $Con.SubscriptionID
$ManagementCertificate = $Con.AutomationCertificateName
$Cert = Get-AutomationCertificate -Name $Con.AutomationCertificateName # <— Get the certificate from assets

write-output “Subscription ID: $SubscriptionID”

write-output “Certificate Name: $Con.AutomationCertificateName”

}

And since this is the internet. How are you using Azure Automation and the assets library, feel free to comment!

Have a nice weekend, and don’t miss The Fratellis to keep you company over a beer!