Skip to main content

services

Creates, updates, deletes, gets or lists a services resource.

Overview

Nameservices
TypeResource
Idazure.api_management.services

Fields

The following fields are returned by SELECT queries:

Successfully got the API Management Service Resource.

NameDatatypeDescription
idstringResource ID.
namestringResource name.
etagstringETag of the resource.
identityobjectManaged service identity of the Api Management service.
locationstringResource location.
propertiesobjectProperties of the API Management service.
skuobjectSKU properties of the API Management service.
systemDataobjectMetadata pertaining to creation and last modification of the resource.
tagsobjectResource tags.
typestringResource type for API Management resource is set to Microsoft.ApiManagement.
zonesarrayA list of availability zones denoting where the resource needs to come from.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, serviceName, subscriptionIdGets an API Management service resource description.
list_by_resource_groupselectresourceGroupName, subscriptionIdList all API Management services within a resource group.
listselectsubscriptionIdLists all API Management services within an Azure subscription.
create_or_updateinsertresourceGroupName, serviceName, subscriptionId, data__location, data__sku, data__propertiesCreates or updates an API Management service. This is long running operation and could take several minutes to complete.
updateupdateresourceGroupName, serviceName, subscriptionIdUpdates an existing API Management service.
deletedeleteresourceGroupName, serviceName, subscriptionIdDeletes an existing API Management service.
restoreexecresourceGroupName, serviceName, subscriptionId, storageAccount, containerName, backupNameRestores a backup of an API Management service created using the ApiManagementService_Backup operation on the current service. This is a long running operation and could take several minutes to complete.
backupexecresourceGroupName, serviceName, subscriptionId, storageAccount, containerName, backupNameCreates a backup of the API Management service to the given Azure Storage Account. This is long running operation and could take several minutes to complete.
migrate_to_stv2execresourceGroupName, serviceName, subscriptionIdUpgrades an API Management service to the Stv2 platform. For details refer to https://aka.ms/apim-migrate-stv2. This change is not reversible. This is long running operation and could take several minutes to complete.
check_name_availabilityexecsubscriptionId, nameChecks availability and correctness of a name for an API Management service.
apply_network_configuration_updatesexecresourceGroupName, serviceName, subscriptionIdUpdates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated DNS changes.

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
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
serviceNamestringThe name of the API Management service.
subscriptionIdstringThe ID of the target subscription.

SELECT examples

Gets an API Management service resource description.

SELECT
id,
name,
etag,
identity,
location,
properties,
sku,
systemData,
tags,
type,
zones
FROM azure.api_management.services
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND serviceName = '{{ serviceName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;

INSERT examples

Creates or updates an API Management service. This is long running operation and could take several minutes to complete.

INSERT INTO azure.api_management.services (
data__properties,
data__sku,
data__identity,
data__location,
data__zones,
data__tags,
resourceGroupName,
serviceName,
subscriptionId
)
SELECT
'{{ properties }}' /* required */,
'{{ sku }}' /* required */,
'{{ identity }}',
'{{ location }}' /* required */,
'{{ zones }}',
'{{ tags }}',
'{{ resourceGroupName }}',
'{{ serviceName }}',
'{{ subscriptionId }}'
RETURNING
id,
name,
etag,
identity,
location,
properties,
sku,
systemData,
tags,
type,
zones
;

UPDATE examples

Updates an existing API Management service.

UPDATE azure.api_management.services
SET
data__properties = '{{ properties }}',
data__sku = '{{ sku }}',
data__identity = '{{ identity }}',
data__zones = '{{ zones }}',
data__tags = '{{ tags }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND serviceName = '{{ serviceName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
RETURNING
id,
name,
etag,
identity,
location,
properties,
sku,
systemData,
tags,
type,
zones;

DELETE examples

Deletes an existing API Management service.

DELETE FROM azure.api_management.services
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND serviceName = '{{ serviceName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;

Lifecycle Methods

Restores a backup of an API Management service created using the ApiManagementService_Backup operation on the current service. This is a long running operation and could take several minutes to complete.

EXEC azure.api_management.services.restore 
@resourceGroupName='{{ resourceGroupName }}' --required,
@serviceName='{{ serviceName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"storageAccount": "{{ storageAccount }}",
"containerName": "{{ containerName }}",
"backupName": "{{ backupName }}",
"accessType": "{{ accessType }}",
"accessKey": "{{ accessKey }}",
"clientId": "{{ clientId }}"
}'
;