Restore – Azure Automation Connections (Runbooks)
Im Folgenden findest du ein PowerShell-Skript, mit dem du Azure Automation Connections aus einer CSV-Datei wiederherstellen kannst.
<#
Restore Azure Automation Connections to another account
#>
## Source Automation Account
$ResourceGroup1 = "your data"
$AutomationAccount1 = "your data"
## Import CSV File
$CSVFile = "c:\TMP\BackupAutomationConnections_20230120.csv"
$data = Import-Csv -Path $CSVFile
## Connect to Azure AD by Managed Identity
Connect-AzAccount
# Restore Connections
$data | ForEach-Object {
$RunAsAccountConnectionFieldValues = @{"SubscriptionId" = $_.SubscriptionId; "TenantId" = $_.TenantId; "ApplicationId" = $_.ApplicationId; "CertificateThumbprint" = $_.CertificateThumbprint}
#Clone Connections to Azure Automation Account
New-AzAutomationConnection -Name $_.Name -ConnectionTypeName AzureServicePrincipal -ConnectionFieldValues $RunAsAccountConnectionFieldValues -ResourceGroupName $ResourceGroup -AutomationAccountName $AutomationAccount
}
DisConnect-AzAccount
Wie kann man Azure Automation Connections ein Backup erstellen? Schau dir den letzten Post an.