Setup MongoLabs with Azure for Free

In order to setup MongoLabs for use with Azure, you do need to provide a credit or debit card, but you can set it up and then disable it so your card won’t get charged accidentally.

Within the Azure Portal, go to you account located in the top right:
nd choose “View my bill”.  This will redirect you to another page with your BizSpark subscription listed:
Click the yellow box to change your spending limit (but we really won’t be changing it in the end!):

Choose “Yes, remove the spending limit” and then choose either option from the dropdown.  It doesn’t matter which one, because you’ll cancel out before actually saving this.

Choose “Add payment method” and add a debit/credit card to the account and choose Next to get back to this screen.

Now you should see your credit card listed as a payment method and you can switch back to “No, I do not want to remove the spending limit” and click the checkmark.
At this point, you can return to the Azure Portal and select +NEW -> Marketplace:
Choose MongoLab:
Choose the Sandbox plan and move to next screen:
Once it’s spun around for awhile, you’ll see:
and you can PURCHASE it!

Now you need to get and set the connection string.  Select your MongoLab service in your list:
Choose CONNECTION INFO at the bottom:
And copy the MONGOLAB_URI to your clipboard.

Go to CONFIGURE and scroll down to connection strings and enter in MONGOLAB_URI for the NAME, paste the copied connection string into VALUE and choose Custom from the dropdown.

You are now ready to incorporate your MongoLab database into your code!!

In your code where you define your database connection, replace the old connection with:

That’s all there is to it!

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">