It is actually pretty simple to override the connection settings in Azure. If you manage your connection inside the appsettings.json
:
1 2 3 4 |
"MongoConnection": { "ConnectionString": "mongodb://admin:abc123!@localhost", "Database": "YourDb" } |
Then in Azure you should define these in Application Settings -> App settings. Seperate the layers by ":" (semi-colon). For example:
Key: MongoConnection:ConnectionString
Value: mongodb://admin:abc123!@localhost
. Similarly, the database (key) MongoConnection:Database
value: YourDb