Skip to main content

object_replication_policies

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

Overview

Nameobject_replication_policies
TypeResource
Idazure.storage.object_replication_policies

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 resource.
destinationAccountstringRequired. Destination account name. It should be full resource id if allowCrossTenantReplication set to false. Required.
enabledTimestring (date-time)Indicates when the policy is enabled on the source account.
metricsobjectOptional. The object replication policy metrics feature options.
policyIdstringA unique id for object replication policy.
priorityReplicationobjectOptional. The object replication policy priority replication feature options.
rulesarrayThe storage account object replication rules.
sourceAccountstringRequired. Source account name. It should be full resource id if allowCrossTenantReplication set to false. Required.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsReplicationobjectOptional. The object replication policy tags replication feature options.
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, account_name, object_replication_policy_id, subscription_idGet the object replication policy of the storage account by policy ID.
listselectresource_group_name, account_name, subscription_idList the object replication policies associated with the storage account.
create_or_updateinsertresource_group_name, account_name, object_replication_policy_id, subscription_idCreate or update the object replication policy of the storage account.
create_or_updatereplaceresource_group_name, account_name, object_replication_policy_id, subscription_idCreate or update the object replication policy of the storage account.
deletedeleteresource_group_name, account_name, object_replication_policy_id, subscription_idDeletes the object replication policy associated with the specified storage account.

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
account_namestringThe name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. Required.
object_replication_policy_idstringFor the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

Get the object replication policy of the storage account by policy ID.

SELECT
id,
name,
destinationAccount,
enabledTime,
metrics,
policyId,
priorityReplication,
rules,
sourceAccount,
systemData,
tagsReplication,
type
FROM azure.storage.object_replication_policies
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND account_name = '{{ account_name }}' -- required
AND object_replication_policy_id = '{{ object_replication_policy_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create or update the object replication policy of the storage account.

INSERT INTO azure.storage.object_replication_policies (
properties,
resource_group_name,
account_name,
object_replication_policy_id,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ account_name }}',
'{{ object_replication_policy_id }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;

REPLACE examples

Create or update the object replication policy of the storage account.

REPLACE azure.storage.object_replication_policies
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND account_name = '{{ account_name }}' --required
AND object_replication_policy_id = '{{ object_replication_policy_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Deletes the object replication policy associated with the specified storage account.

DELETE FROM azure.storage.object_replication_policies
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND account_name = '{{ account_name }}' --required
AND object_replication_policy_id = '{{ object_replication_policy_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;