如何获取带有过期日期,证书名称,指纹的Azure云服务(经典)证书详细信息

时间:2019-07-02 09:50:22

标签: azure powershell az

我已经获得了所有云服务(经典)证书的详细信息,包括过期日期,证书名称和他的指纹

我希望这种类型的输出


云服务名称 云服务证书名称 云服务到期日期 云服务指纹

注意:-我们没有使用AzureRm命令

1 个答案:

答案 0 :(得分:0)

我建议您简单地调用rest api以获得证书。这是一个API,可为您提供位于一个特定资源组下的证书详细信息。(示例包括Azure Web服务)

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates?api-version=2016-03-01

样品申请

GET https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates?api-version=2016-03-01

这是示例响应。

{
  "value": [
    {
      "id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc6282",
      "name": "testc6282",
      "type": "Microsoft.Web/certificates",
      "location": "East US",
      "properties": {
        "friendlyName": "",
        "subjectName": "ServerCert",
        "hostNames": [
          "ServerCert"
        ],
        "issuer": "CACert",
        "issueDate": "2015-11-12T23:40:25+00:00",
        "expirationDate": "2039-12-31T23:59:59+00:00",
        "thumbprint": "FE703D7411A44163B6D32B3AD9B03E175886EBFE",
        "password": "SWsSsd__233$Sdsds#%Sd!"
      }
    },
    {
      "id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc4912",
      "name": "testc4912",
      "type": "Microsoft.Web/certificates",
      "location": "West US",
      "properties": {
        "friendlyName": "",
        "subjectName": "ServerCert2",
        "hostNames": [
          "ServerCert2"
        ],
        "issuer": "CACert",
        "issueDate": "2015-12-12T23:40:25+00:00",
        "expirationDate": "2040-12-31T23:59:59+00:00",
        "thumbprint": "FE703D7411A44163B6D32B3AD9B0490D5886EBFE",
        "password": "SWsSsd__233$Sdsds#%Sd!"
      }
    }
  ]
}

您可以在此处找到更多详细信息。

https://docs.microsoft.com/en-us/rest/api/appservice/certificates/listbyresourcegroup

希望有帮助。