Skip to content

Document how to use AzureProvisioningOptions and InfrastructureResolvers to modify bicep #3857

@eerhardt

Description

@eerhardt

Type of issue

Missing information

Description

We should have a section in the Azure docs that explain how to customize bicep by using an "InfrastructureResolver".

Here's one such example that is working around a bug in our SQL deployment script: dotnet/aspire#9926 (comment).

Another example, which doesn't give a code example: https://learn.microsoft.com/en-us/dotnet/aspire/compatibility/9.0/provisioning-context

The key information is:

  1. Create a class that derives from InfrastructureResolver and implements the necessary customization. I'm not sure if there is a better link, but https://learn.microsoft.com/en-us/dotnet/api/azure.provisioning.primitives.infrastructureresolver describes the class.
  2. On the DistributedApplicationBuilder, configure the AzureProvisioningOptions to add the class from (1):
builder.Services.Configure<AzureProvisioningOptions>(options =>
{
    options.ProvisioningBuildOptions.InfrastructureResolvers.Add(new MyInfrastructureResolver());
});

Page URL

https://learn.microsoft.com/en-us/dotnet/aspire/azure/integrations-overview?tabs=dotnet-cli

Content source URL

https://github.com/dotnet/docs-aspire/blob/main/docs/azure/integrations-overview.md

Document Version Independent Id

9949dba9-a268-b3ff-b62f-ca07429281c1

Platform Id

752b5bf5-8119-0db7-55a6-e656fca0b438

Article author

@IEvangelist

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions