New Azure Mobile Services Samples

Hi Folks,

I have to say that I’m really impressed by the rate at which the Windows Azure Mobile Services team is rolling out updates and samples. In particular, it’s good to see a new sample for using Geolocation, given how common a requirement that is in mobile apps today. It’s worth checking out the following:

·         New Code Samples page on

·         Updated Tutorials and Resources page that includes new tutorials and related videos from the new Windows Azure Mobile Services channel 9 series

·         A bunch of new Windows Store + Mobile Services scenario-based samples:

o    Geolocation sample end to end using Windows Azure Mobile Services

o    Enqueue and Dequeue messages with Windows Azure Mobile Services and Services Bus

o    Capture, Store and Email app Feedback using Windows Azure Mobile Services

o    Upload File to Windows Azure Blob Storage using Windows Azure Mobile Services

o    Create a Game Leaderboard using Windows Azure Mobile Services


How full is my Windows Azure SQL Database?

While the level of compatibility of Windows Azure SQL Databases is high, there are a number of things that need to be dealt with differently, compared with how they are done with on-premises SQL Server.

An example of this, today I needed to know how full one of my databases was. I wanted to know how much space I had used but also to know what the limit was. My first attempt was the usual system views such as:

SELECT * FROM sys.database_files;

But in the Azure environment, that returns:

Msg 208, Level 16, State 1, Line 1
Invalid object name 'sys.database_files'.

So that wasn't going to help. I had also tried the new sys.resource_stats and sys.resource_usage views also to no avail. There is a good article that provides details of which views do and don't work on which versions here. Conor Cunningham also posted early last year about how some of these are supposed to work. (For more info on Conor and Windows Azure SQL Database in general, see the podcast that I recorded with him recently).

Michael Wood pointed me to a post from Ryan Dunn that showed how to get the used size in total, and for each database object. (For more info on Ryan, see the SQL Down Under podcast that I recorded with him back when SQL Data Services first appeared). Tom LaRock also explained that in his post here. The view that I needed to use was the sys.dm_db_partition_stats view.

For an overall space usage total, the following query helps:

SELECT SUM(reserved_page_count) * 8.0/1024 AS DatabaseMB
FROM sys.dm_db_partition_stats;

