I am just getting started with Azure Automation. I downloaded Backup Azure SQL Databases to Blob storage from the gallery. When I run it I get this error:
Connection AzureRunAsConnection not found.
I searched stack overflow and found this post but the links are broken. It's clearly in this function within the runbook:
function Login() {
$connectionName = "AzureRunAsConnection"
try
{
$servicePrincipalConnection = Get-AutomationConnection -Name $connectionName
Write-Verbose "Logging in to Azure..." -Verbose
Add-AzureRmAccount `
-ServicePrincipal `
-TenantId $servicePrincipalConnection.TenantId `
-ApplicationId $servicePrincipalConnection.ApplicationId `
-CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint | Out-Null
}
catch {
if (!$servicePrincipalConnection)
{
$ErrorMessage = "Connection $connectionName not found."
throw $ErrorMessage
} else{
Write-Error -Message $_.Exception
throw $_.Exception
}
}
}
I assume "AzureRunAsConnection" needs to be changed but to what? Is this something that has to be changed in every runbook downloaded? What do I change it to?