Monthly Archives: May 2013
I’ve been developing a WCF Data Service and it was working great on my local machine. (How many times have you said that?) With the trickiest parts of the service in place, I thought I’d push it up to an Azure web site and get it working there. Unfortunately, I was getting the following error after publishing my service.
After troubleshooting for about an hour, I finally found a really helpful blog post describing the exact problem here. It appears the primary issue is that the .svc file contains a hard-coded reference to version 220.127.116.11 of Microsoft.Data.Services. Like any good blog post, it also contains a couple of solutions. I simply removed the reference to any version number and it worked like a charm – both locally and in Azure!
Now, I’m gonna push my Code-First Migrations to SQL Azure. Wish me luck!
First, let me say I love what they have done with the Windows Azure user interface on the web. (You can see it here.) The UI is easy to get around, the animations are helpful, etc. Unfortunately, it’s all in the browser and not in my IDE. This means I have to leave my IDE on occasion to do things like publish my app and confirm the names of sites, services, databases, etc.
But times are a changin’! On April 30th, Microsoft released the Windows Azure SDK 2.0 for .NET. This SDK includes enhancements to Visual Studio that provide integration between the IDE and the Azure management services. In this blog post, I’m going to focus on the publishing to Azure features, but there are other features enabled with this SDK that you can read a little more about on Scott Guthrie’s blog post here.
As I have in the past, I’m going to start by right-clicking my web project and selecting Publish… from the context menu.
Again, as before, the Publish Web dialog appears and we’ll click the Import… button to open the Publish Profile dialog.
I used to download my Azure publish profile from the management portal and keep that file in my Visual Studio project, so I could re-use it if I needed to and share it with my team. I would then import it using this dialog. Here comes the new part! Rather than browsing to the file, I’m going to select the first radio button, labeled Import from a Windows Azure web site, and click the Add Windows Azure subscription hyperlink.
The Import Windows Azure Subscriptions dialog appears. We need to download our subscription details, so click Download subscription file to get the .publishsettings file from the portal. This is the only time you’ll need to return to the Azure portal. This settings file includes all of the information about our Azure subscription – not just a single web site’s publish settings. We’ll then return to the Import Windows Azure Subscriptions dialog and browse out to the location of the file we downloaded. Click the Import button to continue.
Returning to the Import Publish Profile dialog, you should be able to select from your existing Azure web sites from the drop down list. Click OK to return to the Publish Web dialog. The publish settings will auto-populate the Connection tab (which is way better than trying to enter/re-enter all of this stuff yourself). If you’d like, you can click Validate Connection to ensure everything is correct.
The rest of the publish process remains unchanged. After clicking the Publish or Close buttons, you will be prompted to save all of your publish settings and if you choose to do so, they will be added to your Visual Studio project under Properties | PublishProfiles.
Now that I’ve published my application, I should probably check on its status. By opening Server Explorer in Visual Studio, you can now see your Azure subscription services. By expanding the Windows Azure Web Sites node, I can see that my teamsystemcafeservices site is running.
There are several useful options available if you right-click your web site. I can start and stop the web site and stream logs to my output window.
Of course, I can save myself the trip out to the management portal again by selecting View Settings and configure my web site right within the IDE.
There are several other features in the new Azure SDK, so check ’em out!