Tokens - Create
Creates a token for a container registry with the specified parameters.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}?api-version=2023-01-01-preview
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
registry
|
path | True |
string minLength: 5maxLength: 50 pattern: ^[a-zA-Z0-9]*$ |
The name of the container registry. |
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
subscription
|
path | True |
string (uuid) |
The ID of the target subscription. The value must be an UUID. |
token
|
path | True |
string minLength: 5maxLength: 50 pattern: ^[a-zA-Z0-9-]*$ |
The name of the token. |
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
Name | Type | Description |
---|---|---|
properties.credentials |
The credentials that can be used for authenticating the token. |
|
properties.scopeMapId |
string |
The resource ID of the scope map to which the token will be associated with. |
properties.status |
The status of the token example enabled or disabled. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
The request was successful; the request was well-formed and received properly. |
|
201 Created |
The request was successful; the operation will complete asynchronously. Headers Azure-AsyncOperation: string |
|
Other Status Codes |
Error response describing why the operation failed. If any of the input parameters are invalid, 400 (Bad Request) is returned. If the request cannot be processed due to a conflict in the request, 409 (Conflict) is returned. |
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
TokenCreate
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken?api-version=2023-01-01-preview
{
"properties": {
"scopeMapId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap",
"status": "disabled",
"credentials": {
"certificates": [
{
"name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dPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="
}
]
}
}
}
Sample response
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken",
"name": "myToken",
"type": "Microsoft.ContainerRegistry/registries/tokens",
"properties": {
"creationDate": "2017-03-01T23:14:37.0707808Z",
"scopeMapId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap",
"provisioningState": "Succeeded",
"status": "disabled",
"credentials": {
"certificates": [
{
"name": "certificate1",
"thumbprint": "feeb79a888bf1415f8e17c4965a2a5bb5c8a2ff7",
"expiry": "2020-12-04T15:32:48.0707808Z"
}
]
}
}
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken/operationStatuses/tokens-00000000-0000-0000-0000-000000000000?api-version=2023-01-01-preview
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken",
"name": "myToken",
"type": "Microsoft.ContainerRegistry/registries/tokens",
"properties": {
"creationDate": "2017-03-01T23:14:37.0707808Z",
"scopeMapId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap",
"provisioningState": "Succeeded",
"status": "disabled",
"credentials": {
"certificates": [
{
"name": "certificate1",
"thumbprint": "feeb79a888bf1415f8e17c4965a2a5bb5c8a2ff7",
"expiry": "2020-12-04T15:32:48.0707808Z"
}
]
}
}
}
Definitions
Name | Description |
---|---|
created |
The type of identity that created the resource. |
Error |
An error response from the Azure Container Registry service. |
Error |
An error response from the Azure Container Registry service. |
Inner |
inner error. |
last |
The type of identity that last modified the resource. |
Provisioning |
Provisioning state of the resource. |
System |
Metadata pertaining to creation and last modification of the resource. |
Token |
An object that represents a token for a container registry. |
Token |
The properties of a certificate used for authenticating a token. |
Token |
|
Token |
The properties of the credentials that can be used for authenticating the token. |
Token |
The password that will be used for authenticating the token of a container registry. |
Token |
The password name "password1" or "password2" |
Token |
The status of the token example enabled or disabled. |
createdByType
The type of identity that created the resource.
Value | Description |
---|---|
User | |
Application | |
ManagedIdentity | |
Key |
ErrorResponse
An error response from the Azure Container Registry service.
Name | Type | Description |
---|---|---|
error |
Azure container registry build API error body. |
ErrorResponseBody
An error response from the Azure Container Registry service.
Name | Type | Description |
---|---|---|
code |
string |
error code. |
details |
an array of additional nested error response info objects, as described by this contract. |
|
message |
string |
error message. |
target |
string |
target of the particular error. |
InnerErrorDescription
inner error.
Name | Type | Description |
---|---|---|
code |
string |
error code. |
message |
string |
error message. |
target |
string |
target of the particular error. |
lastModifiedByType
The type of identity that last modified the resource.
Value | Description |
---|---|
User | |
Application | |
ManagedIdentity | |
Key |
ProvisioningState
Provisioning state of the resource.
Value | Description |
---|---|
Creating | |
Updating | |
Deleting | |
Succeeded | |
Failed | |
Canceled |
SystemData
Metadata pertaining to creation and last modification of the resource.
Name | Type | Description |
---|---|---|
createdAt |
string (date-time) |
The timestamp of resource creation (UTC). |
createdBy |
string |
The identity that created the resource. |
createdByType |
The type of identity that created the resource. |
|
lastModifiedAt |
string (date-time) |
The timestamp of resource modification (UTC). |
lastModifiedBy |
string |
The identity that last modified the resource. |
lastModifiedByType |
The type of identity that last modified the resource. |
Token
An object that represents a token for a container registry.
Name | Type | Description |
---|---|---|
id |
string |
The resource ID. |
name |
string |
The name of the resource. |
properties.creationDate |
string (date-time) |
The creation date of scope map. |
properties.credentials |
The credentials that can be used for authenticating the token. |
|
properties.provisioningState |
Provisioning state of the resource. |
|
properties.scopeMapId |
string |
The resource ID of the scope map to which the token will be associated with. |
properties.status |
The status of the token example enabled or disabled. |
|
systemData |
Metadata pertaining to creation and last modification of the resource. |
|
type |
string |
The type of the resource. |
TokenCertificate
The properties of a certificate used for authenticating a token.
Name | Type | Description |
---|---|---|
encodedPemCertificate |
string |
Base 64 encoded string of the public certificate1 in PEM format that will be used for authenticating the token. |
expiry |
string (date-time) |
The expiry datetime of the certificate. |
name | ||
thumbprint |
string |
The thumbprint of the certificate. |
TokenCertificateName
Value | Description |
---|---|
certificate1 | |
certificate2 |
TokenCredentialsProperties
The properties of the credentials that can be used for authenticating the token.
Name | Type | Description |
---|---|---|
certificates |
The properties of a certificate used for authenticating a token. |
|
passwords |
The password that will be used for authenticating the token of a container registry. |
TokenPassword
The password that will be used for authenticating the token of a container registry.
Name | Type | Description |
---|---|---|
creationTime |
string (date-time) |
The creation datetime of the password. |
expiry |
string (date-time) |
The expiry datetime of the password. |
name |
The password name "password1" or "password2" |
|
value |
string |
The password value. |
TokenPasswordName
The password name "password1" or "password2"
Value | Description |
---|---|
password1 | |
password2 |
TokenStatus
The status of the token example enabled or disabled.
Value | Description |
---|---|
enabled | |
disabled |