我正在寻找一种方式来实现在做一个蓝色的自动化密钥轮换我已经找到一种方法来创建一个PowerShell的运行手册,并已实现了以下代码:Azure的旋转存储密钥和更新ADF链接服务
$azureAccountName = <acct_name>
$azurePassword = ConvertTo-SecureString <pass> -AsPlainText -Force
$psCred = New-Object System.Management.Automation.PSCredential($azureAccountName, $azurePassword)
Login-AzureRmAccount -ServicePrincipal -Credential $psCred -TenantId <tenant id> -SubscriptionId <sub id>
#Optionally you may set the following as parameters
$StorageAccountName = <storage acct name>
$RGName = <rg name>
#Key name. For example key1 or key2 for the storage account
New-AzureRmStorageAccountKey -ResourceGroupName $RGName -Name $StorageAccountName -KeyName "key1" -Verbose
New-AzureRmStorageAccountKey -ResourceGroupName $RGName -Name $StorageAccountName -KeyName "key2" -Verbose
当我运行这个,它工作,但是,它打破了我的Azure数据工厂链接服务。我意识到链接服务的连接字符串被破坏,所以我着手尝试重置自动化脚本中的连接字符串。我能够做得到连接字符串:
(Get-AzureRmDataFactoryLinkedService -DataFactoryName <adf name> -ResourceGroupName <rg name> -Name <ls name>).Properties.TypeProperties.ConnectionString
我不能找到一种方法来设置使用PowerShell和蔚蓝的自动化此连接字符串。
我们仍在研究此解决方案并将其作为Hybrid Runbook Worker运行。谢谢你的回答! –