Share via


Key Values - Create Or Update

Creates a key-value. NOTE: This operation is intended for use in ARM Template deployments. For all other scenarios involving App Configuration key-values the data plane API should be used instead.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}?api-version=2024-05-01

URI Parameters

Name In Required Type Description
configStoreName
path True

string

minLength: 5
maxLength: 50
pattern: ^[a-zA-Z0-9_-]*$

The name of the configuration store.

keyValueName
path True

string

Identifier of key and label combination. Key and label are joined by $ character. Label is optional.

resourceGroupName
path True

string

The name of the resource group to which the container registry belongs.

subscriptionId
path True

string

The Microsoft Azure subscription ID.

api-version
query True

string

The client API version.

Request Body

Name Type Description
properties.contentType

string

The content type of the key-value's value. Providing a proper content-type can enable transformations of values when they are retrieved by applications.

properties.tags

object

A dictionary of tags that can help identify what a key-value may be applicable for.

properties.value

string

The value of the key-value.

Responses

Name Type Description
200 OK

KeyValue

The request was successful; the request was well-formed and received properly.

Other Status Codes

ErrorResponse

Error response describing why the operation failed

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

KeyValues_CreateOrUpdate

Sample request

PUT https://management.azure.com/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso/keyValues/myKey$myLabel?api-version=2024-05-01

{
  "properties": {
    "value": "myValue",
    "tags": {
      "tag1": "tagValue1",
      "tag2": "tagValue2"
    }
  }
}

Sample response

{
  "type": "Microsoft.AppConfiguration/configurationStores/keyValues",
  "properties": {
    "key": "myKey",
    "label": "myLabel",
    "value": "myValue",
    "contentType": "",
    "eTag": "IhDxoa8VkXxPsYsemBlxvV0d5fp",
    "lastModified": "2020-06-23T06:42:24+00:00",
    "locked": false,
    "tags": {
      "tag1": "tagValue1",
      "tag2": "tagValue2"
    }
  },
  "id": "/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.AppConfiguration/configurationStores/contoso/keyValues/myKey$myLabel",
  "name": "myKey$myLabel"
}

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetails

The details of the error.

ErrorResponse

Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

KeyValue

The key-value resource along with all resource properties.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetails

The details of the error.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

Error code.

message

string

Error message indicating why the operation failed.

ErrorResponse

Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.

Name Type Description
error

ErrorDetails

The details of the error.

KeyValue

The key-value resource along with all resource properties.

Name Type Description
id

string

The resource ID.

name

string

The name of the resource.

properties.contentType

string

The content type of the key-value's value. Providing a proper content-type can enable transformations of values when they are retrieved by applications.

properties.eTag

string

An ETag indicating the state of a key-value within a configuration store.

properties.key

string

The primary identifier of a key-value. The key is used in unison with the label to uniquely identify a key-value.

properties.label

string

A value used to group key-values. The label is used in unison with the key to uniquely identify a key-value.

properties.lastModified

string (date-time)

The last time a modifying operation was performed on the given key-value.

properties.locked

boolean

A value indicating whether the key-value is locked. A locked key-value may not be modified until it is unlocked.

properties.tags

object

A dictionary of tags that can help identify what a key-value may be applicable for.

properties.value

string

The value of the key-value.

type

string

The type of the resource.