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:

OK -- Get the object replication policy successfully.

NameDatatypeDescription
idstring (arm-id)Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
namestringThe name of the resource
propertiesobjectReturns the Storage Account Object Replication Policy.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
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
getselectresourceGroupName, accountName, subscriptionId, objectReplicationPolicyIdGet the object replication policy of the storage account by policy ID.
listselectresourceGroupName, accountName, subscriptionIdList the object replication policies associated with the storage account.
create_or_updateinsertresourceGroupName, accountName, subscriptionId, objectReplicationPolicyIdCreate or update the object replication policy of the storage account.
deletedeleteresourceGroupName, accountName, subscriptionId, objectReplicationPolicyIdDeletes 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
accountNamestringThe 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.
objectReplicationPolicyIdstringFor 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.
resourceGroupNamestringThe name of the resource group within the user's subscription. The name is case insensitive.
subscriptionIdstring (uuid)The ID of the target subscription. The value must be an UUID.

SELECT examples

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

SELECT
id,
name,
properties,
systemData,
type
FROM azure.storage.object_replication_policies
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND accountName = '{{ accountName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND objectReplicationPolicyId = '{{ objectReplicationPolicyId }}' -- required
;

INSERT examples

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

INSERT INTO azure.storage.object_replication_policies (
data__properties,
resourceGroupName,
accountName,
subscriptionId,
objectReplicationPolicyId
)
SELECT
'{{ properties }}',
'{{ resourceGroupName }}',
'{{ accountName }}',
'{{ subscriptionId }}',
'{{ objectReplicationPolicyId }}'
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 resourceGroupName = '{{ resourceGroupName }}' --required
AND accountName = '{{ accountName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND objectReplicationPolicyId = '{{ objectReplicationPolicyId }}' --required
;