hijumpkick
hijumpkick

Reputation: 15

Read PublicAccess property for AzureRmStorageAccount

I'm trying to read the current state of the Azure Storage Accounts that are returned by Get-AzureRmStorageAccount. The block looks like

    foreach($a in $accounts){
       $context = $a.Context
       $containers += Get-AzureStorageContainer -Context $context
       Write-Output($containers)
    }

Right now this spits out the error The client ... does not have authorization to perform action blah blah. This is fine since I don't need to access anything inside. This does also however produce an output of

CloudBlobContainer : Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer
Permission         : Microsoft.WindowsAzure.Storage.Blob.BlobContainerPermissions
PublicAccess       : Off
LastModified       : 
ContinuationToken  :
Context            : Microsoft.WindowsAzure.Commands.Storage.AzureStorageContext
Name               : somename

I just want to read all of those PublicAccess fields

Upvotes: 0

Views: 69

Answers (1)

Wei Wei -Microsoft
Wei Wei -Microsoft

Reputation: 556

What's your concern?

If you only want the public access, it's already show there.

If you concern the error, would you please give following information for investigation:

  1. Which line of the script report the error?
  2. the Error details (hide any credential)
  3. Storage module version (get by run "Get-module" after the error repro)
  4. Run "$Error[0].Exception.ToString()" after after the error repro, and give the output.

Besides that, the formal way for Azure Powershell issue is open an issue in https://github.com/Azure/azure-powershell/issues. If you follow the issue template, most of the necessary information for investigation will be there.

Upvotes: 1

Related Questions