az ad app credential
管理应用程序的密码或证书凭据。
命令
| 名称 | 说明 | 类型 | Status |
|---|---|---|---|
| az ad app credential delete |
删除应用程序的密码或证书凭据。 |
Core | GA |
| az ad app credential list |
列出应用程序的密码或证书凭据元数据。 (密码或证书凭据的内容不可检索。 |
Core | GA |
| az ad app credential reset |
重置应用程序的密码或证书凭据。 |
Core | GA |
az ad app credential delete
删除应用程序的密码或证书凭据。
az ad app credential delete --id
--key-id
[--cert]
示例
删除应用程序的密码凭据
az ad app credential delete --id 00000000-0000-0000-0000-000000000000 --key-id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
删除应用程序的证书凭据
az ad app credential delete --id 00000000-0000-0000-0000-000000000000 --key-id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --cert
必需参数
标识符 URI、应用程序 ID 或对象 ID。
凭据密钥 ID。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
对证书凭据进行作。
| 属性 | 值 |
|---|---|
| 默认值: | False |
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ad app credential list
列出应用程序的密码或证书凭据元数据。 (密码或证书凭据的内容不可检索。
az ad app credential list --id
[--cert]
示例
列出应用程序的密码凭据
az ad app credential list --id 00000000-0000-0000-0000-000000000000
列出应用程序的证书凭据
az ad app credential list --id 00000000-0000-0000-0000-000000000000 --cert
必需参数
标识符 URI、应用程序 ID 或对象 ID。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
对证书凭据进行作。
| 属性 | 值 |
|---|---|
| 默认值: | False |
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ad app credential reset
重置应用程序的密码或证书凭据。
默认情况下,此命令会清除所有密码和密钥,并允许图形服务生成密码凭据。
输出包括必须保护的凭据。 请确保代码中不包含这些凭据,或将凭据签入源代码管理中。 作为替代方法,请考虑使用 托管标识 (如果可用),以避免需要使用凭据。
az ad app credential reset --id
[--append]
[--cert]
[--create-cert]
[--display-name]
[--end-date]
[--keyvault]
[--years]
示例
使用密码重置应用程序的凭据
az ad app credential reset --id 00000000-0000-0000-0000-000000000000
使用新的自签名证书重置应用程序的凭据
az ad app credential reset --id 00000000-0000-0000-0000-000000000000 --create-cert
使用证书字符串将证书追加到应用程序。
az ad app credential reset --id 00000000-0000-0000-0000-000000000000 --cert "MIICoT..." --append
使用证书文件将证书追加到应用程序。
az ad app credential reset --id 00000000-0000-0000-0000-000000000000 --cert "@~/cert.pem" --append
`cert.pem` contains the following content
-----BEGIN CERTIFICATE----- <<< this line is optional
MIICoT...
-----END CERTIFICATE----- <<< this line is optional
必需参数
标识符 URI、应用程序 ID 或对象 ID。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
追加新凭据,而不是覆盖。
| 属性 | 值 |
|---|---|
| Parameter group: | Credential Arguments |
| 默认值: | False |
用于凭据的证书。 与 --keyvault,一起使用时,指示要使用的证书的名称或创建证书。 否则,请提供 PEM 或 DER 格式的公共证书字符串。 使用 @{path} 从文件加载。 请勿包含私钥。
| 属性 | 值 |
|---|---|
| Parameter group: | keyCredential Arguments |
创建用于凭据的自签名证书。 只有当前 OS 用户具有对此证书的读/写权限。 与 --keyvault 一起使用,在 Key Vault 中创建证书。 否则,将在本地创建证书。
| 属性 | 值 |
|---|---|
| Parameter group: | keyCredential Arguments |
| 默认值: | False |
凭据的友好名称。
| 属性 | 值 |
|---|---|
| Parameter group: | Credential Arguments |
如果“--years”不足,则到期时间的粒度较细,例如“2020-12-31T11:59:59+00:00”或“2299-12-31”。
| 属性 | 值 |
|---|---|
| Parameter group: | Credential Arguments |
用于创建或检索证书的 KeyVault 的名称或 ID。
| 属性 | 值 |
|---|---|
| Parameter group: | keyCredential Arguments |
凭据的有效年数。 默认值:1 年。
| 属性 | 值 |
|---|---|
| Parameter group: | Credential Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |