aspire icon indicating copy to clipboard operation
aspire copied to clipboard

Sanitize bicep indentifiers

Open eerhardt opened this issue 1 year ago • 0 comments

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
  • Does the change make any security assumptions or guarantees?
    • [x] No
  • Does the change require an update in our Aspire docs?
    • [x] No
Microsoft Reviewers: Open in CodeFlow

eerhardt avatar Oct 04 '24 20:10 eerhardt