Skip to main content

authentication

Creates, updates, deletes, gets or lists an authentication resource.

Overview

Nameauthentication
TypeResource
Idazure.container_registry_dataplane.authentication

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
access_tokenstringThe access token for performing authenticated requests.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_acr_access_token_from_loginselectservice, scope, endpointExchange Username, Password and Scope for an ACR Access Token.
exchange_aad_access_token_for_acr_refresh_tokenexecendpoint, grantType, serviceExchange AAD tokens for an ACR refresh Token.
exchange_acr_refresh_token_for_acr_access_tokenexecendpoint, grantType, serviceExchange ACR Refresh token for an ACR Access Token.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
endpointstringThe service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client endpoint parameter. (default: )
scopestringExpected to be a valid scope, and can be specified more than once for multiple scope requests. You can obtain this from the Www-Authenticate response header from the challenge. Required.
servicestringIndicates the name of your Azure container registry. Required.

SELECT examples

Exchange Username, Password and Scope for an ACR Access Token.

SELECT
access_token
FROM azure.container_registry_dataplane.authentication
WHERE service = '{{ service }}' -- required
AND scope = '{{ scope }}' -- required
AND endpoint = '{{ endpoint }}' -- required
;

Lifecycle Methods

Exchange AAD tokens for an ACR refresh Token.

EXEC azure.container_registry_dataplane.authentication.exchange_aad_access_token_for_acr_refresh_token 
@endpoint='{{ endpoint }}' --required
@@json=
'{
"grantType": "{{ grantType }}",
"service": "{{ service }}",
"tenant": "{{ tenant }}",
"refreshToken": "{{ refreshToken }}",
"accessToken": "{{ accessToken }}"
}'
;