共用方式為


Named Value - Create Or Update

建立或更新具名值。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}?api-version=2024-05-01

URI 參數

名稱 位於 必要 類型 Description
namedValueId
path True

string

maxLength: 256
pattern: ^[^*#&+:<>?]+$

NamedValue 的標識碼。

resourceGroupName
path True

string

minLength: 1
maxLength: 90

資源群組的名稱。 名稱不區分大小寫。

serviceName
path True

string

minLength: 1
maxLength: 50
pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

API 管理服務的名稱。

subscriptionId
path True

string (uuid)

目標訂用帳戶的標識碼。 此值必須是 UUID。

api-version
query True

string

minLength: 1

要用於這項作業的 API 版本。

要求標頭

名稱 必要 類型 Description
If-Match

string

實體的 ETag。 建立實體時不需要,但在更新實體時則為必要專案。

要求本文

名稱 必要 類型 Description
properties.displayName True

string

minLength: 1
maxLength: 256
pattern: ^[A-Za-z0-9-._]+$

NamedValue 的唯一名稱。 它只能包含字母、數位、句點、虛線和底線字元。

properties.keyVault

KeyVaultContractCreateProperties

namedValue的KeyVault位置詳細數據。

properties.secret

boolean

判斷值是否為秘密,且是否應加密。 默認值為 false。

properties.tags

string[]

提供時可用來篩選 NamedValue 清單的選擇性標籤。

properties.value

string

maxLength: 4096

NamedValue 的值。 可以包含原則表達式。 它不可以是空的,或只包含空格符。 此屬性不會填入 『GET』 作業! 使用 '/listSecrets' POST 要求來取得值。

回應

名稱 類型 Description
200 OK

NamedValueContract

具名值已成功更新。

標題

  • ETag: string
  • location: string
  • Azure-AsyncOperation: string
201 Created

NamedValueContract

已成功建立具名值。

標題

  • ETag: string
  • location: string
  • Azure-AsyncOperation: string
Other Status Codes

ErrorResponse

描述作業失敗原因的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

類型: oauth2
Flow: implicit
授權 URL: https://login.microsoftonline.com/common/oauth2/authorize

範圍

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

ApiManagementCreateNamedValue
ApiManagementCreateNamedValueWithKeyVault

ApiManagementCreateNamedValue

範例要求

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop2?api-version=2024-05-01

{
  "properties": {
    "displayName": "prop3name",
    "value": "propValue",
    "tags": [
      "foo",
      "bar"
    ],
    "secret": false
  }
}

範例回覆

location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop2?api-version=2024-05-01&asyncId=5c730e343244df1b9cb56e85&asyncCode=201
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tenant/operationResults/5c730e343244df1b9cb56e85?api-version=2024-05-01
{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop2",
  "type": "Microsoft.ApiManagement/service/namedValues",
  "name": "testprop2",
  "properties": {
    "displayName": "prop3name",
    "value": "propValue",
    "tags": [
      "foo",
      "bar"
    ],
    "secret": false,
    "provisioningState": "InProgress"
  }
}
location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop2?api-version=2024-05-01&asyncId=5c730e343244df1b9cb56e85&asyncCode=200
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tenant/operationResults/5c730e343244df1b9cb56e85?api-version=2024-05-01
{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop2",
  "type": "Microsoft.ApiManagement/service/namedValues",
  "name": "testprop2",
  "properties": {
    "displayName": "prop3name",
    "value": "propValue",
    "tags": [
      "foo",
      "bar"
    ],
    "secret": false,
    "provisioningState": "InProgress"
  }
}

ApiManagementCreateNamedValueWithKeyVault

範例要求

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6?api-version=2024-05-01

{
  "properties": {
    "displayName": "prop6namekv",
    "keyVault": {
      "identityClientId": "ceaa6b06-c00f-43ef-99ac-f53d1fe876a0",
      "secretIdentifier": "https://contoso.vault.azure.net/secrets/aadSecret"
    },
    "tags": [
      "foo",
      "bar"
    ],
    "secret": true
  }
}

範例回覆

location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6?api-version=2024-05-01&asyncId=5c730e343244df1b9cb56e85&asyncCode=201
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tenant/operationResults/5c730e343244df1b9cb56e85?api-version=2024-05-01
{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6",
  "type": "Microsoft.ApiManagement/service/namedValues",
  "name": "testprop6",
  "properties": {
    "displayName": "prop6namekv",
    "keyVault": {
      "secretIdentifier": "https://contoso.vault.azure.net/secrets/aadSecret",
      "identityClientId": "ceaa6b06-c00f-43ef-99ac-f53d1fe876a0",
      "lastStatus": {
        "code": "Success",
        "timeStampUtc": "2020-09-11T00:54:31.8024882Z"
      }
    },
    "tags": [
      "foo",
      "bar"
    ],
    "secret": true,
    "provisioningState": "InProgress"
  }
}
location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6?api-version=2024-05-01&asyncId=5c730e343244df1b9cb56e85&asyncCode=200
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/tenant/operationResults/5c730e343244df1b9cb56e85?api-version=2024-05-01
{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6",
  "type": "Microsoft.ApiManagement/service/namedValues",
  "name": "testprop6",
  "properties": {
    "displayName": "prop6namekv",
    "keyVault": {
      "secretIdentifier": "https://contoso.vault.azure.net/secrets/aadSecret",
      "identityClientId": "ceaa6b06-c00f-43ef-99ac-f53d1fe876a0",
      "lastStatus": {
        "code": "Success",
        "timeStampUtc": "2020-09-11T00:54:31.8024882Z"
      }
    },
    "tags": [
      "foo",
      "bar"
    ],
    "secret": true,
    "provisioningState": "InProgress"
  }
}

定義

名稱 Description
ErrorAdditionalInfo

資源管理錯誤其他資訊。

ErrorDetail

錯誤詳細數據。

ErrorResponse

錯誤回應

KeyVaultContractCreateProperties

建立keyVault合約詳細數據。

KeyVaultContractProperties

KeyVault 合約詳細數據。

KeyVaultLastAccessStatusContractProperties

發出合約更新屬性。

NamedValueContract

NamedValue 詳細數據。

NamedValueCreateContract

NamedValue 詳細數據。

ErrorAdditionalInfo

資源管理錯誤其他資訊。

名稱 類型 Description
info

object

其他資訊。

type

string

其他信息類型。

ErrorDetail

錯誤詳細數據。

名稱 類型 Description
additionalInfo

ErrorAdditionalInfo[]

錯誤其他資訊。

code

string

錯誤碼。

details

ErrorDetail[]

錯誤詳細數據。

message

string

錯誤訊息。

target

string

錯誤目標。

ErrorResponse

錯誤回應

名稱 類型 Description
error

ErrorDetail

error 物件。

KeyVaultContractCreateProperties

建立keyVault合約詳細數據。

名稱 類型 Description
identityClientId

string

SystemAssignedIdentity 或 UserAssignedIdentity 的用戶端標識符為 Null,用來存取密鑰保存庫密碼。

secretIdentifier

string

用於擷取秘密的金鑰保存庫秘密標識碼。 提供版本設定的秘密將防止自動重新整理。 這需要使用 aka.ms/apimmsi 設定 API 管理服務

KeyVaultContractProperties

KeyVault 合約詳細數據。

名稱 類型 Description
identityClientId

string

SystemAssignedIdentity 或 UserAssignedIdentity 的用戶端標識符為 Null,用來存取密鑰保存庫密碼。

lastStatus

KeyVaultLastAccessStatusContractProperties

上次從金鑰保存庫同步處理和重新整理秘密狀態。

secretIdentifier

string

用於擷取秘密的金鑰保存庫秘密標識碼。 提供版本設定的秘密將防止自動重新整理。 這需要使用 aka.ms/apimmsi 設定 API 管理服務

KeyVaultLastAccessStatusContractProperties

發出合約更新屬性。

名稱 類型 Description
code

string

上次從金鑰保存庫同步和重新整理秘密的狀態代碼。

message

string

錯誤的詳細數據,否則為空白。

timeStampUtc

string (date-time)

上次存取秘密的時間。 日期符合下列格式:yyyy-MM-ddTHH:mm:ssZ ISO 8601 標準所指定。

NamedValueContract

NamedValue 詳細數據。

名稱 類型 Description
id

string

資源的完整資源標識碼。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

資源的名稱

properties.displayName

string

minLength: 1
maxLength: 256
pattern: ^[A-Za-z0-9-._]+$

NamedValue 的唯一名稱。 它只能包含字母、數位、句點、虛線和底線字元。

properties.keyVault

KeyVaultContractProperties

namedValue的KeyVault位置詳細數據。

properties.provisioningState

string

布建狀態

properties.secret

boolean

判斷值是否為秘密,且是否應加密。 默認值為 false。

properties.tags

string[]

提供時可用來篩選 NamedValue 清單的選擇性標籤。

properties.value

string

maxLength: 4096

NamedValue 的值。 可以包含原則表達式。 它不可以是空的,或只包含空格符。 此屬性不會填入 『GET』 作業! 使用 '/listSecrets' POST 要求來取得值。

type

string

資源的型別。 例如“Microsoft.Compute/virtualMachines” 或 “Microsoft.Storage/storageAccounts”

NamedValueCreateContract

NamedValue 詳細數據。

名稱 類型 Description
id

string

資源的完整資源標識碼。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

資源的名稱

properties.displayName

string

minLength: 1
maxLength: 256
pattern: ^[A-Za-z0-9-._]+$

NamedValue 的唯一名稱。 它只能包含字母、數位、句點、虛線和底線字元。

properties.keyVault

KeyVaultContractCreateProperties

namedValue的KeyVault位置詳細數據。

properties.secret

boolean

判斷值是否為秘密,且是否應加密。 默認值為 false。

properties.tags

string[]

提供時可用來篩選 NamedValue 清單的選擇性標籤。

properties.value

string

maxLength: 4096

NamedValue 的值。 可以包含原則表達式。 它不可以是空的,或只包含空格符。 此屬性不會填入 『GET』 作業! 使用 '/listSecrets' POST 要求來取得值。

type

string

資源的型別。 例如“Microsoft.Compute/virtualMachines” 或 “Microsoft.Storage/storageAccounts”