New-AzureRmStorageAccount

Creates a Storage account.

Syntax

New-AzureRmStorageAccount
   [-ResourceGroupName] <String>
   [-Name] <String>
   [-SkuName] <String>
   [-Location] <String>
   [-Kind <String>]
   [-AccessTier <String>]
   [-CustomDomainName <String>]
   [-UseSubDomain <Boolean>]
   [-EnableEncryptionService <EncryptionSupportServiceEnum>]
   [-Tag <Hashtable>]
   [-EnableHttpsTrafficOnly <Boolean>]
   [-AssignIdentity]
   [-NetworkRuleSet <PSNetworkRuleSet>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The New-AzureRmStorageAccount cmdlet creates an Azure Storage account.

Examples

Example 1: Create a Storage Account

PS C:\>New-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount" -Location "US West" -SkuName "Standard_GRS"

This command creates a Storage account for the resource group name MyResourceGroup.

Example 2: Create a Blob Storage account that uses Storage Service Encryption

PS C:\>New-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount" -Location "US West" -SkuName "Standard_GRS" -EnableEncryptionService Blob -Kind "BlobStorage" -AccessTier Hot

This command creates a Blob Storage account that uses the hot access type. The account has enabled Storage Service encryption on Blob Service.

Example 3: Create a Storage Account that Enables Storage Service Encryption on Blob and File Services, and Generate and Assign an Identity for Azure KeyVault.

PS C:\>New-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount" -Location "US West" -SkuName "Standard_GRS" -EnableEncryptionService "Blob,File" -AssignIdentity

This command creates a Storage account that enabled Storage Service encryption on Blob and File Services. It also generates and assigns an identity that can be used to manage account keys through Azure KeyVault.

Required Parameters

-Location

Specifies the location of the Storage account to create.

Type:String
Position:3
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Name

Specifies the name of the Storage account to create.

Type:String
Aliases:StorageAccountName, AccountName
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ResourceGroupName

Specifies the name of the resource group in which to add the Storage account.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SkuName

Specifies the SKU name of the storage account that this cmdlet creates. The acceptable values for this parameter are:

  • Standard_LRS. Locally-redundant storage.
  • Standard_ZRS. Zone-redundant storage.
  • Standard_GRS. Geo-redundant storage.
  • Standard_RAGRS. Read access geo-redundant storage.
  • Premium_LRS. Premium locally-redundant storage.
Type:String
Aliases:StorageAccountType, AccountType, Type
Parameter Sets:Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS, Premium_LRS
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-AccessTier

Specifies the access tier of the Storage account that this cmdlet creates. The acceptable values for this parameter are: Hot and Cool.

If you specify a value of BlobStorage for the Kind parameter, you must specify a value for the AccessTier parameter.

If you specify a value of Storage for this Kind parameter, do not specify the AccessTier parameter.

Type:String
Parameter Sets:Hot, Cool
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AssignIdentity

Generate and assign a new Storage Account Identity for this storage account for use with key management services like Azure KeyVault.

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CustomDomainName

Specifies the name of the custom domain of the Storage account. The default value is Storage.

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

The credentials, account, tenant, and subscription used for communication with azure.

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EnableEncryptionService

Indicates whether this cmdlet enables Storage Service encryption on the Storage Service. Azure Blob and Azure File Services are supported.

Type:System.Nullable`1[Microsoft.Azure.Commands.Management.Storage.StorageAccountBaseCmdlet+EncryptionSupportServiceEnum]
Parameter Sets:None, Blob, File
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EnableHttpsTrafficOnly

Indicates whether or not the Storage Account only enable https traffic.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Kind

Specifies the kind of Storage account that this cmdlet creates. The acceptable values for this parameter are:

  • Storage. General purpose storage account that supports storage of Blobs, Tables, Queues, Files and Disks.

  • BlobStorage. Blob storage account which supports storage of Blobs only.

The default value is Storage.

Type:String
Parameter Sets:Storage, BlobStorage
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-NetworkRuleSet

Storage Account NetworkRuleSet

Type:Microsoft.Azure.Commands.Management.Storage.Models.PSNetworkRuleSet
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Tag

If you specify a value of BlobStorage for the Kind parameter, you must specify a value for the AccessTier parameter.

If you specify a value of Storage for this Kind parameter, do not specify the AccessTier parameter.

Type:Hashtable
Aliases:Tags
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UseSubDomain

Indicates whether to enable indirect CName validation.

Type:System.Nullable`1[System.Boolean]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False