Azure / Azure/azure-dev

Hooks ordering dilemma for azd up

Open
#5,806 0 comments 1 reaction 0 assignees View on GitHub
area/hooks enhancement
Dominant language
Go
Stars
569
Forks
364
Avg merge
2d 19h
Merged PRs (30d)
136

Description

For a template using a preprovision hook to automatically feed the azd env for provisioning, `azd up` result incompatible because `azd up` starts by compiling infrastructure and ensuring prompting for required parameters before moving to the first step of the workflow.

The default workflow for azd up is: [azd package, azd provision, azd deploy].
Without `azd up` not starting by compiling and prompting for parameters, users would have to wait until after `azd package` to see the prompting, which might result unexpected.

But for a template depending on a preprovision hook to automatically load parameters to env, running `azd up` makes azd prompt to trigger before the preprovision hook.

The only alternative for templates like this is to avoid using `azd up` and only work with `azd provision`

Notes:
- Even defining `azd up` workflow as [azd provision], `azd up` would start by compiling/prompting as part of the bootstrap before calling any hooks.

Template example: https://github.com/AzureCosmosDB/fabric-keyvault-openai-secrets/blob/main/azure.yaml

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.