Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

ExecuteSegmentedQuery on TableStorage throws 403 error for Xamarin #843

Closed
JKennedy24 opened this issue Jan 17, 2019 · 2 comments
Closed

Comments

@JKennedy24
Copy link

Which service(blob, file, queue, table) does this issue concern?

Table

Which version of the SDK was used?

WindowsAzure.Storage V 9.3.3

Which platform are you using? (ex: .NET Core 2.1)

Server: .Net 4.7.1
Client: .Net standard 2.0

What problem was encountered?

I have a .Net Standard client application running on UWP.

My client application contacts the server that generates a sas key like so:

        var myPrivateStorageAccount = CloudStorageAccount.Parse(mystorageAccountKey);
        var myPrivateTableClient = myPrivateStorageAccount.CreateCloudTableClient();
        SharedAccessTablePolicy pol = new SharedAccessTablePolicy()
        {
            SharedAccessExpiryTime = DateTime.UtcNow.AddMinutes(59),
            Permissions = SharedAccessTablePermissions.Query | SharedAccessTablePermissions.Add
        };
        CloudTable myPrivateTable = myPrivateTableClient.GetTableReference(tableName);
        String sas = myPrivateTable.GetSharedAccessSignature(pol);
        return sas;

My client application then runs the following:

        StorageCredentials creds = new StorageCredentials(sas);

        this.tableClient = new CloudTableClient(tableServiceURI, creds);
        this.table = tableClient.GetTableReference(tableName);
        TableQuery<DynamicTableEntity> projectionQuery = new TableQuery<DynamicTableEntity>().Select(new string[] { "DocumentName" }).Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, cc));
         var res = await table.ExecuteQuerySegmentedAsync<DynamicTableEntity>(projectionQuery, null);

and gets the following error:

Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
sr is mandatory. Cannot be empty

but as this is tablestorage I dont think sr is required

so whats the problem here?

@JKennedy24
Copy link
Author

is this linked to this issue: #491

I cannot seem to find any documentation on what API's are supported for what target frameworks?

@JKennedy24
Copy link
Author

Ok this was my bad:

I was sending the request to:

https://myaccount.blob.core.windows.net/

and should have been sending the request to:

https://myaccount.table.core.windows.net/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant