Skip to main content

resource_sync_rules

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

Overview

Nameresource_sync_rules
TypeResource
Idazure.custom_locations.resource_sync_rules

Fields

NameDatatypeDescription
childResourceNametextfield from the properties object
locationtextThe geo-location where the resource lives
prioritytextfield from the properties object
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
resourceNametextfield from the properties object
selectortextfield from the properties object
subscriptionIdtextfield from the properties object
system_datatextfield from the properties object
tagstextResource tags.
target_resource_grouptextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTchildResourceName, resourceGroupName, resourceName, subscriptionIdGets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location resource name and Resource Sync Rule name.
list_by_custom_location_idSELECTresourceGroupName, resourceName, subscriptionIdGets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each Resource Sync Rule
create_or_updateINSERTchildResourceName, resourceGroupName, resourceName, subscriptionIdCreates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group
deleteDELETEchildResourceName, resourceGroupName, resourceName, subscriptionIdDeletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, Resource Group, and Subscription Id.
updateUPDATEchildResourceName, resourceGroupName, resourceName, subscriptionIdUpdates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, Subscription and Custom Location name.

SELECT examples

Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each Resource Sync Rule

SELECT
childResourceName,
location,
priority,
provisioning_state,
resourceGroupName,
resourceName,
selector,
subscriptionId,
system_data,
tags,
target_resource_group
FROM azure.custom_locations.vw_resource_sync_rules
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND resourceName = '{{ resourceName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new resource_sync_rules resource.

/*+ create */
INSERT INTO azure.custom_locations.resource_sync_rules (
childResourceName,
resourceGroupName,
resourceName,
subscriptionId,
properties,
tags,
location
)
SELECT
'{{ childResourceName }}',
'{{ resourceGroupName }}',
'{{ resourceName }}',
'{{ subscriptionId }}',
'{{ properties }}',
'{{ tags }}',
'{{ location }}'
;

UPDATE example

Updates a resource_sync_rules resource.

/*+ update */
UPDATE azure.custom_locations.resource_sync_rules
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
childResourceName = '{{ childResourceName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND resourceName = '{{ resourceName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified resource_sync_rules resource.

/*+ delete */
DELETE FROM azure.custom_locations.resource_sync_rules
WHERE childResourceName = '{{ childResourceName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND resourceName = '{{ resourceName }}'
AND subscriptionId = '{{ subscriptionId }}';