Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 1.45 KB

howto-save-connectioninfo-mongolab.md

File metadata and controls

26 lines (19 loc) · 1.45 KB

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.

  1. In the Azure Portal, select Websites.

  2. Click the name of the website in the website list.
    WebSiteEntry
    The Website Dashboard displays.

  3. Click Configure in the menu bar.
    WebSiteDashboardConfig

  4. Scroll down to the Connection Strings section.
    WebSiteConnectionStrings

  5. For Name, enter MONGOLAB_URI.

  6. For Value, paste the connection string we obtained in the previous section.

  7. Select Custom in the Type drop-down list (instead of the default SQLAzure).

  8. Click Save on the toolbar.
    SaveWebSite

Note: Azure adds the CUSTOMCONNSTR_ prefix to this variable, which is why the code above references CUSTOMCONNSTR_MONGOLAB_URI.