StorageAccountsOperations Class

StorageAccountsOperations operations.

You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute.

Inheritance
builtins.object
StorageAccountsOperations

Constructor

StorageAccountsOperations(client, config, serializer, deserializer)

Parameters

client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

models

Alias to model classes used in this operation group.

Methods

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_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_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, account_name, parameters, **kwargs)

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
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.

parameters
StorageAccountCreateParameters
Required

The parameters to provide for the created account.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

Pass in True if you'd like the ARMPolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

An instance of LROPoller that returns either StorageAccount or the result of cls(response)

Return type

Exceptions

~azure.core.exceptions.HttpResponseError

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_failover(resource_group_name, account_name, **kwargs)

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
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.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

Pass in True if you'd like the ARMPolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

An instance of LROPoller that returns either None or the result of cls(response)

Return type

Exceptions

~azure.core.exceptions.HttpResponseError

begin_restore_blob_ranges

Restore blobs in the specified blob ranges.

begin_restore_blob_ranges(resource_group_name, account_name, parameters, **kwargs)

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
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.

parameters
BlobRestoreParameters
Required

The parameters to provide for restore blob ranges.

cls
callable

A custom type or function that will be passed the direct response

continuation_token
str

A continuation token to restart a poller from a saved state.

polling
bool or PollingMethod

Pass in True if you'd like the ARMPolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy.

polling_interval
int

Default waiting time between two polls for LRO operations if no Retry-After header is present.

Returns

An instance of LROPoller that returns either BlobRestoreStatus or the result of cls(response)

Return type

Exceptions

~azure.core.exceptions.HttpResponseError

check_name_availability

Checks that the storage account name is valid and is not already in use.

check_name_availability(account_name, **kwargs)

Parameters

account_name
StorageAccountCheckNameAvailabilityParameters
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.

cls
callable

A custom type or function that will be passed the direct response

Returns

CheckNameAvailabilityResult, or the result of cls(response)

Return type

Exceptions

~azure.core.exceptions.HttpResponseError

delete

Deletes a storage account in Microsoft Azure.

delete(resource_group_name, account_name, **kwargs)

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
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.

cls
callable

A custom type or function that will be passed the direct response

Returns

None, or the result of cls(response)

Return type

Exceptions

~azure.core.exceptions.HttpResponseError

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, account_name, expand=None, **kwargs)

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
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.

expand
str or StorageAccountExpand
default value: None

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.

cls
callable

A custom type or function that will be passed the direct response

Returns

StorageAccount, or the result of cls(response)

Return type

Exceptions

~azure.core.exceptions.HttpResponseError

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)

Parameters

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either StorageAccountListResult or the result of cls(response)

Return type

Exceptions

~azure.core.exceptions.HttpResponseError

list_account_sas

List SAS credentials of a storage account.

list_account_sas(resource_group_name, account_name, parameters, **kwargs)

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
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.

parameters
AccountSasParameters
Required

The parameters to provide to list SAS credentials for the storage account.

cls
callable

A custom type or function that will be passed the direct response

Returns

ListAccountSasResponse, or the result of cls(response)

Return type

Exceptions

~azure.core.exceptions.HttpResponseError

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, **kwargs)

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either StorageAccountListResult or the result of cls(response)

Return type

Exceptions

~azure.core.exceptions.HttpResponseError

list_keys

Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account.

list_keys(resource_group_name, account_name, expand='kerb', **kwargs)

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
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.

expand
str
default value: kerb

Specifies type of the key to be listed. Possible value is kerb.

cls
callable

A custom type or function that will be passed the direct response

Returns

StorageAccountListKeysResult, or the result of cls(response)

Return type

Exceptions

~azure.core.exceptions.HttpResponseError

list_service_sas

List service SAS credentials of a specific resource.

list_service_sas(resource_group_name, account_name, parameters, **kwargs)

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
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.

parameters
ServiceSasParameters
Required

The parameters to provide to list service SAS credentials.

cls
callable

A custom type or function that will be passed the direct response

Returns

ListServiceSasResponse, or the result of cls(response)

Return type

Exceptions

~azure.core.exceptions.HttpResponseError

regenerate_key

Regenerates one of the access keys or Kerberos keys for the specified storage account.

regenerate_key(resource_group_name, account_name, regenerate_key, **kwargs)

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
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.

regenerate_key
StorageAccountRegenerateKeyParameters
Required

Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2.

cls
callable

A custom type or function that will be passed the direct response

Returns

StorageAccountListKeysResult, or the result of cls(response)

Return type

Exceptions

~azure.core.exceptions.HttpResponseError

revoke_user_delegation_keys

Revoke user delegation keys.

revoke_user_delegation_keys(resource_group_name, account_name, **kwargs)

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
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.

cls
callable

A custom type or function that will be passed the direct response

Returns

None, or the result of cls(response)

Return type

Exceptions

~azure.core.exceptions.HttpResponseError

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, account_name, parameters, **kwargs)

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
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.

parameters
StorageAccountUpdateParameters
Required

The parameters to provide for the updated account.

cls
callable

A custom type or function that will be passed the direct response

Returns

StorageAccount, or the result of cls(response)

Return type

Exceptions

~azure.core.exceptions.HttpResponseError

Attributes

models

models = <module 'azure.mgmt.storage.v2021_01_01.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.6.8\\x64\\lib\\site-packages\\azure\\mgmt\\storage\\v2021_01_01\\models\\__init__.py'>