I’ve put off upgrading my current project’s Web & Worker Roles from v2.5 of the Azure SDK for .Net to v2.7, thinking it would introduce a large number of breaking changes. But, with a little project downtime, I decided to bite the bullet and was surprised at just how painless the whole process was.
In this blogpost I’ll therefore talk you through the process of upgrading your existing Azure Web & Worker Roles to the latest version of the Azure SDK for .Net.
Download v2.7 of the Azure SDK for .Net
Grab a copy of the SDK from the Microsoft Downloads page and while its downloading, take a look at the Release Notes for this version of the SDK – there isn’t anything specifically relating to Cloud Services / Web & Worker Roles, but I can assure you that the Azure Compute Emulator is MUCH faster and FEELS more stable.
Once the SDK is downloaded, run the Web Platform Installer – this version of the SDK will live quite happily alongside previous versions, but you will need to shutdown any open instances of Visual Studio.
Upgrading (Web & Worker Role) Cloud Service Projects to Azure SDK for .Net v2.7
Once you have the latest version of the SDK installed, upgrading your existing Cloud Service projects is really simple:
Before you upgrade, I would suggest that you check-in or shelve any pending changes you may have as lots of changes will be made to your Cloud Services and supporting Class Library projects – you don’t want to be muddling these changes up with your own changes!
1. Right-click the Cloud Service you want to upgrade and select ‘[Project] Properties’, or press Alt+Enter
2. On the Project Properties page, you will see that you can upgrade the project to the latest version of the SDK – click the ‘Upgrade’ button:
Your project will be automagically upgraded, along with assembly references in your supporting Worker Role Class Library. Project Properties will also show that you’re running against the latest version of the SDK:
One point to note is that your ServiceDefinition.csdef, ServiceConfiguration.Local.cscfg and ServiceConfiguration.Cloud.cscfg will be updated:
The change is minor, but important – the schemaVersion attribute on the ServiceDefinition element of the Xml configuration file will change from version ‘2014-06.2.4‘ to version ‘2015-04.2.6‘ as you can see in this comparison screenshot:
The reason that I’m bringing this to your attention is that if you have external environment specific Service Configuration files that were originally based on these files (we have separate DEV, SIT, TRG, UAT and PRD versions in source control), you will also need to update the schemaVersion attribute in these config files. If you don’t, subsequently Cloud Service deployments will fail.
3. Build your Cloud Services project and deploy to Azure as usual.
4. Happy PaaS-ing!