Azure / Azure/Azurite

403 (Forbidden) error when use .NET Table Storage SDK with DefaultAzureCredential

Open
#1,062 2 comments 0 reactions 1 assignee Claimed by @Poku8 View on GitHub
question stale
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

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

### Which version of the Azurite was used?
3.14.2

### Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
NPM

### What's the Node.js version?
14.17.6

### What problem was encountered?
Azurite returns 403 Forbidden status when use .NET SDK DefaultAzureCredential and TableClient to connect table storage.

### Steps to reproduce the issue?
nuget packages:
Azure.Data.Tables 12.1.0
Azure.Identity 1.4.1

Azurite commandline: ```azurite --oauth basic --cert cert.pem --key key.pem```
Certificates generated with OpenSSL according to [docs](https://github.com/azure/azurite#openssl)
az login executed

Code to initialize client:
```
var client = new TableClient(new Uri("https://127.0.0.1:10002/devstoreaccount1/TestTable"), "TestTable", new DefaultAzureCredential());
```

Response from service:
```
Service request failed.
Status: 403 (Forbidden)

Content:

AuthorizationFailure
Server failed to authenticate the request. Make sure the value of the Authorization header is formed correctly including the signature.
RequestId:8991197f-9fe3-4697-b6e4-3305421d2e4d
Time:2021-09-25T13:25:17.378Z

Headers:
Server: Azurite-Table/3.14.2
x-ms-error-code: REDACTED
x-ms-request-id: 8991197f-9fe3-4697-b6e4-3305421d2e4d
x-ms-version: REDACTED
Date: Sat, 25 Sep 2021 13:25:17 GMT
Connection: keep-alive
Keep-Alive: REDACTED
Transfer-Encoding: chunked
Content-Type: application/xml
```
Notes:
Same code works well with azure azure table storage.
Works well with azurite, same endpoint url and shared key credentials
Experiments with Endpoint url didn't change results.
Logs attached.
[tmp.log](https://github.com/Azure/Azurite/files/7229803/tmp.log)

### Have you found a mitigation/solution?
No

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.