Skip to content

Forbidden Response using Table-Level SAS Token on Get-AzStorageTable  #14394

@gwalkey

Description

@gwalkey

Using AzTable 2.04

Sas Token was created 3 different ways

Azure Portal - right Click on Table "Get SAS Token"
Powershell New-AzStorageTableSASToken
Azure Storage Explorer
All three SAS Tokens created on the Table ALONE fail
Using a SAS Token on the ENTIRE STORAGE ACCOUNT Always works

Code is:
Import-Module -Name Az.Storage
Import-Module -Name Az.Resources
Import-Module -Name AzTable

$AzStorageAccount = "storage_accountname"
$TableName = 'TableName'
$TableSasToken ="?st=2021-02-25T15%3A40%3A11Z&se=2022-01-01T04%3A59%3A00Z&sp=raud&sv=2018-03-28&tn=TableName&sig=mysig"
$StorageCtx = New-AzStorageContext -StorageAccountName $AzStorageAccount -SasToken $TableSasToken
$Table = Get-AzStorageTable -Name $tableName -Context $StorageCtx

throws
Forbidden

DEBUG: 1:04:10 PM - GetAzureStorageTableCommand end processing, Start 7 remote calls. Finish 7 remote calls. Elapsed time 1538702.92 ms. Client operation id: Azure-Storage-PowerShell-ee008953-9bf3-4536-9ad2-74a5b8742830.

DEBUG: AzureQoSEvent: CommandName - Get-AzStorageTable; IsSuccess - False; Duration - 00:00:01.8729751;; Exception - Microsoft.Azure.Cosmos.Table.StorageException: Forbidden
at Microsoft.WindowsAzure.Commands.Storage.Model.Contract.StorageTableManagement.DoesTableExist(CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext)
at Microsoft.WindowsAzure.Commands.Storage.Table.Cmdlet.GetAzureStorageTableCommand.d__12.MoveNext()
at Microsoft.WindowsAzure.Commands.Storage.Table.Cmdlet.GetAzureStorageTableCommand.WriteTablesWithStorageContext(IEnumerable`1 tableList)
at Microsoft.WindowsAzure.Commands.Storage.Table.Cmdlet.GetAzureStorageTableCommand.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Request Information

RequestID:7b83f525-9002-0011-80a0-0b6c7f000000
RequestDate:Thu, 25 Feb 2021 18:04:08 GMT
StatusMessage:Forbidden
ErrorCode:
ErrorMessage:This request is not authorized to perform this operation.
RequestId:7b83f525-9002-0011-80a0-0b6c7f000000
Time:2021-02-25T18:04:08.4574077Z;
DEBUG: Finish sending metric.
DEBUG: 1:04:10 PM - GetAzureStorageTableCommand end processing.

hitting the URL in a browser works fine
using the same Table-level SAS Token against the REST API directly also works fine

Metadata

Metadata

Assignees

Labels

Service AttentionThis issue is responsible by Azure service team.Storagecustomer-reportedquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions