Certificates - Create Or Update
创建或更新证书的说明。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}?api-version=2025-05-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
name
|
path | True |
string |
证书的名称。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 此名称不区分大小写。 |
|
subscription
|
path | True |
string (uuid) |
目标订阅的 ID。 该值必须是 UUID。 |
|
api-version
|
query | True |
string minLength: 1 |
要用于此操作的 API 版本。 |
请求正文
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| location | True |
string |
资源所在的地理位置 |
| kind |
string |
资源类型。 如果资源是应用,可以参考 https://github.com/Azure/app-service-linux-docs/blob/master/Things_You_Should_Know/kind_property.md#app-service-resource-kind-reference 了解类型支持的详细信息值。 |
|
| properties.canonicalName |
string |
要通过免费证书颁发的证书的 CNAME |
|
| properties.domainValidationMethod |
string |
免费证书的域验证方法 |
|
| properties.hostNames |
string[] |
证书适用的主机名。 |
|
| properties.keyVaultId |
string (arm-id) |
Azure Key Vault Csm 资源 ID。 |
|
| properties.keyVaultSecretName |
string |
Azure Key Vault 机密名称。 |
|
| properties.password |
string |
证书密码。 |
|
| properties.pfxBlob |
string (byte) |
Pfx blob。 |
|
| properties.serverFarmId |
string (arm-id) |
关联的应用服务计划的资源 ID。 |
|
| tags |
object |
资源标记。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
资源“证书”更新作成功 |
|
| Other Status Codes |
意外的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 流程。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
Create Or Update Certificate
示例请求
示例响应
{
"name": "testc6282",
"type": "Microsoft.Web/certificates",
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/certificates/testc6282",
"location": "East US",
"properties": {
"expirationDate": "2039-12-31T23:59:59+00:00",
"friendlyName": "",
"hostNames": [
"ServerCert"
],
"issueDate": "2015-11-12T23:40:25+00:00",
"issuer": "CACert",
"subjectName": "ServerCert",
"thumbprint": "FE703D7411A44163B6D32B3AD9B03E175886EBFE"
}
}
定义
| 名称 | 说明 |
|---|---|
| Certificate |
应用的 SSL 证书。 |
|
created |
创建资源的标识的类型。 |
|
Default |
应用服务错误响应。 |
|
Default |
错误模型。 |
|
Default |
详细错误。 |
|
Hosting |
用于此资源的应用服务环境的规范。 |
|
Key |
密钥保管库机密的状态。 |
|
system |
与创建和上次修改资源相关的元数据。 |
Certificate
应用的 SSL 证书。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string (arm-id) |
资源的完全限定资源 ID。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}” |
| kind |
string |
资源类型。 如果资源是应用,可以参考 https://github.com/Azure/app-service-linux-docs/blob/master/Things_You_Should_Know/kind_property.md#app-service-resource-kind-reference 了解类型支持的详细信息值。 |
| location |
string |
资源所在的地理位置 |
| name |
string |
资源的名称 |
| properties.canonicalName |
string |
要通过免费证书颁发的证书的 CNAME |
| properties.cerBlob |
string (byte) |
.cer文件的原始字节数 |
| properties.domainValidationMethod |
string |
免费证书的域验证方法 |
| properties.expirationDate |
string (date-time) |
证书到期日期。 |
| properties.friendlyName |
string |
证书的友好名称。 |
| properties.hostNames |
string[] |
证书适用的主机名。 |
| properties.hostingEnvironmentProfile |
用于证书的应用服务环境的规范。 |
|
| properties.issueDate |
string (date-time) |
证书颁发日期。 |
| properties.issuer |
string |
证书颁发者。 |
| properties.keyVaultId |
string (arm-id) |
Azure Key Vault Csm 资源 ID。 |
| properties.keyVaultSecretName |
string |
Azure Key Vault 机密名称。 |
| properties.keyVaultSecretStatus |
密钥保管库机密的状态。 |
|
| properties.password |
string |
证书密码。 |
| properties.pfxBlob |
string (byte) |
Pfx blob。 |
| properties.publicKeyHash |
string |
公钥哈希。 |
| properties.selfLink |
string |
自链接。 |
| properties.serverFarmId |
string (arm-id) |
关联的应用服务计划的资源 ID。 |
| properties.siteName |
string |
应用名称。 |
| properties.subjectName |
string |
证书的使用者名称。 |
| properties.thumbprint |
string |
证书指纹。 |
| properties.valid |
boolean |
证书是否有效? |
| systemData |
包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。 |
|
| tags |
object |
资源标记。 |
| type |
string |
资源类型。 例如,“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” |
createdByType
创建资源的标识的类型。
| 值 | 说明 |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
DefaultErrorResponse
应用服务错误响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误模型。 |
DefaultErrorResponseError
错误模型。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
标准化字符串,以编程方式识别错误。 |
| details |
详细错误。 |
|
| innererror |
string |
调试错误的更多信息。 |
| message |
string |
详细的错误描述和调试信息。 |
| target |
string |
详细的错误描述和调试信息。 |
DefaultErrorResponseErrorDetailsItem
详细错误。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
标准化字符串,以编程方式识别错误。 |
| message |
string |
详细的错误描述和调试信息。 |
| target |
string |
详细的错误描述和调试信息。 |
HostingEnvironmentProfile
用于此资源的应用服务环境的规范。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
应用服务环境的资源 ID。 |
| name |
string |
应用服务环境的名称。 |
| type |
string |
应用服务环境的资源类型。 |
KeyVaultSecretStatus
密钥保管库机密的状态。
| 值 | 说明 |
|---|---|
| Initialized | |
| WaitingOnCertificateOrder | |
| Succeeded | |
| CertificateOrderFailed | |
| OperationNotPermittedOnKeyVault | |
| AzureServiceUnauthorizedToAccessKeyVault | |
| KeyVaultDoesNotExist | |
| KeyVaultSecretDoesNotExist | |
| UnknownError | |
| ExternalPrivateKey | |
| Unknown |
systemData
与创建和上次修改资源相关的元数据。
| 名称 | 类型 | 说明 |
|---|---|---|
| createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
| createdBy |
string |
创建资源的标识。 |
| createdByType |
创建资源的标识的类型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的资源时间戳(UTC) |
| lastModifiedBy |
string |
上次修改资源的标识。 |
| lastModifiedByType |
上次修改资源的标识的类型。 |