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_failover |
Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. |
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_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.
async begin_abort_hierarchical_namespace_migration(resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncLROPoller[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 AsyncLROPoller 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.
async begin_create(resource_group_name: str, account_name: str, parameters: _models.StorageAccountCreateParameters, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_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 AsyncLROPoller that returns either StorageAccount or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_failover
Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover.
async begin_failover(resource_group_name: str, account_name: str, **kwargs: Any) -> AsyncLROPoller[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 AsyncLROPoller 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.
async begin_hierarchical_namespace_migration(resource_group_name: str, account_name: str, request_type: str, **kwargs: Any) -> AsyncLROPoller[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 AsyncLROPoller that returns either None or the result of cls(response) |
Exceptions
Type | Description |
---|---|
begin_restore_blob_ranges
Restore blobs in the specified blob ranges.
async begin_restore_blob_ranges(resource_group_name: str, account_name: str, parameters: _models.BlobRestoreParameters, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_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 AsyncLROPoller 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.
async 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.
async 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_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.
async 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) -> AsyncIterable[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.
async 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) -> AsyncIterable[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.
async 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.
async 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.
async 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.
async 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.
async 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.v2022_05_01.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\storage\\v2022_05_01\\models\\__init__.py'>
Azure SDK for Python