Set-AzStorageAccount

In this Azure PowerShell article, we will discuss the syntax and usage of the Set-AzStorageAccount PowerShell command with certain examples.

Set-AzStorageAccount

You can use this Azure PowerShell command to modify or update your Azure Storage account.

Syntax

Below is the syntax of the Set-AzStorageAccount PowerShell command.

Set-AzStorageAccount
 [-ResourceGroupName] <String>
 [-Name] <String>
 [-SkuName <String>]

Like the above, you can modify many properties like IdentityType, PublicNetworkAccess, EnableLocalUser, and many more using the above syntax.

Examples

Let’s discuss a few examples of how to use the Set-AzStorageAccount PowerShell command.

Example-1

You can execute the below Azure PowerShell command to modify the Storage account type.

Set-AzStorageAccount -ResourceGroupName "Demo123" -Name "demo123b08c" -SkuName "Standard_RAGRS"

After executing the above PowerShell command, I got the below-expected output.


StorageAccountName ResourceGroupName PrimaryLocation SkuName        Kind    AccessTier CreationTime        ProvisioningState EnableHttpsTrafficOnly Lar
                                                                                                                                                    geF
                                                                                                                                                    ile
                                                                                                                                                    Sha
                                                                                                                                                    res
------------------ ----------------- --------------- -------        ----    ---------- ------------        ----------------- ---------------------- ---
demo123b08c        Demo123           eastus          Standard_RAGRS Storage            05-09-2023 07:14:27 Succeeded         True                      

After executing the above Azure PowerShell command, I got the expected output below

Set-AzStorageAccount

Example-2

You can execute the below Azure PowerShell command to enable the PublicNetworkAccess.

Set-AzStorageAccount -ResourceGroupName "Demo123" -Name "demo123b08c" -PublicNetworkAccess Enabled

After executing the above command, I got the below-expected output

StorageAccountName ResourceGroupName PrimaryLocation SkuName        Kind    AccessTier CreationTime        ProvisioningState EnableHttpsTrafficOnly Lar
                                                                                                                                                    geF
                                                                                                                                                    ile
                                                                                                                                                    Sha
                                                                                                                                                    res
------------------ ----------------- --------------- -------        ----    ---------- ------------        ----------------- ---------------------- ---
demo123b08c        Demo123           eastus          Standard_RAGRS Storage            05-09-2023 07:14:27 Succeeded         True                      


You can see the same output below

set-azstorageaccount context

Example-3

You can execute the below PowerShell command to update the access tier value of the specified storage account.

Set-AzStorageAccount -ResourceGroupName "Demo123" -Name "demo123b08c" -AccessTier Cool

After executing the above PowerShell script, just click on the Yes button on the next confirmation pop-up to update the changes.

Set-AzStorageAccount PowerShell

Wrapping Up

In this Azure PowerShell article, we discussed the syntax and usage of the Set-AzStorageAccount PowerShell command with certain examples. Thanks for reading this article !!!