Set-AzureRmCurrentStorageAccount

Modifies the current Storage account of the specified subscription.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

Set-AzureRmCurrentStorageAccount
   -ResourceGroupName <String>
   -Name <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Set-AzureRmCurrentStorageAccount
   -Context <IStorageContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Set-AzureRmCurrentStorageAccount cmdlet modifies the current Azure Storage account of the specified Azure subscription in Azure PowerShell. The current Storage account is used as the default when you access Storage without specifying a Storage account name.

Examples

Example 1: Set the current Storage account

PS C:\>Set-AzureRmCurrentStorageAccount -ResourceGroupName "RG01" -AccountName "mystorageaccount"

This command sets the default Storage account for the specified subscription.

Parameters

-Context

Specifies an AzureStorageContext object for the current Storage account. To obtain a storage context object, use the New-AzureStorageContext cmdlet.

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

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of the Storage account that this cmdlet modifies.

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

-ResourceGroupName

Specifies the resource group that contains the Storage account to modify.

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

Inputs

IStorageContext

String

Outputs

String