Azure-Samples / contoso-real-estate

Intelligent enterprise-grade reference architecture for JavaScript, featuring OpenAI integration, Azure Developer CLI template and Playwright tests.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Chore] Fix `azd provision` to honor stripe as optional.

diberry opened this issue · comments

How do I provision in such as way that Stripe is optional? Without it, the provision fails.

(x) Failed: Container App: ca-stripe-vyc7ius4wwiya

ERROR: deployment failed: failing invoking action 'provision', error deploying infrastructure: deploying to subscription:

Deployment Error Details:
InvalidParameterValueInContainerTemplate: The following field(s) are either invalid or missing. Field 'configuration.secrets' is invalid with details: 'Invalid value: "stripe-public-key": Secret value and keyvaulturl cant be empty at same time'; Field 'configuration.secrets' is invalid with details: 'Invalid value: "stripe-secret-key": Secret value and keyvaulturl cant be empty at same time'; Field 'configuration.secrets' is invalid with details: 'Invalid value: "stripe-webhook": Secret value and keyvaulturl cant be empty at same time';.

TraceID: ec1ed82715e7823765e73d38564a974a

One option to fix this issue is to update the Bicep template to avoid creating secrets if the env variables aren't set.

From @sinedied:

[10:49 AM] Yohan Lasorsa
AFAIK, azd uses current exported env variables for deployment, and some of these values are used as parameters for the Bicep templates

This fix as merged into main worked for me. Thank you.