Utilizing Connection Strings in PHP in this case for App Service – In this case, source code is Deployed in UAT and Production, Both have different connection strings. So that pipeline is deployed smoothly without any manual changes. Like my UAT will apply UAT DB Connection String, and Production will apply the Production Connection string for the same Codebase.
As you can see am adding this MYSQLCONNSTR_ suffix for my connection string as its MYSQL, you can update the suffix accordingly. Application settings don’t need any suffixes.
At runtime, connection strings are available as environment variables, prefixed with the following connection types:
- SQLServer: SQLCONNSTR_
- MySQL: MYSQLCONNSTR_
- SQLAzure: SQLAZURECONNSTR_
- Custom: CUSTOMCONNSTR_
- PostgreSQL: POSTGRESQLCONNSTR_
Utilizing Application Settings inside JSON in Azure Static Web Apps