从 azure rest api 上传证书失败

Upload certificate from azure rest api failing

问题陈述:

在 Azure AD 下注册的应用程序中更新证书。

问题:

我在从 MS Graph API > 应用程序 - PATCH 更新应用程序属性发送 PATCH 时遇到问题。

问题是每当我尝试更改 KeyCredentials 并上传失败时 key value cannot be null or empty。现在,当我从 GET 检索应用程序 属性 详细信息中检查其他证书时,它们为空。我无法理解这个键值是什么,因为我尝试使用 OpenSSL 在本地读取我的证书,但找不到任何值。

任何人都可以在 RestAPI 中帮助我,或者是否有任何 SDK 可以帮助上传证书。

此致

问题是每当我尝试更改 KeyCredentials 并上传它时 键值不能为 null 或空。

Ans: The Key Credential requires a value to be uploaded in key , otherwise it will fail.

现在,当我从 GET 检索中检查其他证书时 应用程序 属性 详细信息,它们为空。

Ans: It by default shows the secure string values as null when you do a select then only you can find out the secure string values.

我无法理解这个键值是什么,因为我试图使用 OpenSSL 在本地读取我的证书,但找不到任何值。

Ans: When you open the .cer file in wordpad it will show you something like :

-----BEGIN CERTIFICATE-----
<<sensitive_values>>
-----END CERTIFICATE-----

Basically the sensitive value can be used for the value of key .

但是假设我还想要完整的字段和密钥,我将必须提供 select= 中的所有字段......有没有其他方法可以处理这个问题?

Ans: There is no other way to get the values , except for selecting all the required fields you need.

有什么方法可以上传文件而不是读取数据并提出补丁请求吗?

Ans: Unfortunately No, As of now there is no direct way to upload a cert file instead of reading it and then uploading it.