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

Fix Azure Provisioning #6768

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

eerhardt
Copy link
Member

@eerhardt eerhardt commented Nov 22, 2024

With Refactor Bicep parameter usage (#6683), we changed when "well-known" parameters were added to the AzureBicepResource. Instead of adding them up front in 2 places, we add them during bicep generation (i.e. ConfigureInfrastructure) and then sync the bicep parameters back to Aspire's AzureBicepResource.Parameters.

This broke Azure Provisioning because it is looking for well known parameters before GetBicepTemplateFile is called. It needs to populate the well-known parameters after. You get an error like:

Azure.RequestFailedException: Deployment template validation failed: 'The value for the template parameter 'principalType' at line '1' and column '483' is not provided. Please see https://aka.ms/arm-create-parameter-file for usage details.'.
Status: 400 (Bad Request)

The fix is to move the calls around so PopulateWellKnownParameters is called after GetBicepTemplateFile.

I didn't see a way to test this in CI easily. I ran through it manually and it works now.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • No
  • Did you add public API?
    • No
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?
    • No
Microsoft Reviewers: Open in CodeFlow

With Refactor Bicep parameter usage (dotnet#6683), we changed when "well-known" parameters were added to the AzureBicepResource. Instead of adding them up front in 2 places, we add them during bicep generation (i.e. ConfigureInfrastructure) and then sync the bicep parameters back to Aspire's AzureBicepResource.Parameters.

This broke Azure Provisioning because it is looking for well known parameters before GetBicepTemplateFile is called. It needs to populate the well-known parameters after.

The fix is to move the calls around so PopulateWellKnownParameters is called after GetBicepTemplateFile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants