-
Notifications
You must be signed in to change notification settings - Fork 218
allow user to disable provision preflight #4947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There is something good about adding a grouping command like you did here with However, I don't think we need it. IMO, in this case we only need to support something like |
This is where my head is at, but I'm currently curious if we want to make this project-specific for now, something like:
My current observation is that this might be a very specific scenario based on this write-up here I'd still love for validate to be on by default, and basically make this a troubleshooting step until we hear more feedback otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small note on wording, I believe the more widely used term is "opt/opted/opting out" as a verb or "opt-out" as an adjective or noun
Chatted with @rajeshkamal5050. We will hold this PR in the backlog. |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash:
pwsh:
WindowsPowerShell install
MSI install
Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
) | ||
if err != nil { | ||
return nil, err | ||
if strings.ToLower(p.env.Getenv(environment.DisablePreflightName)) != "true" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.Getenv()
falls back to check the system environment (not only the values from azd's .env file)
Do we want to make it only for azd's .env file?
In the warningMessage
below we are telling folks they can run azd env set XXXXX false
or remove the value from the .env; If the env var is set on system environment, should we re-word the error?
@@ -46,6 +46,9 @@ const ResourceGroupEnvVarName = "AZURE_RESOURCE_GROUP" | |||
// PlatformTypeEnvVarName is the name of the key used to store the current azd platform type | |||
const PlatformTypeEnvVarName = "AZD_PLATFORM_TYPE" | |||
|
|||
// DisablePreflightName is used to allow users to skip the preflight validation check | |||
const DisablePreflightName = "AZURE_PROVISION_SKIP_VALIDATE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding this env var to: https://github.com/Azure/azure-dev/blob/main/cli/azd/docs/environment-variables.md
Current method (set .env):

During the discussion on Monday, we went through three methods including set config, set .env, or add flag. It is clear to me that set config is not the way we want as this lets users to completely disable Preflight in all scenarios. We want the disabled functionality to be more project specific. I thought about the trades off between set .env vs add flag and discussed with @weikanglim. Considering our use case, we prefer to be environment/project-specific and speaks the same language that template authors want to speak to users. I believe set .env method is what we are looking for.
If disable:
allow user to disable it when an error is blocking:

Previous method (set config):
I used the similar logic of alpha feature and added option out feature so that we could use it to option out other features in future. If folks think it is duplication of alpha feature, happy to migrate it under alpha feature support or just directly support config.
After gathering folks feedback, update the method to directly support config:

Migrate to use
azd config set provision.disableValidation on
. Usevalidation
since preflight is an internal word.If disable, run provision directly:
Allow user to disable it when an error is blocking:
