Skip to content

Fix Azure Provisioning#6768

Merged
eerhardt merged 1 commit intomicrosoft:mainfrom
eerhardt:FixProvisioning
Nov 25, 2024
Merged

Fix Azure Provisioning#6768
eerhardt merged 1 commit intomicrosoft:mainfrom
eerhardt:FixProvisioning

Conversation

@eerhardt
Copy link
Copy Markdown
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 (microsoft#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.
@eerhardt eerhardt merged commit c9326c7 into microsoft:main Nov 25, 2024
@eerhardt eerhardt deleted the FixProvisioning branch November 25, 2024 13:43
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 26, 2024
@github-actions github-actions Bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Mar 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants