Set-​Azure​Rm​Storage​Account

Modifies a Storage account.

Syntax

Set-AzureRmStorageAccount
   [-ResourceGroupName] <String>
   [-Name] <String>
   [[-SkuName] <String>]
   [[-AccessTier] <String>]
   [[-CustomDomainName] <String>]
   [[-UseSubDomain] <Boolean>]
   [[-EnableEncryptionService] <EncryptionSupportServiceEnum>]
   [[-DisableEncryptionService] <EncryptionSupportServiceEnum>]
   [[-Tag] <Hashtable>]
   [-AssignIdentity]
   [-EnableHttpsTrafficOnly <Boolean>]
   [-Force]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   -KeyName <String>
   [-KeyvaultEncryption]
   -KeyVaultUri <String>
   -KeyVersion <String>
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]
Set-AzureRmStorageAccount
   [-ResourceGroupName] <String>
   [-Name] <String>
   [[-SkuName] <String>]
   [[-AccessTier] <String>]
   [[-CustomDomainName] <String>]
   [[-UseSubDomain] <Boolean>]
   [[-EnableEncryptionService] <EncryptionSupportServiceEnum>]
   [[-DisableEncryptionService] <EncryptionSupportServiceEnum>]
   [[-Tag] <Hashtable>]
   [-AssignIdentity]
   [-EnableHttpsTrafficOnly <Boolean>]
   [-Force]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-StorageEncryption]
   [-Confirm]
   [-WhatIf]
   [<CommonParameters>]

Description

The Set-AzureRmStorageAccount cmdlet modifies an Azure Storage account. You can use this cmdlet to modify the account type, update a customer domain, or set tags on a Storage account.

Examples

Example 1: Set the Storage account type

PS C:\>Set-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount" -Type "Standard_RAGRS"

This command sets the Storage account type to Standard_RAGRS.

Example 2: Set a custom domain for a Storage account

PS C:\>Set-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount" -CustomDomainName "www.contoso.com" -UseSubDomain $True

This command sets a custom domain for a Storage account.

Example 3: Enable encryption on Blob and File Services

PS C:\>Set-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount" -EnableEncryptionService "Blob,File"

This command enables Storage Service encryption on Blob and File for a Storage account.

Example 4: Set the access tier value

PS C:\>Set-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount" -AccessTier Cool

The command sets the Access Tier value to be cool.

Example 4: Set the custom domain and tags

PS C:\>Set-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount" -CustomDomainName "www.domainname.com" -UseSubDomain $true -Tag @{tag0="value0";tag1="value1";tag2="value2"}

The command sets the Access Tier value to be cool.

Example 5: Enable encryption on Blob Services with Keyvault

PS C:\>Set-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount" -AssignIdentity
PS C:\>$account = Get-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount"

PS C:\>$keyVault = New-AzureRmKeyVault -VaultName "MyKeyVault" -ResourceGroupName "MyResourceGroup" -Location "EastUS2"
PS C:\>$key = Add-AzureKeyVaultKey -VaultName "MyKeyVault" -Name "MyKey" -Destination 'Software'
PS C:\>Set-AzureRmKeyVaultAccessPolicy -VaultName "MyKeyVault" -ObjectId $account.Identity.PrincipalId -PermissionsToKeys wrapkey,unwrapkey

PS C:\>Set-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount" -EnableEncryptionService "Blob" -KeyvaultEncryption -KeyName $key.Name -KeyVersion $key.Version -KeyVaultUri $keyVault.VaultUri

This command enables Storage Service encryption on Blob with a new created Keyvault.

Example 6: Disable encryption on File Services with KeySource set to "Microsoft.Storage"

PS C:\>Set-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount" -DisableEncryptionService File  -StorageEncryption

This command disables encryption on File Services with KeySource set to "Microsoft.Storage"

Required Parameters

-KeyName

Storage Account encryption keySource KeyVault KeyName

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

Storage Account encryption keySource KeyVault KeyVaultUri

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

Storage Account encryption keySource KeyVault KeyVersion

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

Specifies the name of the Storage account to Modify.

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 modify the Storage account.

Type:String
Position:0
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 modifies. The acceptable values for this parameter are: Hot and Cool.

If you change the access tier, it may result in additional charges. For more information, see Azure Blob Storage: Hot and cool storage tiershttp://go.microsoft.com/fwlink/?LinkId=786482 (http://go.microsoft.com/fwlink/?LinkId=786482). If the kind of Storage account is Storage, do not specify this parameter.

Type:String
Position:3
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:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-CustomDomainName

Specifies the name of the custom domain.

Type:String
Position:4
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisableEncryptionService

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

Type:EncryptionSupportServiceEnum
Position:7
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:EncryptionSupportServiceEnum
Position:6
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
-Force

If you change the access tier, it may result in additional charges. For more information, see Azure Blob Storage: Hot and cool storage tiershttp://go.microsoft.com/fwlink/?LinkId=786482 (http://go.microsoft.com/fwlink/?LinkId=786482). If the kind of Storage account is Storage, do not specify this parameter.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
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
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

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

Whether to set Storage Account Encryption KeySource to Microsoft.Keyvault or not. If you specify KeyName, KeyVersion and KeyvaultUri, Storage Account encryption keySource will also be set to Microsoft.Keyvault weather this parameter is set or not.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SkuName

Specifies the SKU name of the storage account. 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.

You cannot change Standard_ZRS and Premium_LRS types to other account types. You cannot change other account types to Standard_ZRS or Premium_LRS.

Type:String
Aliases:StorageAccountType, AccountType, Type
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-StorageEncryption

Whether to set Storage Account Encryption KeySource to Microsoft.Storage or not.

Type:SwitchParameter
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 of the New-AzureRmStorageAccount cmdlet, 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:8
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-UseSubDomain

Indicates whether to enable indirect CName validation.

Type:Boolean
Position:5
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False