-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ import ( | |
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" | ||
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to" | ||
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices" | ||
"github.com/azure/azure-dev/cli/azd/internal" | ||
"github.com/azure/azure-dev/cli/azd/pkg/account" | ||
"github.com/azure/azure-dev/cli/azd/pkg/async" | ||
"github.com/azure/azure-dev/cli/azd/pkg/azapi" | ||
|
@@ -611,16 +612,27 @@ func (p *BicepProvider) Deploy(ctx context.Context) (*provisioning.DeployResult, | |
return nil, err | ||
} | ||
|
||
err = p.validatePreflight( | ||
ctx, | ||
bicepDeploymentData.Target, | ||
bicepDeploymentData.CompiledBicep.RawArmTemplate, | ||
bicepDeploymentData.CompiledBicep.Parameters, | ||
deploymentTags, | ||
optionsMap, | ||
) | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more.
Do we want to make it only for azd's .env file? In the |
||
err = p.validatePreflight( | ||
ctx, | ||
bicepDeploymentData.Target, | ||
bicepDeploymentData.CompiledBicep.RawArmTemplate, | ||
bicepDeploymentData.CompiledBicep.Parameters, | ||
deploymentTags, | ||
optionsMap, | ||
) | ||
if err != nil { | ||
return nil, &internal.ErrorWithSuggestion{ | ||
Err: err, | ||
Suggestion: fmt.Sprintf("To skip provision validation, please run %s.", | ||
output.WithHighLightFormat("`azd env set %s true`", environment.DisablePreflightName)), | ||
} | ||
} | ||
} else { | ||
warningMessage := fmt.Sprintf("WARNING: Provision validation is skipped. "+ | ||
"To enable it, please run `azd env set %s false` or remove %s from your .env file.\n", | ||
environment.DisablePreflightName, environment.DisablePreflightName) | ||
p.console.Message(ctx, output.WithWarningFormat(warningMessage)) | ||
} | ||
|
||
cancelProgress := make(chan bool) | ||
|
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