StorageAccountsOperations Class
Warning
DO NOT instantiate this class directly.
Instead, you should access the following operations through
<xref:storage_accounts> attribute.
- Inheritance
-
builtins.objectStorageAccountsOperations
Constructor
StorageAccountsOperations(*args, **kwargs)
Methods
begin_abort_hierarchical_namespace_migration |
Abort live Migration of storage account to enable Hns. |
begin_create |
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. |
begin_customer_initiated_migration |
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. |
begin_failover |
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. |
begin_hierarchical_namespace_migration |
Live Migration of storage account to enable Hns. |
begin_restore_blob_ranges |
Restore blobs in the specified blob ranges. |
check_name_availability |
Checks that the storage account name is valid and is not already in use. |
delete |
Deletes a storage account in Microsoft Azure. |
get_customer_initiated_migration |
Gets the status of the ongoing migration for the specified storage account. |
get_properties |
Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. |
list |
Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. |
list_account_sas |
List SAS credentials of a storage account. |
list_by_resource_group |
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_keys |
Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. |
list_service_sas |
List service SAS credentials of a specific resource. |
regenerate_key |
Regenerates one of the access keys or Kerberos keys for the specified storage account. |
revoke_user_delegation_keys |
Revoke user delegation keys. |
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. |
begin_abort_hierarchical_namespace_migration
Abort live Migration of storage account to enable Hns.
begin_abort_hierarchical_namespace_migration(resource_group_name: str, account_name: str, **kwargs: Any) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group within the user's subscription. The name is case insensitive. Required. |
account_name
Required
|
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. |
Returns
Type | Description |
---|---|
An instance of LROPoller that returns either None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_create
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.
begin_create(resource_group_name: str, account_name: str, parameters: _models.StorageAccountCreateParameters, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[_models.StorageAccount]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group within the user's subscription. The name is case insensitive. Required. |
account_name
Required
|
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. |
parameters
Required
|
The parameters to provide for the created account. Is either a StorageAccountCreateParameters type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
An instance of LROPoller that returns either StorageAccount or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_customer_initiated_migration
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.
begin_customer_initiated_migration(resource_group_name: str, account_name: str, parameters: _models.StorageAccountMigration, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group within the user's subscription. The name is case insensitive. Required. |
account_name
Required
|
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. |
parameters
Required
|
The request parameters required to perform storage account migration. Is either a StorageAccountMigration type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
An instance of LROPoller that returns either None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_failover
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.
begin_failover(resource_group_name: str, account_name: str, failover_type: Literal['Planned'] = 'Planned', **kwargs: Any) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group within the user's subscription. The name is case insensitive. Required. |
account_name
Required
|
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. |
failover_type
Required
|
The parameter is set to 'Planned' to indicate whether a Planned failover is requested. Known values are "Planned" and None. Default value is "Planned". |
Returns
Type | Description |
---|---|
An instance of LROPoller that returns either None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_hierarchical_namespace_migration
Live Migration of storage account to enable Hns.
begin_hierarchical_namespace_migration(resource_group_name: str, account_name: str, request_type: str, **kwargs: Any) -> LROPoller[None]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group within the user's subscription. The name is case insensitive. Required. |
account_name
Required
|
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. |
request_type
Required
|
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. Required. |
Returns
Type | Description |
---|---|
An instance of LROPoller that returns either None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_restore_blob_ranges
Restore blobs in the specified blob ranges.
begin_restore_blob_ranges(resource_group_name: str, account_name: str, parameters: _models.BlobRestoreParameters, *, content_type: str = 'application/json', **kwargs: Any) -> LROPoller[_models.BlobRestoreStatus]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group within the user's subscription. The name is case insensitive. Required. |
account_name
Required
|
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. |
parameters
Required
|
The parameters to provide for restore blob ranges. Is either a BlobRestoreParameters type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
An instance of LROPoller that returns either BlobRestoreStatus or the result of cls(response) |
Exceptions
Type | Description |
---|---|
check_name_availability
Checks that the storage account name is valid and is not already in use.
check_name_availability(account_name: _models.StorageAccountCheckNameAvailabilityParameters, *, content_type: str = 'application/json', **kwargs: Any) -> _models.CheckNameAvailabilityResult
Parameters
Name | Description |
---|---|
account_name
Required
|
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. Is either a StorageAccountCheckNameAvailabilityParameters type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
CheckNameAvailabilityResult or the result of cls(response) |
Exceptions
Type | Description |
---|---|
delete
Deletes a storage account in Microsoft Azure.
delete(resource_group_name: str, account_name: str, **kwargs: Any) -> None
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group within the user's subscription. The name is case insensitive. Required. |
account_name
Required
|
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. |
Returns
Type | Description |
---|---|
None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
get_customer_initiated_migration
Gets the status of the ongoing migration for the specified storage account.
get_customer_initiated_migration(resource_group_name: str, account_name: str, migration_name: str | MigrationName, **kwargs: Any) -> StorageAccountMigration
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group within the user's subscription. The name is case insensitive. Required. |
account_name
Required
|
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. |
migration_name
Required
|
str or
MigrationName
The name of the Storage Account Migration. It should always be 'default'. "default" Required. |
Returns
Type | Description |
---|---|
StorageAccountMigration or the result of cls(response) |
Exceptions
Type | Description |
---|---|
get_properties
Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys.
get_properties(resource_group_name: str, account_name: str, expand: str | StorageAccountExpand | None = None, **kwargs: Any) -> StorageAccount
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group within the user's subscription. The name is case insensitive. Required. |
account_name
Required
|
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. |
expand
Required
|
May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. Known values are: "geoReplicationStats" and "blobRestoreStatus". Default value is None. |
Returns
Type | Description |
---|---|
StorageAccount or the result of cls(response) |
Exceptions
Type | Description |
---|---|
list
Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this.
list(**kwargs: Any) -> Iterable[StorageAccount]
Returns
Type | Description |
---|---|
An iterator like instance of either StorageAccount or the result of cls(response) |
Exceptions
Type | Description |
---|---|
list_account_sas
List SAS credentials of a storage account.
list_account_sas(resource_group_name: str, account_name: str, parameters: _models.AccountSasParameters, *, content_type: str = 'application/json', **kwargs: Any) -> _models.ListAccountSasResponse
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group within the user's subscription. The name is case insensitive. Required. |
account_name
Required
|
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. |
parameters
Required
|
The parameters to provide to list SAS credentials for the storage account. Is either a AccountSasParameters type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
ListAccountSasResponse or the result of cls(response) |
Exceptions
Type | Description |
---|---|
list_by_resource_group
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_by_resource_group(resource_group_name: str, **kwargs: Any) -> Iterable[StorageAccount]
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group within the user's subscription. The name is case insensitive. Required. |
Returns
Type | Description |
---|---|
An iterator like instance of either StorageAccount or the result of cls(response) |
Exceptions
Type | Description |
---|---|
list_keys
Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account.
list_keys(resource_group_name: str, account_name: str, expand: Literal['kerb'] = 'kerb', **kwargs: Any) -> StorageAccountListKeysResult
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group within the user's subscription. The name is case insensitive. Required. |
account_name
Required
|
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. |
expand
Required
|
Specifies type of the key to be listed. Possible value is kerb. Known values are "kerb" and None. Default value is "kerb". |
Returns
Type | Description |
---|---|
StorageAccountListKeysResult or the result of cls(response) |
Exceptions
Type | Description |
---|---|
list_service_sas
List service SAS credentials of a specific resource.
list_service_sas(resource_group_name: str, account_name: str, parameters: _models.ServiceSasParameters, *, content_type: str = 'application/json', **kwargs: Any) -> _models.ListServiceSasResponse
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group within the user's subscription. The name is case insensitive. Required. |
account_name
Required
|
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. |
parameters
Required
|
The parameters to provide to list service SAS credentials. Is either a ServiceSasParameters type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
ListServiceSasResponse or the result of cls(response) |
Exceptions
Type | Description |
---|---|
regenerate_key
Regenerates one of the access keys or Kerberos keys for the specified storage account.
regenerate_key(resource_group_name: str, account_name: str, regenerate_key: _models.StorageAccountRegenerateKeyParameters, *, content_type: str = 'application/json', **kwargs: Any) -> _models.StorageAccountListKeysResult
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group within the user's subscription. The name is case insensitive. Required. |
account_name
Required
|
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. |
regenerate_key
Required
|
Specifies name of the key which should be regenerated – key1, key2, kerb1, kerb2. Is either a StorageAccountRegenerateKeyParameters type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
StorageAccountListKeysResult or the result of cls(response) |
Exceptions
Type | Description |
---|---|
revoke_user_delegation_keys
Revoke user delegation keys.
revoke_user_delegation_keys(resource_group_name: str, account_name: str, **kwargs: Any) -> None
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group within the user's subscription. The name is case insensitive. Required. |
account_name
Required
|
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. |
Returns
Type | Description |
---|---|
None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
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(resource_group_name: str, account_name: str, parameters: _models.StorageAccountUpdateParameters, *, content_type: str = 'application/json', **kwargs: Any) -> _models.StorageAccount
Parameters
Name | Description |
---|---|
resource_group_name
Required
|
The name of the resource group within the user's subscription. The name is case insensitive. Required. |
account_name
Required
|
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. |
parameters
Required
|
The parameters to provide for the updated account. Is either a StorageAccountUpdateParameters type or a IO[bytes] type. Required. |
Returns
Type | Description |
---|---|
StorageAccount or the result of cls(response) |
Exceptions
Type | Description |
---|---|
Attributes
models
models = <module 'azure.mgmt.storage.v2023_05_01.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\storage\\v2023_05_01\\models\\__init__.py'>
Azure SDK for Python