Benko Blog

New Webcast Series–Cloud Computing Soup to Nuts

Announcing the latest webcast series - Cloud Computing Soup to Nuts (http://bit.ly/s2nCloud). In this series we start at the beginning and take you thru the services and technologies that make up Windows Azure and SQL Azure. Running every week on Tuesdays join us to explore the possible with Cloud Computing. I’ll be updating this page as the registration links become available.

2/7 - Get Started with Cloud Computing and Windows Azure
You've heard the buzz, your boss might even have talked about it. In this first webcast of the Soup to Nuts series we'll get started with Windows Azure and Cloud Computing. In it we will explore what Azure is and isn't and get started by building our first Cloud application. Fasten your seatbelts, we're ready to get started with Cloud Computing and Windows Azure.

2/14 - Working with Windows Azure Roles
The Cloud provides us with a number of services including storage, compute, networking and more. In this second session we take a look at how roles define what a service is. Beyond the different flavors of roles we show the RoleEntryPoint interface, and how we can plug code in the startup operations to make it easy to scale up instances. We will show how the Service Definition defines the role and provides hooks for customizing it to run the way we need it to.

2/21 - Windows Azure Storage Options
The Cloud provides a scalable environment for compute but it needs somewhere common to store data. In this webcast we look at Windows Azure Storage and explore how to use the various types available to us including Blobs, Tables and Queues. We look at how it is durable, highly available and secured so that we can build applications that are able to leverage its strengths.

2/28 - Intro to SQL Azure
While Windows Azure Storage provides basic storage often we need to work with Relational Data. In this weeks webcast we dive into SQL Azure and see how it is similar and different from on-premise SQL Server. From connecting from rich client as well as web apps to the management tools available for creating schema and moving data between instances in the cloud and on site we show you how it’s done.

3/6 - Access Control Services and Cloud Identity
Who are you? How do we know? Can you prove it? Identity in the cloud presents us with the same and different challenges from identity in person. Access Control Services is a modern identity selector service that makes it easy to work with existing islands of identity such as Facebook, Yahoo and Google. It is based on standards and works with claims to provide your application with the information it needs to make informed authorization decisions. Join this webcast to see ACS in action and learn how to put it to work in your application today.

3/13 - Diagnostics & Troubleshooting
So you’ve built your Cloud application and now something goes wrong. What now? This weeks webcast is focused on looking at the options available for gaining insight to be able to find and solve problems. From working with Intellitrace to capture a run history to profiling options to configuring the diagnostics agent we will show you how to diagnose and troubleshoot your application.


How to Convert from Number Seconds to Time String in SQL Server

I’ve been working with a sample timer application on the Windows Phone to track our TechMasters meeting timings. In the user interface I capture the number of seconds that someone spoke, and I’d like to return the value of number seconds formatted as a standard looking time string. In SQL Server there is the DATEPART function that will return the number of minutes and number of seconds, but the problem is that the return value is not zero filled, which isn’t a problem as long as the person spoke at least 10 seconds. I needed to find a way to zero fill a string, and while I’m at it, it would be nice to have a function that does this for me.

In SQL Server we can take advantage of the various string functions like RIGHT, REPLICATE and LTRIM to create a zero filled string. For example if you run

 

declare @num int

set @num = 1234

select right(replicate('0', 7) + ltrim(@num), 7)

 

go

 

you will get

0001234

Using this and playing around with some of the string functions 

CREATE FUNCTION [dbo].SecsToTime

      (@nsecs int)

       

RETURNS nvarchar(7)

WITH EXECUTE AS CALLER

AS

-- place the body of the function here

BEGIN

      declare @rc nvarchar(12)

--    declare @nSecs int = 1234

       

      select @rc = right(replicate('0', 2) + ltrim(datepart(minute, convert(time, dateadd(second, @nsecs, '0:00')))),2) +

       ':' + right(replicate('0', 2) + ltrim(datepart(second, convert(time, dateadd(second, @nsecs, '0:00')))),2)

 

      if @nsecs > 60 * 60 -- more than 1 hour...then prepend # hrs

     

      begin

            declare @nHrs nvarchar(5)

            set @nHrs = convert(nvarchar,datepart(hour, convert(time, dateadd(second, @nSecs, '0:00'))))

            set @rc = @nHrs + ':' + @rc

      end

 

--    select dbo.SecsToTime(12345)

      return @rc

END

After creating the function I can create a view that will return the correctly formatted time for my app as a string by calling the function in the view. So if I run

select dbo.SecsToTime(14465)

-------

4:01:05

 

(1 row(s) affected)

Fun!


How to get to SQL Azure Query Performance Data

This week there is a lot of announcements and excitement around Windows Azure and SQL Azure with the live event put on by Scott Guthrie, Mark Russinovich and Dave Campbell (www.LearnWindowsAzureEvent.com), where they showed the great new enhancements for how to jumpstart your development efforts for the cloud. These included the streamlined signup process, spending caps for accounts which truly make trying Windows Azure risk free, as well as the new billing interface that gives you a real-time look at consumption and spending of your subscription. 

One feature I’m excited about is the new online management portal for SQL Azure. It has been updated with design, deployment, administration and tuning features built in. The new Overview screen provides quick links to the different areas of the portal, as well as easy links to help information from msdn online. You can get to the portal either by going to the Windows Azure management portal on http://windows.azure.com and after signing in going to the database section and clicking Manage, or simply browsing to your database name – https://<myserver>.database.windows.net where you substitute your database server’s name for <myserver>.

image

When I log in I can see my databases and get information about size, usage as well as the ability dive into specific usage. From there I can go into designing the schema, functions and code around my database. If I swap over to the admin page though, I have visibility into not just database size and usage, but also a link to query performance. Clicking this takes me to where I can see profile data from queries.

image

I can sort and see which calls to the database are most frequent as well as most expensive in terms of resource usage. Further I can select one and dive even deeper to see the execution plan and statistics around the calls. This information is key to making decisions on indexes and design of a well performing database.

image

In the query plan I can look for table scans or other expensive operations and if it make sense determine whether additional indexes would be useful.

image

Nice!


Learn Windows Azure with the Scott Guthrie, Mark Russinovich and Dave Campbell

On Tuesday this week Scott Guthrie (@scottgu), is doing a live event to showcase Windows Azure and the latest in Cloud Development. The site http://www.LearnWindowsAzureEvent.com has details on the schedule for the day and includes a Q&A session on Channel9. If you have questions after the fact you can ask them on Windows Azure Office Hours (http://wabcdemos.cloudapp.net/OfficeHrs) where we will have an hour with @markrussinovich to help answer questions and understand the possible.

Join us. Learn how to build #cloud apps from on Dec 13. http://bit.ly/uorr8K #startazure


Announcing the New BenkoTIPS.com site!

imageToday I’ve finally completed migration the content and links to webcasts, downloads and more from the original site I built as a developer resource in 2005 to a new version deployed in Azure. Originally deployed using DotNetNuke, the new site is built with the latest ASP.NET tools, technologies and techniques.

I’ve almost migrated the site to several technologies over the last several years, including SharePoint, .NET Web Forms and most recently MVC. The new site is built leveraging OData, .NET 4.0, combined Azure roles and more. I toyed with the idea of including a membership provider to the original user database, but instead implemented Access Control Services (ACS) to allow you to authenticate with Google, Facebook, Yahoo and LiveID instead. I will be showcasing how this is done in an upcoming webcast on Cloud Identity.

You should find that the old links should still work for the most part, but if something doesn’t please let me know – send me an email (from the link in the left hand pane that says Talk to Mike).

Enjoy!


Subscribe Today:

Stumbler


Some useful links

BenkoBLOG by Tags


MSDN Blogs

Other Blogs

Podcasts & Shows
Conferences

Regional User Groups

Mike Benkovich delivers technical presentations around the U.S. as a developer evangelist at Microsoft. He has worked in a variety of professional roles, including architect, project manager, developer, and technical writer. Mike is also an author of two books, published by WROX Press and APress, that show developers how to get the most from their SQL databases. Since appearing in the 1994 Microsoft DevCast, Mike has presented technical information at seminars, conferences, and corporate boardrooms across America.