For a breakdown by individual object, the following query (a tidied up version of what I've found in the posts) helps:

SELECT AS ObjectName, 
SUM(reserved_page_count) * 8.0 / 1024 AS SizeinMB
FROM sys.dm_db_partition_stats AS ps
INNER JOIN sys.sysobjects AS o
ON ps.object_id =

There is also a really good Azure article here that describes the use of these along with info on bandwidth monitoring, etc.

But the final thing I wanted to know is what the limit was for a given database. Sanjay Nagamangalam (from the SQL Server team) came to the rescue by pointing out a post from Walter Berry. It mentions that you can get the maximum size from an extended database property. The query below that I've adapted from it, shows the current limit:

SELECT CAST(DATABASEPROPERTYEX('PopkornKraze_DW' , 'MaxSizeInBytes') AS integer) 
/ 1024 / 1024 AS DatabaseLimitInMB;

(Note that PopkornKraze_DW was the name of my database in this test). The final thing that I might need is a query that shows how full my database is as a percentage, so if we combine them, it's just:

SELECT CAST((SELECT SUM(reserved_page_count) * 8.0 / 1024
             FROM sys.dm_db_partition_stats) * 100
            / (SELECT CAST(DATABASEPROPERTYEX('PopkornKraze_DW' , 'MaxSizeInBytes') AS integer)
            / 1024 / 1024) AS decimal(10,2)) AS PercentageUsage;

If you do happen to exceed the size limit, SQL Exception 40544 is thrown.

You can modify the database size (and edition) by executing:


You appear to be able to change the size while others are connected but changing the edition terminates existing connections.

Hope that helps someone.


Nice set of updates to Azure over the last few days – Data Sync now in the HTML Portal – Updates to the CLI

Scott Guthrie posted about the Azure-related changes that have happened over the last few days.

Of particular interest to me was that Data Sync was now in the new HTML portal, and that the Azure store now works in a bunch more countries.

Generally I like the newer HTML portal but I'm still finding that it applies different validation rules to SQL passwords than Windows Azure SQL Database itself does. That's a pain as I still have to use the older portal.

Regardless, here is the list of changes:

  • Mobile Services (job scheduler support, Europe Region Support, Command Line Support)
  • Web Sites (scale improvements, integrated source control)
  • SQL Data Sync (support in the new HTML portal)
  • ACS Management (support in the new HTML portal)
  • Media Services (job and task management, blob storage support, reserved compute)
  • Virtual Network enhancements
  • Subscription Filtering Support
  • Windows Azure Store (now available in more countries)
  • Glenn Bock also posted a few days back about changes to the CLI that help with automation of site and virtual machine creation.

    Windows Azure SQL Reporting – Great to see a dramatic price decrease for lower volume users

    I was really excited about Windows Azure SQL Reporting being released. That lasted until I saw the pricing. If I just deployed a server and didn't use it, the price was 89c per hour for up to 300 reports per hour. What many people didn't understand is that the price applied whether or not you used the reporting server.

    That meant that the minimum price for deploying a server was 89c x 24 hours x 365 days = $7796.40 per year.

    That price was way more expensive than just deploying an Azure VM and purchasing a standard edition license for SQL Server to put on it. And the standard edition license had way more functionality, apart from the high availability provided by WASR.

    At every session where I showed the product, the feedback was the same: "Love the idea, but have you seen the price?".

    Many of us complained loudly (internally) to Microsoft about this, and I'm pleased to say that I just got an email that covers dramatic price reductions.

    From February 1, 2013, the price drops to 16c per hour (all USD) for up to 30 reports per hour.

    That means the minimum price for deploying a server is 16c x 24 hours x 365 days = $1401.60 per year, as long as you don't exceed 30 reports per hour. The pricing still isn't where I'd like to see it, but it's way more palatable now.

    If you've been put off by the pricing of Windows Azure SQL Reporting, it's time to take another look at it.

    Placeholder images for testing reports

    Lorem Ipsum has long been used to provide placeholder text for testing report and document layouts. Programs such as Microsoft Word have also included options for generating sample text. (For example, type =rand() anywhere in a blank area of a Microsoft Word document and hit enter).

    Matthew Roche and Donald Farmer both sent me a link the other day to an online service that provides placeholder images. This could be quite useful when testing report layouts in SQL Server Reporting Services.

    You'll find it here:


    As an example, here's a random sports image. Of course I have no idea what you'll see on this page 🙂

    Create a system image in Windows 8

    One of the things that I've just come to accept is that the designers of Windows 8 and I think very differently.

    It'll take a long time to convince me that shutting down the computer is a "setting". Even after using Windows 8 for quite a while now, I still find that I struggle nearly every day, just trying to do things that I previously knew how to do. That's just not a good thing.

    Today I decided to create a system image as I hadn't made one lately. I started in Control Panel looking for Backup options. That yielded nothing except programs that wanted to "Save backup copies of my files with file history".

    I thought "oh well, let's just try the new search options". I hit the Windows key and typed "Backup". No, nothing came up there either.

    I searched again all over the Control Panel options to no avail.

    So it was time to hit Google again. Once again, clearly lots of people used to know how to do this and have been trying to work out where this option went.

    The first trick is that there are a bunch of Control Panel options that don't appear in the Control Panel. In the address bar at the top, if you click on Control Panel, you'll find there is an option that says "All Control Panel Options". That is curious given that's where I thought I was when I opened Control Panel. No hint is given on that screen that there are a bunch of hidden options. None the less, I then checked out "all" the options.

    The option that you need to create a system image in Windows 8 turns out to be the "Windows 7 File Recovery" option that appears in this extended list. Why does it say "Windows 7" when it's for "Windows 8" as well and I'm running "Windows 8"? Why do I have to choose an option that says "File Recovery" to create a system image backup?


    But at least I've recorded it here for the next time I forget where to find it.

    Visual Studio Image Library now available for download

    One of the challenges in any application development is trying to make your application look like it's really designed for the target environment. Using the same icons/images that are used in the target environment, and for the same purposes, helps greatly with this.

    It's great to see that Microsoft have published an image library for Visual Studio that lets your own applications use the same images that they use in the operating system.

    You'll find info about it (and the download) here:


    CTP for Power View and SSAS Multidimensional Cubes

    When Power View appeared, one of the big outcries was "but what about connecting to existing cubes!".

    Great to see that the SQL Server team have addressed that. A CTP that allows connecting Power View to SSAS Multidimensional cubes is now available:

    Help the team get this out the door by trying it and providing feedback.

    Visual Studio 2012 Update 1 now available for download

    Good to see the Visual Studio 2012 team get update 1 out the door. I'm using it now and am pretty happy with it.

    I like the way that the tools are now being updated out of band. Hopefully, the SQL BI folk will get their templates updated to VS2012 soon too.

    You can get it here:

    Detailed list of what's changed is here:


    An update on using Rosetta Stone: Studio now isn't very useful and is not great value as an add-on option

    I had a surprisingly large number of responses from my previous posting about learning Chinese. An update for those considering Rosetta Stone ( for Chinese, Spanish or any other language that they offer:

    I had to renew my "Studio" subscription today and it's now a much worse deal than it was.

    It's now $75 for 6 months for Studio sessions.

    • Online classes used to be 45 mins. Recently they reduced them to 20 mins. Given how often people have connection issues, etc. that 20 mins can disappear very quickly.
    • They've also reduced the number you can attend. You used to be able to have 2 scheduled at any point in time. Now they limit you to 2 "group sessions" per month during the period. (You can pay for additional private sessions).

    The combination of these two changes now makes it much less useful. Two x 20 min sessions per month is an almost meaningless amount of practice.

    They also now automatically change you to auto-renew when you subscribe. They tell you where to remove this auto-renewal but the first 4 or 5 times that I went into that screen, no such option appeared. Later, an option did appear and I used it.

    Overall, things just aren't what they used to be at Rosetta Stone. It's now pretty hard to recommend the Studio option where it was a no-brainer before.

    FURTHER UPDATE: <sigh>

    Even after I renewed, I could not even connect to their "new" service. Although the system processed the renewal, it still tells me it's expired. My online chat person "Siva S" tells me that the problem is that I've purchased all 5 levels of the program. I can't wait till they explain to me how making an extra purchase from them stops me from logging on. Siva told me that they had "renewed" the program. I'd have to speak to Customer Care; they aren't available and then disconnected himself. Impressive (not).

    Their website is now full of issues too. It insists that my billing address is in the USA, even though it pretends to accept changes to it.

    Overall, it's gone from something that could be recommended (with some limitations) to now being an app to avoid. That's a pity as I liked much of it before.