It’s been a wild ride for the Developer Movement this year, and it’s slowly coming to an end. We’ve just seen #devMania come and go, and hopefully you managed to get your apps in for a lot of points.
If you’re like me, you’ve gotten a lot of points, but you’re still just a bit short. Maybe you joined late, or maybe you’re just going for those last few points, but your big prize is just out of reach. If that’s the case, the mini challenges and final few app submissions mean a lot. Well, I thought I’d help you bypass a pitfall I hit with this month’s Mini Azure challenge and DocumentDB.
If you go to this page, you’ll find a tutorial for getting DocumentDB up and running on Azure (free trial is very important as is using the preview portal). Now, what you’ll want to do is launch Visual Studio and create a new Console Application.
Next, at the bottom of the tutorial you’ll find a link to a GitHub project with the code for this tutorial. If you’re like me, that code won’t run (NuGet error for getting the packages). Don’t worry. That’s why we created the Console Application.
Open the Program.cs files in your application and the downloaded one. Copy the contents from the downloaded file to your file (watch out for the namespace!). Next, you’ll need to import a package.
Open Tools > NuGet Package Manager > Package Manager Console, like in this screen-shot.
In the console, paste the following:
Install-Package Microsoft.Azure.Documents.Client -Pre
You’ll want to make sure your using statements match the following:
using System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Azure.Documents; using Microsoft.Azure.Documents.Client; using Microsoft.Azure.Documents.Linq; using Newtonsoft.Json;
Next, replace the string values for EndpointUrl and AuthorizationKey with the URL and Primary Key values as you see in the tutorial. Run it, grab a screen-shot, and submit for your points!