[BUG]TableClient CreateIfNotExistsAsync returns "Content-Type header value missing" intermittently
See original GitHub issueLibrary name and version
Azure.Data.Tables 12.8.0
Describe the bug
When calling CreateIfNotExistsAsync
, it returns “Content-Type header value missing”. See details below:
—> Azure.RequestFailedException: Content-Type header value missing. RequestId:a65cad2b-9002-0034-7714-616cfd000000 Time:2023-03-28T01:29:34.6706116Z Status: 400 (Bad Request) ErrorCode: InvalidInput
Content: {“odata.error”:{“code”:“InvalidInput”,“message”:{“lang”:“en-US”,“value”:“Content-Type header value missing.\nRequestId:a65cad2b-9002-0034-7714-616cfd000000\nTime:2023-03-28T01:29:34.6706116Z”}}}
Headers: Transfer-Encoding: chunked Server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-ms-request-id: a65cad2b-9002-0034-7714-616cfd000000 x-ms-version: REDACTED X-Content-Type-Options: REDACTED Date: Tue, 28 Mar 2023 01:29:34 GMT Content-Type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
at Azure.Data.Tables.TableClient.CreateIfNotExistsAsync(CancellationToken cancellationToken) …
We are authing with managed identity. And it seems that we only see the exception after upgraded to version 12.8.0
. Not seeing any issue in previous 12.5.0
.
Expected behavior
Not throwing exception.
Actual behavior
Create new table if not exists, not throwing exceptions.
Reproduction Steps
install package <PackageReference Include="Azure.Data.Tables" Version="12.8.0" />
code snippets:
var storageName = "yourStorage";
var tableName = "yourTable";
var clientOptions = new TableClientOptions();
var credential = new DefaultAzureCredential();
string tableUrl = $"https://{storageName}.table.core.windows.net/{tableName}";
var tableClient = new TableClient(new Uri(tableUrl), tableName , credential, clientOptions);
await tableClient.CreateIfNotExistsAsync(default);
try run multiple times.
Environment
Windows Server 2019-Datacenter on Azure, running with .NET 6.
Issue Analytics
- State:
- Created 6 months ago
- Comments:12 (10 by maintainers)
Top GitHub Comments
Azure.Core >=1.30 fixed the issue, not seeing those strange exceptions any more. thanks.
Hi @juniwang. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.