Reputation: 1664
I was running the cmdlet Get-AzStorageAccount
on a storage account to test whether public access is enabled.
az storage account show -g MyResourceGroup -n MyStorageAccount
For a while I was under the impression that the cmdlet works only on StorageV2
accounts. But, I can confirm that this is not the case. The cmdlet is inconsistent with both StorageV2
and General purpose V1
accounts.
I am unable to understand the reason for the inconsistent behaviour of the cmdlet Get-AzStorageAccount
w.r.t property AllowPublicBlobAccess
?
thank you,
Sau
Upvotes: 1
Views: 980
Reputation: 7483
As the document shows in the Note
:
The AllowBlobPublicAccess property is not set by default and does not return a value until you explicitly set it. The storage account permits public access when the property value is null or when it is true.
You need to disable it and save, then enable it. The property will be true
that you want.
Upvotes: 2