Azure / Azure/azure-dev

Allow specifying build configuration for manifest generation in azd deploy

Open
#5,936 2 comments 2 reactions 0 assignees View on GitHub
area/aspire area/project customer-reported enhancement
Dominant language
Go
Stars
569
Forks
364
Avg merge
2d 19h
Merged PRs (30d)
136

Description

When using the `AzureCLI@2` task in an Azure DevOps release pipeline with the command:
```
azd deploy
```

the output includes:
```
Analyzing Aspire Application (this might take a moment...)
```

As I understand it, this step generates a manifest from the AppHost, via a `dotnet run` invocation such as:
```
dotnet run --project MyProject.AppHost.csproj --publisher manifest --output-path /some/path/manifest.json
```
https://github.com/Azure/azure-dev/blob/5f10d0f76482d8c2d222a3ffd2b06f2c3d461945/cli/azd/pkg/tools/dotnet/dotnet.go#L145

My AppHost project happens to include conditional compilation logic:
```
#if DEBUG
// some customizations
#endif
```

It appears that `azd deploy` runs this manifest generation step using the default (Debug) configuration, causing those sections to be included even in release pipelines.

Would it be possible to support a `--configuration` option (e.g. `azd deploy --configuration Release`), or otherwise delegate a configuration flag to the internal `dotnet run` call used during manifest generation?

This would make it easier to align CI/CD deployments with intended build configurations and avoid manifest mismatches between local and pipeline builds.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.