Skip to content
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

support nullable params #4722

Merged
merged 2 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cli/azd/pkg/azure/arm_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ type ArmTemplateParameterDefinition struct {
Ref string `json:"$ref"`
Properties ArmTemplateParameterDefinitions `json:"properties,omitempty"`
AdditionalProperties *ArmTemplateParameterAdditionalPropertiesValue `json:"additionalProperties,omitempty"`
Nullable *bool `json:"nullable,omitempty"`
}

func (d *ArmTemplateParameterDefinition) Secure() bool {
Expand Down
5 changes: 5 additions & 0 deletions cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,11 @@ func (p *BicepProvider) ensureParameters(
continue
}

if param.Nullable != nil && *param.Nullable {
// If the parameter is nullable, we can skip prompting for it.
continue
}

// This required parameter was not in parameters file - see if we stored a value in config from an earlier
// prompt and if so use it.
configKey := fmt.Sprintf("infra.parameters.%s", key)
Expand Down

Large diffs are not rendered by default.

3,817 changes: 814 additions & 3,003 deletions cli/azd/test/functional/testdata/recordings/Test_CLI_ProvisionState.yaml

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ param secureValue string
@secure()
param secureObject object = {}

// tests should not prompt for this parameter
param nullableParam string?
output nullableParamOutput string? = nullableParam

var tags = {
'azd-env-name': environmentName
DeleteAfter: deleteAfterTime
Expand Down
Loading