[BUG] AppPlatformService invokes `AddTagAsync` method will throw InvalidOperationException error
See original GitHub issueLibrary 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
- Add
Azure.ResourceManager
to project dependency - Add
Azure.ResourceManager.AppPlatform
to project dependency or installAzure.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:
- Created 2 months ago
- Comments:5 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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?
Thanks to @weidongxu-microsoft, this scenario is written in 202-accepted-and-location-headers.