data_shares
Creates, updates, deletes, gets or lists a data_shares resource.
Overview
| Name | data_shares |
| Type | Resource |
| Id | azure.storage.data_shares |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_storage_account
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
accessPolicies | array | List 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. |
assets | array | List 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. |
dataShareIdentifier | string | System-generated GUID identifier for the Storage DataShare. Not a valid input parameter when creating. |
dataShareUri | string | The DataShare URI to be shared with the consumer. URI Format - 'azds://::'. |
description | string | Arbitrary description of this Data Share. Max 250 characters. |
location | string | The geo-location where the resource lives. Required. |
provisioningState | string | Represents the provisioning state of the storage datashare. Known values are: "Accepted", "Creating", "Succeeded", "Deleting", "Canceled", and "Failed". (Accepted, Creating, Succeeded, Deleting, Canceled, Failed) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
accessPolicies | array | List 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. |
assets | array | List 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. |
dataShareIdentifier | string | System-generated GUID identifier for the Storage DataShare. Not a valid input parameter when creating. |
dataShareUri | string | The DataShare URI to be shared with the consumer. URI Format - 'azds://::'. |
description | string | Arbitrary description of this Data Share. Max 250 characters. |
location | string | The geo-location where the resource lives. Required. |
provisioningState | string | Represents the provisioning state of the storage datashare. Known values are: "Accepted", "Creating", "Succeeded", "Deleting", "Canceled", and "Failed". (Accepted, Creating, Succeeded, Deleting, Canceled, Failed) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, account_name, data_share_name, subscription_id | Get the specified Storage DataShare. | |
list_by_storage_account | select | resource_group_name, account_name, subscription_id | List all Storage DataShares in a Storage Account. | |
create | insert | resource_group_name, account_name, data_share_name, subscription_id, location, properties | 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. | |
update | update | resource_group_name, account_name, data_share_name, subscription_id | Update a Storage DataShare. | |
delete | delete | resource_group_name, account_name, data_share_name, subscription_id | Delete 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.
| Name | Datatype | Description |
|---|---|---|
account_name | string | The 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_name | string | The name of the Storage DataShare. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string |
SELECT examples
- get
- list_by_storage_account
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
;
List all Storage DataShares in a Storage Account.
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 subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: data_shares
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the data_shares resource.
- name: account_name
value: "{{ account_name }}"
description: Required parameter for the data_shares resource.
- name: data_share_name
value: "{{ data_share_name }}"
description: Required parameter for the data_shares resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the data_shares resource.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives. Required.
- name: properties
description: |
The properties of the Storage DataShare. Required.
value:
dataShareIdentifier: "{{ dataShareIdentifier }}"
description: "{{ description }}"
dataShareUri: "{{ dataShareUri }}"
accessPolicies:
- principalId: "{{ principalId }}"
tenantId: "{{ tenantId }}"
permission: "{{ permission }}"
assets:
- assetPath: "{{ assetPath }}"
displayName: "{{ displayName }}"
provisioningState: "{{ provisioningState }}"
UPDATE examples
- update
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
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
;