是否可以使用powershell将客户端身份验证证书(.pfx)添加到数据工厂中的Web活动
我想向Data Factory中的Web活动添加客户端身份验证证书(.pfx)。需要从Azure密钥保管库获取证书 现在这是手动完成的 我想实现同样的自动化,是否可以使用powershell实现 我想实现同样的自动化,是否可以使用powershell实现 是的,我们可以使用添加客户端身份验证证书 以下是详细步骤,您可以参考 1.创建web活动定义json,有关更多信息,请参阅 2.从keyvault获取pfx文件,从keyvault获取的pfx文件是没有密码的文件。因此,我们需要将密码添加到pfx是否可以使用powershell将客户端身份验证证书(.pfx)添加到数据工厂中的Web活动,powershell,azure,azure-data-factory,azure-keyvault,Powershell,Azure,Azure Data Factory,Azure Keyvault,我想向Data Factory中的Web活动添加客户端身份验证证书(.pfx)。需要从Azure密钥保管库获取证书 现在这是手动完成的 我想实现同样的自动化,是否可以使用powershell实现 我想实现同样的自动化,是否可以使用powershell实现 是的,我们可以使用添加客户端身份验证证书 以下是详细步骤,您可以参考 1.创建web活动定义json,有关更多信息,请参阅 2.从keyvault获取pfx文件,从keyvault获取的pfx文件是没有密码的文件。因此,我们需要将密码添加到pf
$kvSecret = Get-AzureKeyVaultSecret -VaultName $vaultName -Name $secretName
$kvSecretBytes = [System.Convert]::FromBase64String($kvSecret.SecretValueText)
$certCollection = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2Collection
$certCollection.Import($kvSecretBytes,$null,[System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::Exportable)
$password = '******'
$protectedCertificateBytes = $certCollection.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Pkcs12, $password)
$pfxPath = [Environment]::GetFolderPath("Desktop") + "\MyCert.pfx"
[System.IO.File]::WriteAllBytes($pfxPath, $protectedCertificateBytes)
3.使用pfx值和密码更新json文件
4.运行set-AzureRmDataFactory命令
Set-AzureRmDataFactoryV2Pipeline -ResourceGroupName "resourceGroup" -Name "name" -DataFactoryName "factoryName" -File "C:\webactivity.json"