Skip to content
Azure Lessons
Azure Lessons
  • Home
  • AWS
  • Azure
    • Azure Virtual Machine
    • Azure Active Directory
    • Azure CLI
    • Azure CLI Commands List
    • Azure Cognitive Services
    • Azure Cosmos DB
    • Azure DevOps
    • Azure Functions
    • Azure PowerShell Commands
    • Azure Sentinel
    • Azure SQL
    • Azure Storage
    • Azure Synapse
  • Blogs
  • FREE EBOOK

Az storage account keys renew

January 30, 2025January 24, 2025 by Rajkishore

Recently, for one of my project requirements, I had to regenerate the access key for one of my storage accounts. This article will walk you through the syntax and usage of the az storage account keys renew command with specific examples so that you will get better clarity.

Table of Contents

  • Az storage account keys renew
    • Syntax
    • Example-1
    • Example-2

Az storage account keys renew

This command helps you regenerate the access and Kerberos keys for a specified storage account.

Syntax

Below is the syntax of the az storage account keys renew command.

az storage account keys renew --storage -account-name --key (key1, key2, primary, secondary}) [--key-type {kerb}][--resource-group-name]

Example-1

In the below example, I am regenerating the access key for the azureusanew storage account that belongs to the MyNewResGrp resource group.

az storage account keys renew -g MyNewResGrp -n azureusanew --key primary

After executing the above command, I got the successful output as below.

[
  {
    "creationTime": "2025-01-24T07:36:25.530187+00:00",
    "keyName": "key1",
    "permissions": "FULL",
    "value": "vg7wDz6vBCwjed+YzBLXn66MwebY3mF6EFUIxdGGbXD9r2GrwI2mtrzFY58DESBeAMXIyTXRPmHd+AStgI3IuA=="
  },
  {
    "creationTime": "2024-11-17T14:21:08.111950+00:00",
    "keyName": "key2",
    "permissions": "FULL",
    "value": "JlBMGRx9VHaeYOhmON62FKP9jIFbSOE5m1kNnxc/0ep5fMKeV8gAzY/GmGei7PmLYLYkHrXMXMfE+AStRiCfuw=="
  }
]

You can find the same output shown in the screenshot below.

Az storage account keys renew

Or, Instead of primary key word for key type, you can specify key1 or key2 as mentioned below.

az storage account keys renew -g MyNewResGrp -n azureusanew --key key1

After executing the above command, I got the expected output, as shown in the screenshot below.

Az storage account keys renew command

Example-2

In the below example, I am regenerating the Kerberos keys for the azureusanew storage account that belongs to the MyNewResGrp resource group.

az storage account keys renew -g MyNewResGrp -n azureusanew --key secondary --key-type kerb

After executing the above query, I got the expected output, as shown below.

[
  {
    "creationTime": "2025-01-24T08:03:11.782952+00:00",
    "keyName": "key1",
    "permissions": "FULL",
    "value": "e7YgnwSKEww0zorA9W//YUK28ICjmZMISvnosebjEOEs7mIyNh8y4H4QV8Ej4bGbD0pxwDJMhK+X+AStPx/3Rg=="
  },
  {
    "creationTime": "2024-11-17T14:21:08.111950+00:00",
    "keyName": "key2",
    "permissions": "FULL",
    "value": "JlBMGRx9VHaeYOhmON62FKP9jIFbSOE5m1kNnxc/0ep5fMKeV8gAzY/GmGei7PmLYLYkHrXMXMfE+AStRiCfuw=="
  },
  {
    "creationTime": "2025-01-24T08:09:56.533623+00:00",
    "keyName": "kerb2",
    "permissions": "FULL",
    "value": "otZUBAHfBDvGvhj0p24Qpd3LECrOtFiCTstTWEm80MqxPzbvO+BODVvxvSW1Czq/m6DdZiPUy44j+AStMBrdMg=="
  }
]

You can see the same output in the below screenshot.

Az storage account keys renew azure CLI command

You may also like the following articles

  • Az storage account show-connection-string
  • az storage account keys list
  • How To List The Storage Accounts In A Subscription On Azure PowerShell
  • How To Restore Deleted Storage Account In Azure
Microsoft Azure
Rajkishore

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.

az storage account keys list
How To Get Subnet ID In Azure PowerShell
Subscribe To Our YouTube Channel Subscribe to AzureLessons YouTube Channel

Recent Posts

  • Azure synapse Analytics Tutorial
  • Azure VM Backup Pricing
  • Azure VM
  • What Is Edge Location In AWS
  • DP-300 Certification
  • About Us
  • Contact Us
  • Privacy Policy
  • Sitemap
© 2026 Azure Lessons
Azure
Virtual
Machine
By: Rajkishore
Azure Consultant
PDF

Free 25+ page PDF

Download free Azure Virtual Machine PDF

Download our free 25+ page Azure Virtual Machine guide and master cloud deployment today!

No spam, ever. You will also get new Azure tutorials by email. Unsubscribe any time. Privacy policy

Check your inbox

Your Azure Virtual Machine PDF is on its way to . Can't find it in a few minutes? Look in your Promotions or Spam folder.