diff --git a/cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go b/cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go index 8177ae6a98d..861bce2d9a3 100644 --- a/cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go +++ b/cli/azd/pkg/infra/provisioning/bicep/bicep_provider.go @@ -74,10 +74,8 @@ type BicepProvider struct { ignoreDeploymentState bool // compileBicepResult is cached to avoid recompiling the same bicep file multiple times in the same azd run. compileBicepMemoryCache *compileBicepResult - // prevent resolving parameters multiple times in the same azd run. - ensureParamsInMemoryCache azure.ArmParameters - keyvaultService keyvault.KeyVaultService - portalUrlBase string + keyvaultService keyvault.KeyVaultService + portalUrlBase string } // Name gets the name of the infra provider @@ -1793,10 +1791,6 @@ func (p *BicepProvider) ensureParameters( ctx context.Context, template azure.ArmTemplate, ) (azure.ArmParameters, error) { - if p.ensureParamsInMemoryCache != nil { - return maps.Clone(p.ensureParamsInMemoryCache), nil - } - parameters, err := p.loadParameters(ctx) if err != nil { return nil, fmt.Errorf("resolving bicep parameters file: %w", err) @@ -1922,19 +1916,15 @@ func (p *BicepProvider) ensureParameters( configuredParameters[key] = azure.ArmParameterValue{ Value: value, } - configuredParameters[prompt.key] = azure.ArmParameterValue{ - Value: value, - } } } } if configModified { if err := p.envManager.Save(ctx, p.env); err != nil { - p.console.Message(ctx, fmt.Sprintf("warning: failed to save configured values: %v", err)) + return nil, fmt.Errorf("saving prompt values: %w", err) } } - p.ensureParamsInMemoryCache = maps.Clone(configuredParameters) return configuredParameters, nil }