< Back

New-AzureRmStorageAccount

Tue Jan 29, 2019 10:11 pm

NAME New-AzureRmStorageAccount



SYNOPSIS

Creates a Storage account.





SYNTAX

New-AzureRmStorageAccount [-ResourceGroupName] <String> [-Name] <String> [-SkuName] {Standard_LRS | Standard_ZRS | Standard_GRS | Standard_RAGRS |

Premium_LRS} [-Location] <String> [-AccessTier {Hot | Cool}] [-AsJob] [-AssignIdentity] [-CustomDomainName <String>] [-DefaultProfile

<IAzureContextContainer>] [-EnableEncryptionService {None | Blob | File}] [-EnableHttpsTrafficOnly <Boolean>] [-Kind {Storage | BlobStorage}]

[-NetworkRuleSet <PSNetworkRuleSet>] [-Tag <Hashtable>] [-UseSubDomain <Boolean>] [<CommonParameters>]





DESCRIPTION

The New-AzureRmStorageAccount cmdlet creates an Azure Storage account.





PARAMETERS

-AccessTier <String>

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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AsJob [<SwitchParameter>]

Run cmdlet in the background



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-AssignIdentity [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-CustomDomainName <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-EnableEncryptionService <EncryptionSupportServiceEnum>

Indicates whether this cmdlet enables Storage Service Encryption. Azure Blob storage and Azure Files are supported.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-EnableHttpsTrafficOnly <Boolean>

Indicates whether or not the Storage account only enables HTTPS traffic.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Kind <String>

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.



- StorageV2. General Purpose Version 2 (GPv2) Storage account that supports Blobs, Tables, Queues, Files, and Disks, with advanced features

like data tiering.



- BlobStorage. Blob Storage account which supports storage of Blobs only.





The default value is Storage.





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Location <String>

Specifies the location of the Storage account to create.



Required? true

Position? 3

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Name <String>

Specifies the name of the Storage account to create.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-NetworkRuleSet <PSNetworkRuleSet>

NetworkRuleSet is used to define a set of configuration rules for firewalls and virtual networks, as well as to set values for network

properties such as services allowed to bypass the rules and how to handle requests that don't match any of the defined rules.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ResourceGroupName <String>

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



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-SkuName <String>

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.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Tag <Hashtable>

Key-value pairs in the form of a hash table set as tags on the server. For example:



@{key0="value0";key1=$null;key2="value2"}



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-UseSubDomain <Boolean>

Indicates whether to enable indirect CName validation.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.Management.Storage.Models.PSStorageAccount







NOTES









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 with BlobStorage Kind and hot AccessTier



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

-Kind "BlobStorage" -AccessTier Hot



This command creates a Blob Storage account that with BlobStorage Kind and hot AccessTier





Example 3: Create a Storage account with Kind StorageV2, and Generate and Assign an Identity for Azure KeyVault.



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

-Kind StorageV2 -AssignIdentity



This command creates a Storage account with Kind StorageV2. It also generates and assigns an identity that can be used to manage account keys

through Azure KeyVault.





Example 4: Create a Storage account with NetworkRuleSet from JSON



PS C:\\>New-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "mystorageaccount" -Location "US West" -Type "Standard_LRS"

-NetworkRuleSet (@{bypass="Logging,Metrics";

ipRules=(@{IPAddressOrRange="20.11.0.0/16";Action="allow"},

@{IPAddressOrRange="10.0.0.0/7";Action="allow"});

virtualNetworkRules=(@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/

subnet1";Action="allow"},

@{VirtualNetworkResourceId="/subscriptions/s1/resourceGroups/g1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/s

ubnet2";Action="allow"});

defaultAction="Deny"})



This command creates a Storage account that has NetworkRuleSet property from JSON







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... ageaccount

Get-AzureRmStorageAccount

Remove-AzureRmStorageAccount

Set-AzureRmStorageAccount