# Thursday, 06 November 2014

In the last article, I showed how to create a new Azure Mobile Service in the portal. In this article, I will show you how to use the wizard to create an application, consisting of a new table, an HTTP endpoint to access that table, and a sample client application to access the data through that endpoint.

Log onto the Azure Portal and select the MOBILE SERVICES icon in the left menu. Figure 1 shows the Mobile Service we created last time.

Zumo2-Figure 01 - List Service
Figure 1

Click the arrow next to the service name to display details about the service (Figure 2).

Zumo2-Figure 02 - GET STARTED
Figure 2

Notice the choices you have next to "CHOOSE A PLATFORM". The Platforms listed are the various client platforms explicitly supported by Mobile Services. Remember that Mobile Services exposes data via standard interfaces such as HTTP and JSON which can be used by a wide variety of platforms and languages. For this demo, click the "Windows" button; then expand the "CREATE A NEW WINDOWS APP" link. This will reveal the 3 steps to get you started building an application around Azure Mobile Services (Figure 3).

Zumo2-Figure 03 - GET STARTED
Figure 3

Get the tools (Figure 4) allows you to download a free version of Visual Studio. If you already have any version of Visual Studio 2013 installed, you can skip this step.

Zumo2-Figure 04 - Get the Tools
Figure 4

The "Create a table" step (Figure 5) allows you to create a sample SQL Server table. Click the green button to create a new table named "TodoItem" in your database with columns to keep track if the tasks you need to do today and whether you have completed each task.

Zumo2-Figure 05 - Create Table
Figure 5

The “Download and run your app” step (Figure 6) will generate client code that will connect to your application.

Zumo2-Figure 06 - Download App
Figure 6

