While it's possible to paste a MongoLab URI into your code, we recommend configuring it in the environment for ease of management. This way, if the URI changes, you can update it through the Azure Portal without going to the code.
-
In the Azure Portal, select Websites.
-
Click the name of the website in the website list.
The Website Dashboard displays. -
For Name, enter MONGOLAB_URI.
-
For Value, paste the connection string we obtained in the previous section.
-
Select Custom in the Type drop-down list (instead of the default SQLAzure).
Note: Azure adds the CUSTOMCONNSTR_ prefix to this variable, which is why the code above references CUSTOMCONNSTR_MONGOLAB_URI.