如何使用Azure REST ARM API上载或更新云服务证书

时间:2017-08-30 11:10:41

标签: azure azure-cloud-services azure-resource-manager

我必须上传云服务证书。

此URI上的PUT或POST无效subscriptions/%sub_Id%/resourceGroups/%rg_Name%/providers/Microsoft.ClassicCompute/domainNames/%cloudService_Name%/servicecertificates

我收到“InvalidRequestUri”,

请帮帮我。

1 个答案:

答案 0 :(得分:1)

你可以使用这样的东西:

"path": "subscriptions/%sub_Id%/resourceGroups/%rg_Name%/providers/Microsoft.ClassicCompute/domainNames/%cloudService_Name%/servicecertificates/SHA1-%THUMBPRINT%",
"body": {
     "thumbprintAlgorithm": "SHA1",
     "thumbprint": "%THUMBPRINT%",
     "data": "%base64encodedcert%",
     "certificateFormat": "pfx",
     "password": "password" << this is in plain text I believe
}

你的证书的%thumbprint%= sha1指纹,%base64encodedcert%你的pfx编码在base64。