A co-worker sent around this post from Iris Classon explaining how to set up continuous deployment in Azure. She used Visual Studio Online and Team Foundation Server. I spent about two hours this morning doing it with Visual Studio 2013 and Bitbucket. There are a couple of gotchas the way I did it:
- First, I made a mistake, and started with the Visual Studio 2012 MVC template. There's actually a VS2013 MVC template that has better authentication features, but, well, sometimes you miss things, right?
- Because of this, I had to add the ASP.NET Universal Providers 2.0 package from NuGet.
- Jumping to the end, it also means I had to copy WebMatrix.Data.dll directly into the deployed Web site by FTP. It didn't get deployed through Git.
- When I created a new Web database using the Azure portal quick-create, no amount of convincing could persuade the portal to create the database in the North Central U.S. data center just outside Chicago. Instead, it created the thing in Southeast Asia. Since the Web site was in Chicago, this was inconvenient. I wound up just adding a new database to an existing Azure server.
- The ASP.NET universal providers required create table permissions when the application started, to create the app's membership tables. Since I had created the database on an existing server, this required me to add the application user account to the database owners role for a moment, which I don't like doing. Oh, and because it was a new database, I had to grant select, insert, update, and delete permissions to the application user account manually.
The app is pretty simple, and may not last long in its current incarnation. If you're really curious you can see it here.
The app, however, isn't the point; continuous deployment is. And I found, once I got it running, that pushing changes to the site's repository in Bitbucket updated the site transparently.
I'll play with this a little more when I have time.