Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow 'web' as a hard coded resource name #4489

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

theunrepentantgeek
Copy link
Member

@theunrepentantgeek theunrepentantgeek commented Dec 6, 2024

What this PR does

Some services hardcode names into their URLs, such as default here:

blobService/default/containers/{containerName}

When we construct the resource type identifier for those resources, we don't want to include those - for this example, we want blobService/containers not blobService/default/containers.

While importing Microsoft.Web/sites/sourcecontrols Nishant Shekhar encountered this error:

could not create fully qualified ARM ID, had 2 azureNames and 3 resourceTypes. 
azureNames: ["aso-sample-function" "web"] 
resourceTypes: ["sites" "sourcecontrols" "web"]

which I traced down to the presence of the hard coded name web in this URL:

/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web

I've refactored the code to allow for web as a hard coded name in addition to default, and to raise an error should another form of hard coded name be encountered.

Special notes

I combined several existing tests into a single table test.

How does this PR make you feel?

gif

Checklist

  • this PR contains tests

@theunrepentantgeek theunrepentantgeek added this pull request to the merge queue Dec 6, 2024
Merged via the queue into main with commit f98e00d Dec 6, 2024
7 checks passed
@theunrepentantgeek theunrepentantgeek deleted the fix/hard-coded-resource-names branch December 6, 2024 04:12
@theunrepentantgeek theunrepentantgeek added this to the v2.12.0 milestone Dec 10, 2024
@theunrepentantgeek theunrepentantgeek self-assigned this Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready for Release
Development

Successfully merging this pull request may close these issues.

3 participants