aspire
aspire copied to clipboard
Sanitize bicep indentifiers
Description
When we create resources in bicep, we need to ensure the identifier name we use is valid. One common complication is that Aspire resources only allow letters, numbers and a hyphen. But bicep doesn't allow hyphen, but instead an underscore.
Add a new convenience API to get a bicep identifier from an IAzureResource.
Fix https://github.com/dotnet/aspire/issues/6074
Checklist
- Is this feature complete?
- [x] Yes. Ready to ship.
- Are you including unit tests for the changes and scenario tests if relevant?
- [x] Yes
- Did you add public API?
- [x] Yes
- If yes, did you have an API Review for it?
- [x] No
- Did you add
<remarks />and<code />elements on your triple slash comments?- [x] No
- If yes, did you have an API Review for it?
- [x] Yes
- Does the change make any security assumptions or guarantees?
- [x] No
- Does the change require an update in our Aspire docs?
- [x] No