I am trying to use the Azure CLI (bash) to create a storage account and set the "Default to Microsoft Entra authorization in the Azure portal" property to "Enabled" (as shown below):
There does not seem to be an option on the Azure CLI storage account create command to do this -- or more likely, I am missing which option to include.
Can this be done via the Azure CLI?
I did try this solution, but it had no effect (The setting was still "Disabled").
Default to Microsoft Entra authorization in the Azure portal - how?
You can use the below command to enable
the Default to Microsoft Entra authorization in the Azure portal via Azure CLI
commands.
Command:
az storage account update -g <Resource grp name> -n <Storage account name> --set defaultToOAuthAuthentication=true
Output:
PS /home/xxxx> az storage account update -g xxxx -n venkat678 --set defaultToOAuthAuthentication=true
{
"accessTier": "Hot",
"accountMigrationInProgress": null,
"allowBlobPublicAccess": true,
"allowCrossTenantReplication": false,
"allowSharedKeyAccess": true,
"allowedCopyScope": null,
"azureFilesIdentityBasedAuthentication": null,
"blobRestoreStatus": null,
"creationTime": "xxxx,
"customDomain": null,
"defaultToOAuthAuthentication": true,
"dnsEndpointType": null,
"enableHttpsTrafficOnly": true
Portal:
The above command executed and enabled the Default to Microsoft Entra authorization in the Azure portal.
Reference: