New-AzureStorageAccount

Creates a new storage account in an Azure subscription.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

New-AzureStorageAccount
   [-StorageAccountName] <String>
   [-Label <String>]
   [-Description <String>]
   -AffinityGroup <String>
   [-Type <String>]
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
New-AzureStorageAccount
   [-StorageAccountName] <String>
   [-Label <String>]
   [-Description <String>]
   -Location <String>
   [-Type <String>]
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]

Description

The New-AzureStorageAccount cmdlet creates an account that provides access to Azure storage services. A storage account is a globally unique resource within the storage system. The account is the parent namespace for the Blob, Queue, and Table services.

Examples

Example 1: Create a storage account for a specified affinity group

PS C:\> New-AzureStorageAccount -StorageAccountName "azure01" -Label "AzureOne" -AffinityGroup "prodapps"

This command creates a storage account for a specified affinity group.

Example 2: Create a storage account in a specified location

PS C:\> New-AzureStorageAccount -StorageAccountName "azure02" -Label "AzureTwo" -Location "North Central US"

This command creates a storage account in a specified location.

Parameters

-AffinityGroup

Specifies the name of an existing affinity group in the current subscription. You can specify either the Location or AffinityGroup parameter, but not both.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Description

Specifies a description for the storage account. The description may be up to 1024 characters in length.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-InformationAction

Specifies how this cmdlet responds to an information event.

The acceptable values for this parameter are:

  • Continue
  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Label

Specifies a label for the storage account. The label may be up to 100 characters in length.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Location

Specifies the Azure data center location where the storage account is created. You can include either the Location or AffinityGroup parameter, but not both.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Type:AzureSMProfile
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StorageAccountName

Specifies a name for the storage account. The storage account name must be unique to Azure and must be between 3 and 24 characters in length and use lowercase letters and numbers only.

Type:String
Aliases:ServiceName
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Type

Specifies the type of the storage account. Valid values are:

  • Standard_LRS
  • Standard_ZRS
  • Standard_GRS
  • Standard_RAGRS
  • Premium_LRS

If this parameter is not specified, the default value is Standard_GRS.

Standard_ZRS or Premium_LRS accounts cannot be changed to other account types, and vice versa.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False