Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.35k stars 4.71k forks source link

[BUG] Misspelled hard-coded path to AGW WAF resource #44443

Open nordvall opened 3 months ago

nordvall commented 3 months ago

Library name and version

Azure.ResourceManager.Network 1.7.0.0

Describe the bug

I am using ArmClient to retrieve the following resource:

https://management.azure.com/subscriptions/xxx/providers/Microsoft.Network/locations/westeurope/applicationGatewayWafDynamicManifests/default

After some searching I found a method in the Azure.ResourceManager.Network package to do that: GetApplicationGatewayWafDynamicManifestResource

Expected behavior

I expect to receive the same data as if I was using a simple REST client to get the url mentioned above.

Actual behavior

When I invoke that method I receive an exception that the resource was not found (!?)

After some investigation I concluded that while intention is to retrieve a resource called "default", in the source code it is mis-spelled as "dafault". You can do a search for "dafault" in this repo and you'll see.

Therefore I was not able to retrieve the data I need via the package mentioned.

As I workaround I have built a HttpPipelinePolicy that alters the URL on-the-fly. Not so pretty...

Reproduction Steps

using Azure.ResourceManager.Network;

var armClient = new ArmClient(new DefaultAzureCredential());
ResourceIdentifier wafPolicyResourceId = ApplicationGatewayWafDynamicManifestResource.CreateResourceIdentifier(subscriptionId.ToString(), AzureLocation.WestEurope);
Response<ApplicationGatewayWafDynamicManifestResource> wafPoliciesManifestResource = await armClient.GetApplicationGatewayWafDynamicManifestResource(wafPolicyResourceId).GetAsync();

Environment

No response

github-actions[bot] commented 3 months ago

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

HarveyLink commented 3 months ago

Hi @nordvall , our SDK is auto generated, this is a swagger issue. Opened one issue to track the fix: https://github.com/Azure/azure-rest-api-specs/issues/29460

nordvall commented 3 months ago

@HarveyLink thank you for reporting the issue in the correct repo.