Best way to securely store database connection string for Database Connection of Static Web App #1323
-
Hi! How can we use a configuration/environment file to populate the database connection strings at the CI/CD pipeline step, and thus be able to keep the database connection string secret/not committed to the repo? This was asked previously by @RayMaAU in this discussion comment. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @jacksorjacksor, when you link your database to your Static Web Apps resource with the database connections feature, you specify your secrets to connect to the database. Only your configuration file, not your secrets, need to be stored in your repository. When we make the connection to your database, we use the configuration file provided in your repository and override it with the secrets collected from the Azure Portal/ARM when you create the database connection. |
Beta Was this translation helpful? Give feedback.
-
Thanks @thomasgauvin for that, we'll be able to utilise this approach during deployment. |
Beta Was this translation helpful? Give feedback.
Hi @jacksorjacksor, when you link your database to your Static Web Apps resource with the database connections feature, you specify your secrets to connect to the database. Only your configuration file, not your secrets, need to be stored in your repository. When we make the connection to your database, we use the configuration file provided in your repository and override it with the secrets collected from the Azure Portal/ARM when you create the database connection.