azure-sdk-for-net
azure-sdk-for-net copied to clipboard
[BUG] IContainerRegistryManagementClient.Registries.ListCredentialsAsync always throws TaskCanceledException
Describe the bug I call the above method to get the credential on a container registry, it always throws TaskCanceledException.
Expected behavior Returns successfully.
Actual behavior (include Exception or Stack Trace) It always throws the exception TaskCanceledException
I set ServiceClientTracing.IsEnabled = true; and the interceptor to trace the rest api calls.
Information: 0 : Arm Tracing 1, Enter method ListCredentials
Information: 0 : Arm Tracing 1, Send request Method: POST, RequestUri: 'https://management.azure.com/subscriptions/<REMOVED>/resourceGroups/smlrp-dev-westus2/providers/Microsoft.ContainerRegistry/registries/smlrpdevwus2/listCredentials?api-version=2019-05-01', Version: 1.1, Content: <null>, Headers:
{
x-ms-client-request-id: <Removed>
Accept-Language: en-US
Authorization: Bearer <Removed>
}
Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in System.Private.CoreLib.dll
The exception is just thrown after the request is sent.
I used the url and the bearer token in Postman and the request returns quickly with the credentials.
To Reproduce Steps to reproduce the behavior (include a code snippet, screenshot, or any additional information that might help us reproduce the issue)
- auth and get the access token to the Azure management endpoint https://management.core.windows.net/.
- The access token is a string. Convert it to TokenCredentials by
var credentials = new Microsoft.Rest.TokenCredentials(accessString). - Create the
ContainerRegistryManagementClientviavar registryManagementClient = new ContainerRegistryManagementClient(credentials) { SubscriptionId = "YourSubscriptionId" }. - Call the api
registryManagementClient.Registries.ListCredentialsAsync(this.ResourceGroupName, this.Name, cancellationToken.
Environment:
- Name and version of the Library package used: Microsoft.Azure.Management.ContainerRegistry, version 4.0.0
- Hosting platform or OS and .NET runtime version (
dotnet --infooutput for .NET Core projects): [e.g. Azure AppService or Windows 10 .NET Framework 4.8] Windows 10, ASP.Net Core 3.1 - IDE and version : [e.g. Visual Studio 16.3] Visual Studio 16.10.Preview 2
Thank you for your feedback. Tagging and routing to the team member best able to assist.
Thanks for your feedback, re-routing to service team.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @toddysm, @yugangw-MSFT.
Issue Details
Describe the bug I call the above method to get the credential on a container registry, it always throws TaskCanceledException.
Expected behavior Returns successfully.
Actual behavior (include Exception or Stack Trace) It always throws the exception TaskCanceledException
I set ServiceClientTracing.IsEnabled = true; and the interceptor to trace the rest api calls.
Information: 0 : Arm Tracing 1, Enter method ListCredentials
Information: 0 : Arm Tracing 1, Send request Method: POST, RequestUri: 'https://management.azure.com/subscriptions/<REMOVED>/resourceGroups/smlrp-dev-westus2/providers/Microsoft.ContainerRegistry/registries/smlrpdevwus2/listCredentials?api-version=2019-05-01', Version: 1.1, Content: <null>, Headers:
{
x-ms-client-request-id: <Removed>
Accept-Language: en-US
Authorization: Bearer <Removed>
}
Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in System.Private.CoreLib.dll
The exception is just thrown after the request is sent.
I used the url and the bearer token in Postman and the request returns quickly with the credentials.
To Reproduce Steps to reproduce the behavior (include a code snippet, screenshot, or any additional information that might help us reproduce the issue)
- auth and get the access token to the Azure management endpoint https://management.core.windows.net/.
- The access token is a string. Convert it to TokenCredentials by
var credentials = new Microsoft.Rest.TokenCredentials(accessString). - Create the
ContainerRegistryManagementClientviavar registryManagementClient = new ContainerRegistryManagementClient(credentials) { SubscriptionId = "YourSubscriptionId" }. - Call the api
registryManagementClient.Registries.ListCredentialsAsync(this.ResourceGroupName, this.Name, cancellationToken.
Environment:
- Name and version of the Library package used: Microsoft.Azure.Management.ContainerRegistry, version 4.0.0
- Hosting platform or OS and .NET runtime version (
dotnet --infooutput for .NET Core projects): [e.g. Azure AppService or Windows 10 .NET Framework 4.8] Windows 10, ASP.Net Core 3.1 - IDE and version : [e.g. Visual Studio 16.3] Visual Studio 16.10.Preview 2
| Author: | kceiw |
|---|---|
| Assignees: | - |
| Labels: |
|
| Milestone: | - |
@HarveyLink please help to check if this issue still exists in the new Track 2 sdk
Hi @kceiw, here is a simple sample of how to get the credential on a container registry in new track 2 Following packages are used in this sample: Azure.ResourceManager.ContainerRegistry
ResourceGroupResource rg = await CreateResourceGroupAsync(Subscription, "testRg", AzureLocation.WestUS); var registryCollection = rg.GetContainerRegistries(); var registryName = Recording.GenerateAssetName("acrregistry"); ContainerRegistryResource registryFromGet = await registryCollection.GetAsync(registryName); ContainerRegistryListCredentialsResult credentials = await registryFromGet.GetCredentialsAsync();
Hi, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!