Select a language (C# or JavaScript) and click the Download button to download a ZIP file containing a Universal App that includes a Windows 8.1 project, a Windows Phone 8.1 project, and a Shared Code project. Depending on your language selection, these projects will either contain a user interface written in XAML and C# code-behind or an HTML5 front-end with a WinJS code-behind. Figure 7 shows the results of C#/XAML project generated by Azure Mobile Services.

Zumo2-Figure 07 - Client App
Figure 7

Compile and run this app to see it in action. Figure 8 shows a screen shot of the Windows 8 app. You can enter a new task in the textbox and click Save to send data to the mobile service telling it to insert a row in the todoitem table. A list on the right displays all tasks that are not yet completed. Click the checkbox next to an item to send data to the mobile service telling it to update the todoitem table, setting the Complete column to FALSE.

Zumo2-Figure 08 - Running App
Figure 8

Figure 9 shows the Windows Phone project running.

Zumo2-Figure 09 - Running App
Figure 9

You can see that the apps look similar because they have the same functionality. The differences are related to the size, layout, and other considerations of the specific platform on which they run. Play with each app and you will see that they function about the same, thanks to the large percentage of shared code.

In this article, we saw how to run the Azure Mobile Services wizard to generate a sample table and client application.

Thursday, 06 November 2014 10:00:00 (GMT Standard Time, UTC+00:00)
# Wednesday, 05 November 2014

With Azure Mobile Services, developers can quickly create a REST interface to read and write their backend database.

The Azure portal provides a wizard for creating a sample solution built around mobile services in just a few minutes. In this article, I will walk you through the steps to create a new Azure Mobile Service.

Log onto the Azure Portal and select the MOBILE SERVICES icon (Figure 1) in the left menu.

Zumo2-Figure 01
Figure 1

Click the NEW button at the bottom of the screen (Figure 2).

Zumo2-Figure 02 - New Button 
Figure 2

This exposes a menu (Figure 3).

Zumo2-Figure 03 - Create
Figure 3

With COMPUTE and MOBILE SERVICES selected (which should already be the case) click the CREATE button.

The "Create a Mobile Service" dialog (Figure 4) displays.

Zumo2-Figure 04 - Create
Figure 4

Give a name for the service. The full name will be whatever you type in the URL textbox, followed by ".azure-mobile.net" and it must be unique. The portal will let you know if someone else has chosen the same name. Select an existing database or create a new one; then select the Region where the Mobile Service will live. It makes sense to create the service in the same region where the database resides.

Finally, select the language in which to build the backend service. If you select JavaScript, the server-side solution will be hosted in Node.js. If you select .NET, you can create a solution in Visual Studio and deploy it to Azure, where it will be hosted in IIS.

Click the arrow (Figure 5) at the bottom right of the dialog to advance to the next page, where you can specify database information.

Zumo2-Figure 05 - Next
Figure 5

Figure 6 show the page if you elect to connect to an existing database. Select the database connection string; then enter the login name and password with which you will connect to this database.

Zumo2-Figure 06 - DB
Figure 6

Click the check button to create the Mobile Service. After a few seconds, the service will show up in the portal as in Figure 7.

Zumo2-Figure 07 - New Service
Figure 7

In this article, we saw how to create a new Azure Mobile Service. In the next article, we will add a table and allow clients to retrieve and update data in that table, using this service.

Wednesday, 05 November 2014 10:00:00 (GMT Standard Time, UTC+00:00)
# Tuesday, 04 November 2014

Storing data in the cloud allows your application to remember information between launches and to share data among other users, applications, and devices.

Exposing that data via a REST interface makes this data accessible to applications running on a variety of platforms and written in a variety of languages. REST is an architectural pattern for allowing clients to read and update server data through a consistent API. The current implementations of REST uses an HTTP endpoint (a URL) to expose functionality and the features of HTTP (verbs, response codes, and header data) to exchange data between the client and the server.

Azure Mobile Services (ZuMo) makes it easier to expose your data as a REST endpoint by handling the "plumbing" code for you so that you can focus on your data model and your business logic.

With just a few clicks, you can create a service and map it to a database table. ZuMo will create an HTTP endpoint; map HTTP verbs to Create, Read, Update, and Delete methods; create those methods for you; and handle the transformation from JSON data into objects that map to rows in your database table. This isn't impossible code for you to write, but it can be a lot of code. And wouldn't your time be better spent writing the code that makes your application unique?

Azure Mobile Services will even generate a client application to call your new REST service and pass data to and from it. You can use this application as a starting point or you can copy and paste code from this app into your own client app. ZuMo is capable of generating a sample client application for Windows 8, Windows Phone, HTML and JavaScript, Xamarin, PhoneGap, Android, or iOS.

Azure Mobile Services is a true cross-platform solution that is simple to implement because it handles much of the plumbing code for you.

Tuesday, 04 November 2014 10:00:00 (GMT Standard Time, UTC+00:00)
# Monday, 03 November 2014
Monday, 03 November 2014 10:00:00 (GMT Standard Time, UTC+00:00)
# Sunday, 02 November 2014

11/2
Today I am grateful for the friends I have kept for decades. They've known me at my best and at my worst.

11/1
Today I am grateful I finally caught up editing all my videos and photos.

10/31
Today I am grateful for dinner with my niece Amanda last night.

10/30
Today I am grateful for a home-cooked meal last night.

10/29
Today I am grateful for a chance to speak at the Motor City Software Testers last night & to all who came to hear me.

10/28
Today I am grateful I attended an exciting Monday Night Football game in Dallas last night.

10/27
Today I am grateful for some authentic Texas BBQ last night.

10/26
Today I am grateful for the students at TAMUHack who show energy, imagination, and passion and built so many great projects this weekend. I'm also grateful for the Michigan State Spartans, who drove through the michigan wolverines like a spike through grass yesterday!

10/25
Today I am grateful for my first trip to College Station, TX.

10/24
Today I am grateful I was invited to speak at the inaugural meeting of the Local Variables user group in South Bend, IN yesterday.

10/23
Today I am grateful for a long hot shower on a chilly morning.

10/22
Today I am grateful to God, who helped me through the difficult times in my life.

10/21
Today I am grateful for a day with few responsibilities.

10/20
Today I am grateful for a weekend in Indiana watching football with Tim Giard

10/18
Today I am grateful for lunch yesterday with Corey Haines

10/17
Today I am grateful for an unexpected gift from the Madison Mobile .NET Developers Group .

10/16
Today I am grateful for a successfully completed trip to Minnesota and Wisconsin.

10/15
Today I am grateful I completed 1 year at the best job I've ever had.

10/14
Today I am grateful for dinner last night with Brent Stineman

10/13
Today I am grateful for the open Wi-Fi that suddenly showed up when I'm in my apartment. I'm not sure if the apartment complex added a repeater or if I have a new neighbor, but I appreciate it.

10/12
The Hitchhiker's Guide to the Galaxy was published 35 years ago today! I am fortunate to have met the book's author before his passing.

10/11
Today I am grateful for dinner and drinks last night with Patricia and Gary.

10/10
Today I am grateful to the folks a the Schaumburg Microsoft .NET Technologies Meetup for inviting me to speak last night

10/9
Today I am grateful for a great audience yesterday at the first Azure Dev Camp in St. Louis.

10/8
Today I am grateful that my son called me yesterday just to say "Hi".

10/7
Today I am grateful to Velichka, who brought me chicken soup when I was sick.

10/6
Today I am grateful for 12+ hours sleep last night that I desperately needed.

10/5
Today I am grateful for dinner with friends, a ticket to the Nebraska game, and a Spartan victory!

Sunday, 02 November 2014 15:03:28 (GMT Standard Time, UTC+00:00)
# Saturday, 01 November 2014

A few months ago, I migrated this blog to Azure Web Sites.

I was aided by the fact that I use Das Blog as a blogging engine. This gave me two advantages:
1. I could select a Das Blog template from the Azure Web Site gallery, automatically configuring the appropriate settings for my site; and
2. Das Blog uses XML files instead of a database to store blog posts, so I was able to xcopy my entire blog to Azure.

The only real work was changing my DNS settings to point to Azure, which took a few minutes. I set the site to user the SHARED hosting plan, which lets me point a custom domain to it. More popular blogs (like yours) may need to use the BASIC or STANDARD Web Hosting Plan, but I stuck with the cheap one and it works fine for me.

The story here is what a non-story this migration was. My site was down less than an hour and most of that was because I messed up the DNS settings the first time. It is servicing requests just fine and I am saving money because this hosting plan is cheaper than what I paid to my old provider.

Currently, I'm not using any advanced features, such as Scaling, Autoscaling, and Web Jobs but those are available to me if I need them.

I love the simplicity of Azure Web Sites. If you are considering using Azure, this is a good place to start.

Saturday, 01 November 2014 23:27:51 (GMT Standard Time, UTC+00:00)
# Monday, 27 October 2014
Monday, 27 October 2014 23:17:10 (GMT Standard Time, UTC+00:00)
# Monday, 20 October 2014
# Saturday, 18 October 2014

What is Demand Elasticity, how does it affect my apps, why should I care, and how does Azure address this?

Demand Elasticity is an issue because almost no app has a constant demand over time: Some apps are used primarily during business hours and very little during the night; some apps have abnormally high demand during specific events, such as the launch of a new product or while NFL games are broadcasting; some businesses have peak seasons when they do nearly all their business (I once worked for an electronics retail store that earned over 80% of their revenue between Thanksgiving and New Years Day.)

Each of the above examples describes demand variability that you can plan for. An even more difficult problem is unexpected changes in demand. Imagine if a popular TV show recommends your online service. Demand would likely skyrocket. Could your services handle this extra, unexpected load?

Because of this change in demand, you need to decide how much hardware to deploy for your application. If you deploy too much hardware, you are wasting your money, but if you deploy too little, you will miss out on potential users and revenue. And in the fact that hardware is not easy or quick to deploy - It may take your organization weeks or months to respond to a sudden, unexpected increase in demand. And what do you do with that extra hardware when demand falls? For most organizations, it's not practical to buy and sell hardware as demand goes up and down.

Ideally, as demand increases and places higher load on your servers, you would increase the amount of hardware to which your application is deployed. Then, you would remove that hardware (and stop paying for it) as demand and workload decrease.  If you are managing and deploying the hardware yourself, this is not really practical. There is no quick market to buy and sell servers and most organizations take days – if not weeks – to provision a new server.

But Azure allows you to deploy more servers to your application and it automatically deploys them for you in a matter of minutes. Most services in Azure have a setting that allows you to change the number of running instances. This can be the number of web sites, web roles, mobile service, virtual machines, or dozens of other service instances available.

Below is the setting for configuring the number of instances of an Azure Web Site.
Scale-1
figure 1

Some services even allow you to automate this process. For example, you can configure Azure to monitor the CPU used by your web sites and automatically deploy a new instance of your site when CPU rises above a certain percent and remove an instance when it falls below a given percent. You can set a minimum and maximum to keep the number of instances within this range.

For Azure Web Sites, this Auto-scaling feature is available if we select the "Standard" hosting plan. Below are the controls that allows you to set these configuration.
Scale-2

Figure 2

Scaling up helps your service deal with extra usage (planned or unplanned), while scaling down helps you save money. The quicker you can do both, the more agile you will be.

Azure allows you the flexibility to scale up and down to meet changing demand.

Saturday, 18 October 2014 14:34:45 (GMT Daylight Time, UTC+01:00)
# Wednesday, 15 October 2014

Yesterday was my 1-year anniversary at Microsoft.

The year has flown by. I remember being at a customer site in Toledo last summer when the recruiter called and offered me a job pending a background check. I remember standing outside the speaker room at Dev Connections in Las Vegas when my new boss Scott Fuller officially offered me the job. I remember how hard it was to tell my old boss I was leaving. I remember how excited I was to tell my friends the news. I remember feeling giddy that first day as I drove to Southfield for my orientation.

I had been trying to land a job as a Microsoft Technical Evangelist for years - ever since I first met Josh and Jennifer and Brian and Jeff and saw what they did and how smart they are and how how much good they were able to accomplish and how much fun they had doing it. But this job was only available in other parts of the country and family obligations kept me from moving. But last year, both my sons moved out of state and a Jennifer Marsman told me about an opening in Chicago and I jumped at the chance. A few months (and many interviews) later, I was in.

I spent the first week shadowing Jennifer, watching her work and learning as much as I could. I traveled to Chicago the next week and met with my new boss Scott and shadowed Dave Bost and Martin Schray, learning all I could from them.

Many people describe working at Microsoft as "drinking from a fire hose" and that is an excellent metaphor. There is so much to learn and so much to do and often it's not obvious what you should be doing or learning. My time management skills are honed sharper today than they ever have in the past.

I'm really happy in my role as an Evangelist, which consists of a lot of teaching people how to build apps on Azure, Windows 8, and Windows Phone. I love the opportunity to learn and I love the impact I have on a number of different communities. Coming in, I was focused on the developer community, spending time at user groups and code camps. But I've discovered that startups have their own community and they bring their own kind of passion to what they do. And I've spent a lot of time with student groups on campus and gained a new perspective into the American higher education system. I've met so many people who are passionate about what they do, which inspires me to excel at my tasks.

One challenge of this job has been the large amount of travel. Shortly after I joined, I was asked to cover both the Midwest and the Heartland Districts - an area stretching from Wisconsin to Tennessee. I'm proud to say that I scheduled multiple events in each of these 7 states. But it did involve a lot of driving and more than a few nights when I did not get enough sleep. I’m writing this article from a hotel room in Edina, MN. In a few minutes I’ll drive to Madison, WI to speak at a user group before driving down to Chicago tonight where I have 3 events planned for tomorrow.

After a year, I can say that I've learned a lot, I've done some good, I've lost some sleep, I've made some friends, and I've loved it.

Now I have a new boss, new metrics, and a new home (I've moved to Chicago). The future is filled with challenges. But it's very bright. I'm excited for the next 365 days and beyond!

Wednesday, 15 October 2014 16:19:56 (GMT Daylight Time, UTC+01:00)