aspire: Support Azure Functions Prototype #4252
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Aspire team has started to prototype Azure Functions support and this PR is the start of the support in
azd
for this deployment target under Aspire.In the current prototype, Aspire models this as a new
function.v0
resource type, whichazd
has special knowledge of. We need to do two special things with this resource type:When generating IaC for the project, we need to generate IaC that allows us to use the Functions on ACA feature (where we can create a
Microsoft.Web/sites
resource with correct configuration to run a functions app on an existing container app environment)Since function projects do not support using
dotnet publish
to produce a container image (there is work in flight to support this), we require aDockerfile
at the root of the project, which wedocker build
.In the next phase of the prototype, we will replace
function.v0
withproject.v0
, so thefunction.v0
manifest type will not live forever, but until,dotnet run
anddotnet publish
works as expected for Azure Functions projects, we'll continue to model this as its own type in the manifest.Note that there are still a lot of rough edges here... The initial
azd up
works if you ensure your function app name in the app host is unique across all ofazure
but future updates seem to hang. Also, none of the corresponding aspire support is in tree yet, so this is not something that anyone can just pick up and use right now, but I want to get the work out from behind our-pr
repository and rebased on top of the latest main as we are starting to pick up steam on this work.