- Support for Multiple Service Configurations
- Profiling support for Windows Azure apps running in Windows Azure
- MVC 3 web role support
- Package validation

Multiple Service Configurations
- local debug you may want to:
- utilize 1 instance of your web/worker role
- use the local storage emulator
- whereas in Windows Azure you may want to:
- utilize 4 instances of your web/worker role
- use a production Windows Azure storage account
- Create a new Windows Azure project with an arbitrary web or worker role.
- File > New Project > Cloud > Windows Azure Project
- Select a web or worker role and press OK
- Observe that the ServiceConfiguration.cscfg is now split by default into two files:
- ServiceConfiguration.Local.cscfg – default used when debugging in VS
- ServiceConfiguration.Cloud.cscfg – a config you can use on publish
- To configure each individual configuration with the settings we desired above.
- You can then repeat the above for your Local configuration profile to setup and set the desired settings for ServiceConfiguration.Local.cscfg
- The net result is that both ServiceConfiguration.Cloud.cscfg and ServiceConfiguration.Local.cscfg will now have their independent settings as follows:
- When you hit debug now the ServiceConfiguration.Local.cscfg is used and when you hit publish you can select which Config you would like to use:
Overall its quite an easy experience to configure and use multiple Service Configuration profiles for your different environments. Please note that you can also rename and add additional Service Configuration profiles perhaps such that you would have a config for Local, Staging and Prod. For more detail on how to work with Service Configuration files please see Configuring a Windows Azure Application.
Profiling Support
- CPU Sampling – Monitor CPU-bound applications with low overhead
- Instrumentation – Measure function call counts and timing
- .NET Memory Allocation (Sampling) – Track managed memory allocation
- Concurrency -Detect threads waiting for other threads
- Open your existing cloud project and right click on the windows azure cloud project and select Publish
- Select the Enable profiling option on the publish page and click settings
- Select the type of profiling you wish to perform in this case .NET Memory Allocation
- Note: Checking the Enable Tier Interaction Profiling option captures additional information about execution times of synchronous ADO.NET calls in functions of multi-tiered applications that communicate with one or more databases. With the absence of a SQL Profiler in SQL Azure this feature is useful for those developers who want to gain some insight into what queries or stored procedures are running slowly.
- Press OK.
- Once the deployment is complete and the application has been running for a period of time you can go and download the captured profiling report.
- To download the profiling report
- Once the report is downloaded it will open in VS and as you can see the CPU is maxing out
- If we change the Current View dropdown to Allocation we can quickly identy a problem method that is using excessive amounts of memory
- and finally if we right click and select View Source on the method of interest we can see the offending line causing the allocations
MVC 3 Web Role Support
ASP .NET MVC 3 web roles are now supported out of the box with the new tools. You can select ASP .NET MVC 3 from the new Windows Azure project dialog and the required assemblies used by ASP .NET MVC 3 are set to copy local for you. This results in these assemblies being deployed up to windows azure when you publish your application thus ensuring your MVC 3 application will start when deployed. I know a lot of you are probably thinking Eureka right now and those that may get a little bit too excited may even verbalize it, I know I did
To create a new Windows Azure ASP .NET MVC 3 application:
- File > New Project > Cloud > Windows Azure Project
- Select ASP .NET MVC 3 Web Role, press the > button followed by OK
- In the ASP .NET MVC 3 project dialog select settings to suit your preferences and press ok
- In solution explorer observe that all the references assemblies for ASP .NET MVC 3 that are not in the GAC in the current Windows Azure gues OS have had their Copy Local property set to true. The below image shows and example of one of the required reference assemblies that is automatically set to copy local so you dont actually have to do anything
From here on in all you have to do is start coding – For more information on ASP .NET MVC 3 see this and for a detailed walkthrough of ASP .NET MVC 3 on Windows Azure see this post by Nathan Totten
Package Validation
Last but definitely not least is improved package validation. When you select to create a package or publish your Windows Azure application. Additional warnings or errors are now provided in VS to enable you to fix the problem before you package or publish it. This as you know will be a great timesaver for details of what package validations are performed please see Troubleshooting Package Validation Errors and Warnings
Time to Download
All in all its an excellent new set of features that focus on improving your productivity and make your dev life a whole lot easier. If you have not already then now would be the time to download using Web Platform Installer
happy coding,
Nick