Server Keys - Create Or Update
建立或更新伺服器金鑰。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}?api-version=2023-08-01
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
key
|
path | True |
string |
要作的伺服器金鑰名稱(已更新或建立)。 金鑰名稱必須是格式為 『vault_key_version』。 例如,如果keyId是 |
|
resource
|
path | True |
string |
包含資源的資源群組名稱。 您可以從 Azure Resource Manager API 或入口網站取得此值。 |
|
server
|
path | True |
string |
伺服器的名稱。 |
|
subscription
|
path | True |
string |
識別 Azure 訂用帳戶的訂用帳戶標識碼。 |
|
api-version
|
query | True |
string |
要用於要求的 API 版本。 |
要求本文
| 名稱 | 必要 | 類型 | Description |
|---|---|---|---|
| properties.serverKeyType | True |
伺服器密鑰類型,例如 'ServiceManaged'、'AzureKeyVault'。 |
|
| properties.uri |
string |
伺服器金鑰的 URI。 如果 ServerKeyType 是 AzureKeyVault,則需要 URI。 AKV URI 必須有下列格式:'https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion' |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
已成功更新伺服器金鑰。 |
|
| 201 Created |
已成功建立伺服器金鑰。 |
|
| 202 Accepted |
接受 標題 Location: string |
|
| Other Status Codes |
錯誤回應: ***
|
範例
Creates or updates a server key
範例要求
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/keys/someVault_someKey_01234567890123456789012345678901?api-version=2023-08-01
{
"properties": {
"serverKeyType": "AzureKeyVault",
"uri": "https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"
}
}
範例回覆
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/keys/someVault_someKey_01234567890123456789012345678901",
"name": "sqlcrudtest-4645",
"type": "Microsoft.Sql/servers/keys",
"location": "Japan East",
"kind": "azurekeyvault",
"properties": {
"thumbprint": "00112233445566778899AABBCCDDEEFFAABBCCDD",
"creationDate": "2020-11-15T00:00:00Z",
"autoRotationEnabled": false
}
}
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/servers/sqlcrudtest-4645/keys/someVault_someKey_01234567890123456789012345678901",
"name": "sqlcrudtest-4645",
"type": "Microsoft.Sql/servers/keys",
"location": "Japan East",
"kind": "azurekeyvault",
"properties": {
"thumbprint": "00112233445566778899AABBCCDDEEFFAABBCCDD",
"creationDate": "2020-11-15T00:00:00Z",
"autoRotationEnabled": false
}
}
定義
| 名稱 | Description |
|---|---|
|
Error |
資源管理錯誤其他資訊。 |
|
Error |
錯誤詳細數據。 |
|
Error |
錯誤回應 |
|
Server |
伺服器金鑰。 |
|
Server |
伺服器密鑰類型,例如 'ServiceManaged'、'AzureKeyVault'。 |
ErrorAdditionalInfo
資源管理錯誤其他資訊。
| 名稱 | 類型 | Description |
|---|---|---|
| info |
object |
其他資訊。 |
| type |
string |
其他信息類型。 |
ErrorDetail
錯誤詳細數據。
| 名稱 | 類型 | Description |
|---|---|---|
| additionalInfo |
錯誤其他資訊。 |
|
| code |
string |
錯誤碼。 |
| details |
錯誤詳細數據。 |
|
| message |
string |
錯誤訊息。 |
| target |
string |
錯誤目標。 |
ErrorResponse
錯誤回應
| 名稱 | 類型 | Description |
|---|---|---|
| error |
error 物件。 |
ServerKey
伺服器金鑰。
| 名稱 | 類型 | Description |
|---|---|---|
| id |
string |
資源標識碼。 |
| kind |
string |
加密保護裝置的種類。 這是用於 Azure 入口網站體驗的元數據。 |
| location |
string |
資源位置。 |
| name |
string |
資源名稱。 |
| properties.autoRotationEnabled |
boolean |
金鑰自動輪替選擇加入旗標。 True 或 false。 |
| properties.creationDate |
string (date-time) |
伺服器金鑰建立日期。 |
| properties.serverKeyType |
伺服器密鑰類型,例如 'ServiceManaged'、'AzureKeyVault'。 |
|
| properties.subregion |
string |
伺服器索引鍵的子區域。 |
| properties.thumbprint |
string |
伺服器金鑰的指紋。 |
| properties.uri |
string |
伺服器金鑰的 URI。 如果 ServerKeyType 是 AzureKeyVault,則需要 URI。 AKV URI 必須有下列格式:'https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion' |
| type |
string |
資源類型。 |
ServerKeyType
伺服器密鑰類型,例如 'ServiceManaged'、'AzureKeyVault'。
| 值 | Description |
|---|---|
| ServiceManaged | |
| AzureKeyVault |