-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Response x-ms-client-request-id does not match the original expected request id #48193
Comments
I saw a previous issue marked "closed as not planned". Hence opening this one. Let me know if there is an error in usage pattern. This request doesn't fail when sending directly to ADLS service. |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @sumantmehtams. |
Maybe an easier way to set the x-ms-client-request id is to use the |
I don't see why this is easier than simply adding an http request header to the request. Regardless, this seems to set client request id for all the usage inside its scope which could be problematic in some use-cases. |
@cool-mist Can you clarify on the use cases that are problematic? @jsquire @tg-msft Is there any issues with setting the client-request-id through the |
@cool-mist: The entire approach used here is not recommended, as you're working around the Azure SDK client and pipeline. There's no reason that you'd need/want to use a custom Setting the client request identifierThe recommended approach to setting a custom var secretClient = new SecretClient(new Uri("http://example.com"), new DefaultAzureCredential());
using (HttpPipeline.CreateClientRequestIdScope("<custom-client-request-id>"))
{
// The HTTP request resulting from the client call would have x-ms-client-request-id value set to <custom-client-request-id>
secretClient.GetSecret("<secret-name>");
} If that does not work for you, due to some unusual scenario, you'd want to create a synchronous policy and inject the header there, as demonstrated in this sample. AuthorizationAll Azure SDK clients work with Azure.Identity credentials natively via constructor overloads that accept the This is demonstrated in [this sample](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Files.DataLake/samples/Sample02_Auth.cs#L181_: // Create a token credential that can use our Azure Active
// Directory application to authenticate with Azure Storage
var credential = new DefaultAzureCredential();
// Create a client that can authenticate using our token credential
DataLakeServiceClient service = new DataLakeServiceClient(ActiveDirectoryBlobUri, credential);
// Make a service request to verify we've successfully authenticated
await service.CreateFileSystemAsync("sample-filesystem-aad");
await service.DeleteFileSystemAsync("sample-filesystem-aad"); |
We call onelake with the same sdks and onelake supports another token scheme which is faster to authorize than "Bearer". The token credential always adds "Bearer" scheme. I wanted to not use the bearer scheme, but from your comments, I understand azure sdk is not intended for such things. If the azure dotnet sdk team treats this behavior as not-buggy, then please feel free to close this issue. |
@cool-mist: The correct approach for doing this would still be to add a static policy that manages the non-standard header rather than working outside of the Azure SDK pipeline. |
The DataLake SDK does not support OneLake. Which would explain the confusion of the intention of different token schemes, and what you're trying to achieve. |
Library name and version
Azure.Storage.Files.DataLake 12.21.0
Describe the bug
Getting this error while trying to pass x-ms-client-request-id header in the request and using the SDK to get properties
var properties = await client.GetPropertiesAsync();
Expected behavior
Request should not error out.
Actual behavior
Request fails
Reproduction Steps
Environment
No response
The text was updated successfully, but these errors were encountered: