azure-sdk-for-net
azure-sdk-for-net copied to clipboard
[BUG] Casing issue with resource type for WebPubSub
Library name and version
Azure.ResourceManager.WebPubSub 1.0.0
Describe the bug
In WebPubSubResource.cs there is a casing issue in the CreateResourceIdentifier method: https://github.com/Azure/azure-sdk-for-net/blob/46e35d95f8bfdd1dfa38fa7359ad389118607086/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/WebPubSubResource.cs#L33
and in the ResourceType assignment: https://github.com/Azure/azure-sdk-for-net/blob/46e35d95f8bfdd1dfa38fa7359ad389118607086/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/WebPubSubResource.cs#L73
webPubSub should be WebPubSub.
The same issue is present in the WebPubSubHubResource.cs file:
https://github.com/Azure/azure-sdk-for-net/blob/46e35d95f8bfdd1dfa38fa7359ad389118607086/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/WebPubSubHubResource.cs#L30 https://github.com/Azure/azure-sdk-for-net/blob/46e35d95f8bfdd1dfa38fa7359ad389118607086/sdk/webpubsub/Azure.ResourceManager.WebPubSub/src/Generated/WebPubSubHubResource.cs#L66
Expected behavior
I can build a valid ResourceIdentifier for WebPubSub resources.
Actual behavior
When I build a ResourceIdentifier Using the WebPubSubResource.CreateResourceIdentifier method, it is invalid.
Reproduction Steps
- Create a resourceIdentifier with the WebPubSubResource.CreateResourceIdentifier.
- Call the ExistsAsync method on the GenericResourcesCollection class with the created resource identifier as parameter.
- Get an InvalidOperationException with message: "Invalid resource type Microsoft.SignalRService/webPubSub".
When you build your own resource identifier with replacing "webPubSub" by "WebPubSub", it will work.
Environment
No response
Thank you for your feedback. Tagging and routing to the team member best able to assist.
Hi @dumonjorne could you please share some more information about the exception you have met here?
InvalidOperationException with message: "Invalid resource type Microsoft.SignalRService/webPubSub".
Could you please share the stack trace of this? It is also a solution that we could make the matching of resource types case insensitive, because the root cause of this issue is actually some inconsistent information the service has registered for that specific resource.
Hi,
Below is the stacktrace.
at Azure.ResourceManager.Resources.ResourceProviderCollection.<GetApiVersionAsync>d__3.MoveNext() at Azure.ResourceManager.Resources.GenericResourceCollection.<GetApiVersionAsync>d__12.MoveNext() at Azure.ResourceManager.Resources.GenericResourceCollection.<ExistsAsync>d__10.MoveNext() at Dlw.Platina.DevOps.Provision.AbstractResourceTemplate`3.<ExistsAsync>d__21.MoveNext() in
It seems that this is a known issue with an open pr:
- https://github.com/Azure/azure-sdk-for-net/issues/27819
- https://github.com/Azure/azure-sdk-for-net/pull/33196
I noticed the same behavior with App Service Plans (Microsoft.Web/serverfarms instead of Microsoft.Web/serverFarms).