Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否可以使用powershell将客户端身份验证证书(.pfx)添加到数据工厂中的Web活动_Powershell_Azure_Azure Data Factory_Azure Keyvault - Fatal编程技术网

是否可以使用powershell将客户端身份验证证书(.pfx)添加到数据工厂中的Web活动

是否可以使用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

我想向Data Factory中的Web活动添加客户端身份验证证书(.pfx)。需要从Azure密钥保管库获取证书

现在这是手动完成的

我想实现同样的自动化,是否可以使用powershell实现

我想实现同样的自动化,是否可以使用powershell实现

是的,我们可以使用添加客户端身份验证证书

以下是详细步骤,您可以参考

1.创建web活动定义json,有关更多信息,请参阅

2.从keyvault获取pfx文件,从keyvault获取的pfx文件是没有密码的文件。因此,我们需要将密码添加到pfx

$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"