Using Console
Using CLI
az login
.
az storage account list --query [*].name --output tsv
az storage account keys list --account-name <storage-account-name> --query [*].value --output tsv
az storage account keys renew --account-name <storage-account-name> --key primary
This will generate a new access key and invalidate the old one.
az storage account keys renew --account-name <storage-account-name> --key secondary
Using Python
ServicePrincipalCredentials
class. You will need to provide the tenant_id
, client_id
, and client_secret
.azure.mgmt.authorization
package to get a list of all the users in your Azure subscription.n
days (where n
is a value you define).generate_access_key()
function to generate a new access key. This function should return a string that meets the Azure password requirements.