azure-sdk-for-net icon indicating copy to clipboard operation
azure-sdk-for-net copied to clipboard

[BUG] Casing issue with resource type for WebPubSub

Open dumonjorne opened this issue 2 years ago • 3 comments

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

  1. Create a resourceIdentifier with the WebPubSubResource.CreateResourceIdentifier.
  2. Call the ExistsAsync method on the GenericResourcesCollection class with the created resource identifier as parameter.
  3. 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

dumonjorne avatar Jan 04 '23 10:01 dumonjorne

Thank you for your feedback. Tagging and routing to the team member best able to assist.

jsquire avatar Jan 04 '23 13:01 jsquire

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.

ArcturusZhang avatar Jan 06 '23 06:01 ArcturusZhang

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).

dumonjorne avatar Jan 09 '23 09:01 dumonjorne

Hi @dumonjorne, thanks for your feedback, we have merged this PR, this issue should be fixed after the new ResourceManager is released. Feel free to reopen this issue if you still have problems.

If you have any other feedback to our Azure SDK, feel free to let us know in this survey.

Yao725 avatar Feb 01 '23 06:02 Yao725