Conditional content for certain deployments #6638
Unanswered
dahlsailrunner
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Consider the following lines from an
AppHost
:These add a Postgres database and the
rnwood/smtp4dev
container image (it's likeMailDev
).When I deploy this to Azure Container Apps for an initial testing environment, it would be great to leave it exactly as it is. But for higher environments, and certainly production, I would be using an Azure Postgres Flexible Server, and an actual email service like SendGrid.
I've seen the syntax for
builder.ExecutionContext.IsPublishMode
and could use that for ALL deployments, but I'm wondering if there is guidance or thoughts on how to do this differently for certain deployments.Maybe different
appSettings.<env>.json
values for a setting likeuseAzureFlexiblePostgres
anduseRealEmailService
?Is there a way to determine in publish mode what environment is being used for
azd up
?The best / cleanest thing I've come up with so far is to simply use
azd up
for the early testing deployments, and then for higher environments and production to build my own containers withdotnet publish
and deploy them with the appropriate configuration using traditional means.I've also seen this API proposal for
When()
that might do a good job at this, too.#5192
Appreciate any thoughts. :)
Beta Was this translation helpful? Give feedback.
All reactions