question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] AppPlatformService invokes `AddTagAsync` method will throw InvalidOperationException error

See original GitHub issue

Library name and version

Azure.ResourceManager.AppPlatform 1.1.0-beta.2

Describe the bug

When I call AddTagAsync() method to update the tags of an AppPlatform service, the server returns an HTTP status code of 202. 202 is not a final state in the SDK, so it continues to request the location in the ResponseHeaders. However, the final request URI in the returned 200 is

GET /subscriptions/**/resourceGroups/**/providers/Microsoft.AppPlatform/locations/eastus/operationResults/**/Spring/**?api-version=2022-12-01 HTTP/1.1
(id=/subscriptions/**/resourceGroups/**/providers/Microsoft.AppPlatform/Spring/**)

instead of the initial

PUT /subscriptions/**/resourceGroups/**/providers/Microsoft.AppPlatform/Spring/**/providers/Microsoft.Resources/tags/default?api-version=2022-09-01
(id=/subscriptions/**/resourceGroups/**/providers/Microsoft.AppPlatform/Spring/**/providers/Microsoft.Resources/tags/default)

which will cause an error in ValidateResourceId(): System.ArgumentException: Invalid resource type Microsoft.AppPlatform/Spring expected Microsoft.Resources/tags (Parameter ‘id’).

Expected behavior

service’s tags updated and SDK doesn’t throw exception

Actual behavior

service’s tags updated and SDK throws exception

Reproduction Steps

  1. Add Azure.ResourceManager to project dependency
  2. Add Azure.ResourceManager.AppPlatform to project dependency or install Azure.ResourceManager.AppPlatform 1.1.0-beta.2
TokenCredential cred = new DefaultAzureCredential();
ArmClient client = new ArmClient(cred);
var rg  = await client.GetDefaultSubscription().GetResourceGroups().GetAsync("rgName");
AppPlatformServiceResource service = await rg.Value.GetAppPlatformServices().GetAsync("AzureSpringAppServiceName");
_ = await service.AddTagAsync("newkey","value");

Environment

No response

Issue Analytics

  • State:open
  • Created 2 months ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
jsquirecommented, Jul 25, 2023

@ArthurMa1978 : Given that the service teams do not monitor our repository, can we engage with them via IcM, Azure support request, or another process rather than leave this issue open?

0reactions
live1206commented, Aug 7, 2023

Thanks to @weidongxu-microsoft, this scenario is written in 202-accepted-and-location-headers.

If the operation is complete, return the exact same response that would have been returned had the operation been executed synchronously.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Chengming dvbb
Day of Week July Jul July Jul Sunday Sun No contributions on Sunday, July 24, 2022 No contributions on Sunday, July... Monday Mon No contributions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found