accounts
Creates, updates, deletes, gets or lists an accounts
resource.
Overview
Name | accounts |
Type | Resource |
Id | azure.storage.accounts |
Fields
The following fields are returned by SELECT
queries:
- list_by_resource_group
- list
OK -- List of storage accounts in the given resource group retrieved and returned successfully.
Name | Datatype | Description |
---|---|---|
extendedLocation | object | The extendedLocation of the resource. |
identity | object | The identity of the resource. |
kind | string | Gets the Kind. |
location | string | The geo-location where the resource lives |
properties | object | Properties of the storage account. |
sku | object | Gets the SKU. |
tags | object | Resource tags. |
OK -- List of storage accounts was retrieved and returned successfully.
Name | Datatype | Description |
---|---|---|
extendedLocation | object | The extendedLocation of the resource. |
identity | object | The identity of the resource. |
kind | string | Gets the Kind. |
location | string | The geo-location where the resource lives |
properties | object | Properties of the storage account. |
sku | object | Gets the SKU. |
tags | object | Resource tags. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list_by_resource_group | select | resourceGroupName , subscriptionId | Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. | |
list | select | subscriptionId | Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. | |
create | insert | resourceGroupName , accountName , subscriptionId , data__sku , data__kind , data__location | Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. | |
update | update | resourceGroupName , accountName , subscriptionId | The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation. | |
delete | delete | resourceGroupName , accountName , subscriptionId | Deletes a storage account in Microsoft Azure. | |
check_name_availability | exec | subscriptionId , name , type | Checks that the storage account name is valid and is not already in use. | |
regenerate_key | exec | resourceGroupName , accountName , subscriptionId , keyName | Regenerates one of the access keys or Kerberos keys for the specified storage account. | |
failover | exec | resourceGroupName , accountName , subscriptionId | failoverType | A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is only available while the primary and secondary endpoints are available. The primary use case of a Planned Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter to 'Planned'. Learn more about the failover options here- https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance |
hierarchical_namespace_migration | exec | resourceGroupName , accountName , subscriptionId , requestType | Live Migration of storage account to enable Hns | |
abort_hierarchical_namespace_migration | exec | resourceGroupName , accountName , subscriptionId | Abort live Migration of storage account to enable Hns | |
customer_initiated_migration | exec | resourceGroupName , accountName , subscriptionId , properties | Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region. | |
restore_blob_ranges | exec | resourceGroupName , accountName , subscriptionId , timeToRestore , blobRanges | Restore blobs in the specified blob ranges | |
revoke_user_delegation_keys | exec | resourceGroupName , accountName , subscriptionId | Revoke user delegation keys. |
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 |
---|---|---|
accountName | 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. |
requestType | string | Required. Hierarchical namespace migration type can either be a hierarchical namespace validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation request will validate the migration whereas the hydration request will migrate the account. |
resourceGroupName | string | The name of the resource group within the user's subscription. The name is case insensitive. |
subscriptionId | string (uuid) | The ID of the target subscription. The value must be an UUID. |
failoverType | string | The parameter is set to 'Planned' to indicate whether a Planned failover is requested. |
SELECT
examples
- list_by_resource_group
- list
Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this.
SELECT
extendedLocation,
identity,
kind,
location,
properties,
sku,
tags
FROM azure.storage.accounts
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;
Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this.
SELECT
extendedLocation,
identity,
kind,
location,
properties,
sku,
tags
FROM azure.storage.accounts
WHERE subscriptionId = '{{ subscriptionId }}' -- required
;
INSERT
examples
- create
- Manifest
Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed.
INSERT INTO azure.storage.accounts (
data__sku,
data__kind,
data__location,
data__extendedLocation,
data__tags,
data__identity,
data__properties,
resourceGroupName,
accountName,
subscriptionId
)
SELECT
'{{ sku }}' /* required */,
'{{ kind }}' /* required */,
'{{ location }}' /* required */,
'{{ extendedLocation }}',
'{{ tags }}',
'{{ identity }}',
'{{ properties }}',
'{{ resourceGroupName }}',
'{{ accountName }}',
'{{ subscriptionId }}'
RETURNING
extendedLocation,
identity,
kind,
location,
properties,
sku,
tags
;
# Description fields are for documentation purposes
- name: accounts
props:
- name: resourceGroupName
value: string
description: Required parameter for the accounts resource.
- name: accountName
value: string
description: Required parameter for the accounts resource.
- name: subscriptionId
value: string (uuid)
description: Required parameter for the accounts resource.
- name: sku
value: object
description: |
Required. Gets or sets the SKU name.
- name: kind
value: string
description: |
Required. Indicates the type of storage account.
valid_values: ['Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage']
- name: location
value: string
description: |
Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed.
- name: extendedLocation
value: object
description: |
Optional. Set the extended location of the resource. If not set, the storage account will be created in Azure main region. Otherwise it will be created in the specified extended location
- name: tags
value: object
description: |
Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters.
- name: identity
value: object
description: |
The identity of the resource.
- name: properties
value: object
description: |
The parameters used to create the storage account.
UPDATE
examples
- update
The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation.
UPDATE azure.storage.accounts
SET
data__sku = '{{ sku }}',
data__tags = '{{ tags }}',
data__identity = '{{ identity }}',
data__properties = '{{ properties }}',
data__kind = '{{ kind }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND accountName = '{{ accountName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
RETURNING
extendedLocation,
identity,
kind,
location,
properties,
sku,
tags;
DELETE
examples
- delete
Deletes a storage account in Microsoft Azure.
DELETE FROM azure.storage.accounts
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND accountName = '{{ accountName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;
Lifecycle Methods
- check_name_availability
- regenerate_key
- failover
- hierarchical_namespace_migration
- abort_hierarchical_namespace_migration
- customer_initiated_migration
- restore_blob_ranges
- revoke_user_delegation_keys
Checks that the storage account name is valid and is not already in use.
EXEC azure.storage.accounts.check_name_availability
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"name": "{{ name }}",
"type": "{{ type }}"
}'
;
Regenerates one of the access keys or Kerberos keys for the specified storage account.
EXEC azure.storage.accounts.regenerate_key
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"keyName": "{{ keyName }}"
}'
;
A failover request can be triggered for a storage account in the event a primary endpoint becomes unavailable for any reason. The failover occurs from the storage account's primary cluster to the secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover and the account is converted to LRS. In the case of a Planned Failover, the primary and secondary clusters are swapped after failover and the account remains geo-replicated. Failover should continue to be used in the event of availability issues as Planned failover is only available while the primary and secondary endpoints are available. The primary use case of a Planned Failover is disaster recovery testing drills. This type of failover is invoked by setting FailoverType parameter to 'Planned'. Learn more about the failover options here- https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance
EXEC azure.storage.accounts.failover
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@failoverType='{{ failoverType }}'
;
Live Migration of storage account to enable Hns
EXEC azure.storage.accounts.hierarchical_namespace_migration
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required,
@requestType='{{ requestType }}' --required
;
Abort live Migration of storage account to enable Hns
EXEC azure.storage.accounts.abort_hierarchical_namespace_migration
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;
Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region.
EXEC azure.storage.accounts.customer_initiated_migration
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"name": "{{ name }}",
"type": "{{ type }}",
"properties": "{{ properties }}"
}'
;
Restore blobs in the specified blob ranges
EXEC azure.storage.accounts.restore_blob_ranges
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"timeToRestore": "{{ timeToRestore }}",
"blobRanges": "{{ blobRanges }}"
}'
;
Revoke user delegation keys.
EXEC azure.storage.accounts.revoke_user_delegation_keys
@resourceGroupName='{{ resourceGroupName }}' --required,
@accountName='{{ accountName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;