Skip to main content

data_shares

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

Overview

Namedata_shares
TypeResource
Idazure.storage.data_shares

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.
accessPoliciesarrayList of access policies that specify the permission allowed to a managed identity. For Create - This property is required and cannot be null. If no access policies are provided at creation time, specify an empty array. For Update - This property is optional. If set to null or not passed, the existing access policies are left unchanged. If provided with a non-null value, the existing access policies are replaced with the specified list. Required.
assetsarrayList of assets that specify the properties of the shared resources. For Create - This property is required and cannot be null. If no assets are provided at creation time, specify an empty array. For Update - This property is optional. If set to null or not passed, the existing assets are left unchanged. If provided with a non-null value, the existing assets are replaced with the specified list. Required.
dataShareIdentifierstringSystem-generated GUID identifier for the Storage DataShare. Not a valid input parameter when creating.
dataShareUristringThe DataShare URI to be shared with the consumer. URI Format - 'azds://::'.
descriptionstringArbitrary description of this Data Share. Max 250 characters.
locationstringThe geo-location where the resource lives. Required.
provisioningStatestringRepresents the provisioning state of the storage datashare. Known values are: "Accepted", "Creating", "Succeeded", "Deleting", "Canceled", and "Failed". (Accepted, Creating, Succeeded, Deleting, Canceled, Failed)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
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, data_share_name, subscription_idGet the specified Storage DataShare.
list_by_storage_accountselectresource_group_name, account_name, subscription_idList all Storage DataShares in a Storage Account.
createinsertresource_group_name, account_name, data_share_name, subscription_id, location, propertiesCreate a Storage DataShare if it does not already exist; otherwise, error out. This API will not allow you to replace an already existing resource.
updateupdateresource_group_name, account_name, data_share_name, subscription_idUpdate a Storage DataShare.
deletedeleteresource_group_name, account_name, data_share_name, subscription_idDelete a Storage DataShare.

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.
data_share_namestringThe name of the Storage DataShare. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring

SELECT examples

Get the specified Storage DataShare.

SELECT
id,
name,
accessPolicies,
assets,
dataShareIdentifier,
dataShareUri,
description,
location,
provisioningState,
systemData,
tags,
type
FROM azure.storage.data_shares
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND account_name = '{{ account_name }}' -- required
AND data_share_name = '{{ data_share_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create a Storage DataShare if it does not already exist; otherwise, error out. This API will not allow you to replace an already existing resource.

INSERT INTO azure.storage.data_shares (
tags,
location,
properties,
resource_group_name,
account_name,
data_share_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}' /* required */,
'{{ resource_group_name }}',
'{{ account_name }}',
'{{ data_share_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type
;

UPDATE examples

Update a Storage DataShare.

UPDATE azure.storage.data_shares
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND account_name = '{{ account_name }}' --required
AND data_share_name = '{{ data_share_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;

DELETE examples

Delete a Storage DataShare.

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