Daily Archives: November 6, 2013

Publishing a multiproject solution to Azure

One of the great features of the Windows Azure Websites is that you can directly connect the site to your source control repository. When you change your source code, it will be automatically deployed to the Azure cloud.

It is only a few clicks to set it up, just start the New –> Compute –> Web Site –> Custom create wizard:

multisite-new

Enter a URL for your website and don’t forget to check the Publish from source control checkbox:

multisite-name

This activates the second step of the wizard where you can select your preferred source control provider, for example GitHub:

multisite-where

In case of GitHub you have to authenticate yourself via OAuth, then you can select which repository and which branch you want to publish (master is the default, but you can change that to any branch name!):

multisite-repo

Within a few seconds your website will be up and running, and Azure will start deploying your application to it.

But what if you have a Visual Studio solution which contains multiple web projects or websites, which one will be deployed? The first one.

Well, that’s great for most cases, but sometimes you want to change that behavior.

If you always want to deploy the same project/site to the cloud, you can create a .deployment file in the root of your repo, in which you define which project you want to deploy:

[config]
project = MySolution/MyWebProject.csproj

But if you have multiple Azure websites, you may want to deploy different projects of your solution to them. In this case you cannot hardwire the setting into the repo, instead you have to set on the Azure management portal. Navigate to the CONFIGURE page and scroll down to the app settings section. Create a new setting with the name Project and set the repo-root relative path to the .csproj or the folder of the website as its value:

multisite-appsettings

Just save the setting and voila, next time when you change your source code only the preset project will be deployed to this website.

 

Technorati-címkék: ,,,

Rename your Visual Studio window title

If you often run multiple instances of Visual Studio to edit multiple branches of the same project from different folders, you may find annoying how difficult it is to discover which branch do you currently edit. All instances looks the same on the Windows taskbar:

vs-rename-similar

The Rename Visual Studio Window Title extension may ease your pain by prepending the names of the parent folders into the Visual Studio title bar:

vs-rename-title

Of course the same names appear on the Windows taskbar as well:

vs-rename-taskbar-branches

You can customize the behavior of the extension in the Options dialog:

vs-rename-options

Tiny, but very useful tool.

 

Technorati-címkék: ,