Skip to main content

cache_rules

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

Overview

Namecache_rules
TypeResource
Idazure.container_registry.cache_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the private link resource.
creationDatestring (date-time)The creation date of the cache rule.
credentialSetResourceIdstringThe ARM resource ID of the credential store which is associated with the cache rule.
identityobjectThe identity of the cache rule.
provisioningStatestringProvisioning state of the resource. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". (Creating, Updating, Deleting, Succeeded, Failed, Canceled)
sourceRepositorystringSource repository pulled from upstream.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
targetRepositorystringTarget repository specified in docker pull command. Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag}.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, registry_name, cache_rule_name, subscription_idGets the properties of the specified cache rule resource.
listselectresource_group_name, registry_name, subscription_idLists all cache rule resources for the specified container registry.
createinsertresource_group_name, registry_name, cache_rule_name, subscription_idCreates a cache rule for a container registry with the specified parameters.
updateupdateresource_group_name, registry_name, cache_rule_name, subscription_idUpdates a cache rule for a container registry with the specified parameters.
deletedeleteresource_group_name, registry_name, cache_rule_name, subscription_idDeletes a cache rule resource from a container registry.

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
cache_rule_namestringThe name of the cache rule. Required.
registry_namestringThe name of the container registry. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

Gets the properties of the specified cache rule resource.

SELECT
id,
name,
creationDate,
credentialSetResourceId,
identity,
provisioningState,
sourceRepository,
systemData,
targetRepository,
type
FROM azure.container_registry.cache_rules
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND registry_name = '{{ registry_name }}' -- required
AND cache_rule_name = '{{ cache_rule_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates a cache rule for a container registry with the specified parameters.

INSERT INTO azure.container_registry.cache_rules (
properties,
identity,
resource_group_name,
registry_name,
cache_rule_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ identity }}',
'{{ resource_group_name }}',
'{{ registry_name }}',
'{{ cache_rule_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
identity,
properties,
systemData,
type
;

UPDATE examples

Updates a cache rule for a container registry with the specified parameters.

UPDATE azure.container_registry.cache_rules
SET
properties = '{{ properties }}',
identity = '{{ identity }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND registry_name = '{{ registry_name }}' --required
AND cache_rule_name = '{{ cache_rule_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
identity,
properties,
systemData,
type;

DELETE examples

Deletes a cache rule resource from a container registry.

DELETE FROM azure.container_registry.cache_rules
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND registry_name = '{{ registry_name }}' --required
AND cache_rule_name = '{{ cache_rule_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;