In this Azure PowerShell article, we will discuss the syntax and usage of the Set-AzStorageAccount PowerShell command, using specific examples.
Table of Contents
Set-AzStorageAccount
This Azure PowerShell command allows you 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>]Similar to the above, you can modify various properties, such as IdentityType, PublicNetworkAccess, EnableLocalUser, and others, using the same syntax.
Set-AzStorageAccount Examples
Let’s discuss a few examples of how to use the Set-AzStorageAccount PowerShell command.
Example-1
You can execute the following 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 received the output shown below, which was not as expected.
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

Example-2
You can execute the following Azure PowerShell command to enable the PublicNetworkAccess.
Set-AzStorageAccount -ResourceGroupName "Demo123" -Name "demo123b08c" -PublicNetworkAccess EnabledAfter 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

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 CoolAfter executing the above PowerShell script, click the “Yes” button on the next confirmation pop-up to apply the changes.

You may also check out New-AzStorageAccount
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 !!!

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
