Skip to main content

authorizations

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

Overview

Nameauthorizations
TypeResource
Idazure.api_management.authorizations

Fields

The following fields are returned by SELECT queries:

The response body contains the specified authorization entity. No secrets included

NameDatatypeDescription
propertiesobjectProperties of the Authorization Contract.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, serviceName, authorizationProviderId, authorizationId, subscriptionIdGets the details of the authorization specified by its identifier.
list_by_authorization_providerselectresourceGroupName, serviceName, authorizationProviderId, subscriptionId$filter, $top, $skipLists a collection of authorization providers defined within a authorization provider.
create_or_updateinsertresourceGroupName, serviceName, authorizationProviderId, authorizationId, subscriptionIdIf-MatchCreates or updates authorization.
deletedeleteresourceGroupName, serviceName, authorizationProviderId, authorizationId, If-Match, subscriptionIdDeletes specific Authorization from the Authorization provider.
confirm_consent_codeexecresourceGroupName, serviceName, authorizationProviderId, authorizationId, subscriptionIdConfirm valid consent code to suppress Authorizations anti-phishing page.

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
If-MatchstringETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
authorizationIdstringIdentifier of the authorization.
authorizationProviderIdstringIdentifier of the authorization provider.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
serviceNamestringThe name of the API Management service.
subscriptionIdstringThe ID of the target subscription.
$filterstring| Field | Usage | Supported operators | Supported functions |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |</br>
$skipinteger (int32)Number of records to skip.
$topinteger (int32)Number of records to return.
If-MatchstringETag of the Entity. Not required when creating an entity, but required when updating an entity.

SELECT examples

Gets the details of the authorization specified by its identifier.

SELECT
properties
FROM azure.api_management.authorizations
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND serviceName = '{{ serviceName }}' -- required
AND authorizationProviderId = '{{ authorizationProviderId }}' -- required
AND authorizationId = '{{ authorizationId }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;

INSERT examples

Creates or updates authorization.

INSERT INTO azure.api_management.authorizations (
data__properties,
resourceGroupName,
serviceName,
authorizationProviderId,
authorizationId,
subscriptionId,
If-Match
)
SELECT
'{{ properties }}',
'{{ resourceGroupName }}',
'{{ serviceName }}',
'{{ authorizationProviderId }}',
'{{ authorizationId }}',
'{{ subscriptionId }}',
'{{ If-Match }}'
RETURNING
properties
;

DELETE examples

Deletes specific Authorization from the Authorization provider.

DELETE FROM azure.api_management.authorizations
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND serviceName = '{{ serviceName }}' --required
AND authorizationProviderId = '{{ authorizationProviderId }}' --required
AND authorizationId = '{{ authorizationId }}' --required
AND If-Match = '{{ If-Match }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;

Lifecycle Methods

Confirm valid consent code to suppress Authorizations anti-phishing page.

EXEC azure.api_management.authorizations.confirm_consent_code 
@resourceGroupName='{{ resourceGroupName }}' --required,
@serviceName='{{ serviceName }}' --required,
@authorizationProviderId='{{ authorizationProviderId }}' --required,
@authorizationId='{{ authorizationId }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"consentCode": "{{ consentCode }}"
}'
;