Opportunities for companies in China to run Azure in their own datacenters

In my job I get to see and experience a lot of technology and today I got to get my hands on one of the most exciting things I’ve seen in a while.  It was a proof of concept deployment of the Windows Azure Services for Windows Server which we did within the datacenter of one of China’s top enterprises.

image

I’ve known that Microsoft has been building this for quite some time but this was the first time I was able to really dig in deep to see how impressive it is.  In case you aren’t familiar with it, at the Microsoft’s Worldwide Partner Conference in July we released the first CTP of a set of Windows Azure Services which can be run on top of Windows Server and System Center.  It provides anyone with at least a couple of servers the ability to run a portal which looks just like the Windows Azure portal and provide Web Sites, VMs, SQL and MySQL just like Windows Azure. 

Going through the proof of concept this morning I was really impressed with how elegant the solution is.  It leverages the power of Virtual Machine Manager (VMM) within System Center 2012 for all of the infrastructure management and uses the VMM APIs for deploying Web Sites, VMs, etc.

Now, back to how this could be huge for Chinese companies. 

Currently there are no cloud service providers that have established themselves as the leaders in China.  The companies that are dominating cloud outside of China (Amazon, Microsoft & Google) don’t offer services from a China mainland datacenter.  Even if a company is willing to deploy their services in one of these company’s datacenters outside of China the complexity of the Chinese network topology make it impractical from a performance perspective to deploy services targeting end users in China.  Of course there are some workloads which are an exception to this but for many of the cloud’s most useful workloads like media and entertainment, backend services for mobile apps, etc. datacenters outside of China are not an option. 

Even if these cloud providers launches a public cloud service from a China mainland datacenter there will still be a lot of opportunity.  After all, there are over 1 billion mobile subscribers and apps like Tencent’s Weixin/WeChata with over 100 million users, you see the opportunity.  Cloud is also one of the three technology focus area’s in China’s 12th 5-year plan along with Internet of Things and 3 Network Convergence, which is attracting a lot of investment from the Chinese government and Chinese entrepreneurs.

There have been attempts by local players like Alibaba, Baidu and Shanda to provide a cloud service but none have really taken off for a number of reasons which is a topic for another blog post or over drinks.  There aren’t any dominant players in hosting like Rackspace or Media Temple in China.  Instead there a lot of smaller companies offering hosting or colo’d within telco datacenters of China Mobile, China Unicom and China Telecom.

All of this combined with many Chinese companies’ preference for keeping data and services within their own organizations’ control makes the timing of this release of these Windows Azure Services perfect. 

For large companies and government organizations that already have a large datacenter footprint/ownership they could deploy a world-class public cloud solution based on the Windows Azure Services.

For smaller companies they could quickly come up to speed on deployment and operation of these Windows Azure Services and specialize in implementing private cloud deployments within enterprises, government organizations, etc.

For ISVs they could build out a billing solution which is integrated with Chinese payment systems and local business practices.

These are exciting times and I’m glad to be a part of it!  If you want to discuss these opportunities more just let me know.

Connecting to SQL Azure with SQL Server 2008 R2 Tools

Back in October I wrote a post on how to connect to SQL Azure.  With the release of the November CTP of SQL Server 2008 R2 working with SQL Azure from within SQL Server Management Studio (SSMS) got a whole lot better! 

You can get a free copy of SSMS here:

Because this is a CTP you may want to install these in a Virtual PC although I haven’t had any issues.

Once you have this installed all of the issues I outlined in my previous post about the headaches involved with connecting to SQL Azure are gone.

When you launch SSMS enter your credentials.

image

Replace MY_SERVER_NAME and MY_USER_NAME with valid credentials which you can setup and find on the SQL Azure portal.

Make sure you have added your IP address to the SQL Azure firewall or you will get the following error.

TITLE: Connect to Server
——————————

Cannot connect to ‘<MY_SERVER_NAME>.database.windows.net.

——————————
ADDITIONAL INFORMATION:

Cannot open server ‘<MY_SERVER_NAME>requested by the login. Client with IP address ‘<MY_IP_ADDRESS>’ is not allowed to access the server.  To enable access, use the SQL Azure Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range.  It may take up to five minutes for this change to take effect.
Login failed for user ‘<MY_USERNAME>’. (Microsoft SQL Server, Error: 40615)

The New Firewall Feature section of a previous post outlines configuring your firewall.

Assuming your credentials are correct you should see Object Explorer just like you would any other SQL Server database, which is awesome!

image

Once you start using the tool you will notice that things are not as integrated as they are for SQL Server.  For example, let’s create a database.

When I Right Click on Database and select New Database…  a new SQL script is created.

image

I can simply replace everything between <> and execute the script.

image

You’ll notice that once I refreshed the Object Explorer I see this new database.  Additionally, you may notice that I specified that I wanted a 10GB database with the MAXSIZE = 10GB option.  If you are just building a sample you should probably leave the MAXSIZE option off and it will default to 1GB.

To round out the example I’m going to install the Adventure Works SQL Azure database following the instructions that come with the sample.

Now when I look at Object Explorer you can see I have the full set of Tables, Stored Procs, etc.

image

One thing you may notice is that the Adventure Works installer creates new databases AdventureWorksDWAZ2008R2 and AdventureWorksLTAZ2008R2.  Since SQL Azure is priced per database I’ve created a request on the CodePlex site to allow them to be installed into a target database.  If you agree that it’s a good idea please vote for the item on CodePlex.

Hopefully you found this useful.  Please let me know if you have any questions.

More Information

Windows Azure Platform Training Kit – October Update is Live

Aligned with the SQL Azure October CTP release today we have published an updated version of the Windows Azure Platform Training Kit here
http://www.microsoft.com/downloads/details.aspx?FamilyID=413E88F8-5966-4A83-B309-53B7B77EDF78 

While the Download Center servers are being replicated you will want to make sure the title of the page contains “October Update” and the File Name is “WindowsAzurePlatformKitOctober2009.exe”.

This update contains a few new sections with the Hands On Lab for dealing with the firewall and how to use BCP to move data into SQL Azure.  The training kit contains the following SQL Azure related content.

Presentations

  • Introduction to SQL Azure
  • Building Applications using SQL Azure
  • Scaling Out with SQL Azure

Demos

  • Preparing your SQL Azure Account
  • Connecting to SQL Azure
  • Managing Logins and Security in SQL Azure
  • Creating Objects in SQL Azure
  • Migrating a Database Schema to SQL Azure
  • Moving Data Into and Out Of SQL Azure using SSIS
  • Building a Simple SQL Azure App
  • Scaling Out SQL Azure with Database Sharding

Hands On Labs

  • Introduction to SQL Azure
  • Migrating Databases to SQL Azure
  • Building Your First SQL Azure App

Feature complete SQL Azure October CTP available today

With PDC around the corner the SQL Azure team has delivered an updated CTP that’s feature complete, running on production clusters and containing cool new features like firewall, table value parameters, support for BULK INSERT and new data types.  Checkout the product team blog for details.

So, what does this new release mean to developers?

Move Forward with Confidence

Now that you can get your hands on a feature complete version of SQL Azure you can have confidence that when SQL Azure Database becomes generally available, all your databases and data will be automatically converted into an active subscription to the service based on the subscription offer you choose at go-live.

imageNew Portal

The October CTP is running in a new, production-ready cluster.  You can access the new developer portal for the October CTP via the same URL as before https://sql.azure.com/ which you will notice has an updated skin and a few new features.

Another thing you may notice is that your existing projects are no longer showing up!  You can access your August CTP project through the developer portal available at this URL https://ctpportal.database.windows.net.

New Server URI

With the release of the October CTP you will also need to create a new server for your account.  This is the same process for creating a server as you may have followed for the August CTP.  Guidance on this is available in the Introduction to SQL Azure hands on lab in the Window Azure Platform Training Kit.

One interesting thing to note is that the Server Location is South Central US which is right alongside Windows Azure so you should see even less latency between the services.

The other big thing to know is that there is a different URI for the Server Name.  Before the syntax was

<MY_SERVER_NAME>.ctp.database.windows.net

To access servers created in the production cluster you remove the “ctp.” portion of the Server Name.  A connection to the new server will be

<MY_SERVER_NAME>.database.windows.net

I have a feeling that this is going to trip up a bunch of developers so hopefully this helps.  Another area I believe will catch a number of people off guard is the firewall feature.

New Firewall Feature

For years we’ve been telling people to lock down access to their databases machines.  With the August CTP of SQL Azure there was no way to limit access to what machines had access to your server.  With the October CTP you can now specify which IP addresses have access to your server which is awesome! 

By default no IP’s are allowed to access your server.  If you try to connect you will get the following error.

TITLE: Connect to Server
——————————

Cannot connect to m9vhbwlttp.database.windows.net.

——————————
ADDITIONAL INFORMATION:

Cannot open server ‘<MY_SERVER_NAME>’ requested by the login. Client with IP address ‘<MY_IP_ADDRESS>’ is not allowed to access the server.
Login failed for user ‘<MY_USERNAME>’. (Microsoft SQL Server, Error: 40615)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=40615&LinkId=20476

 

imageYou can modify the firewall rules via the portal, T-SQL stored procs or web service API’s which you can view MSDN docs for details on.  Using the portal just click on the Firewall Settings tab.  From there you can either check the box to Allow Microsoft Services access to this server which will enable all Windows Azure Web and Worker Roles to access your server.   

imageAdditionally, you can click the Add Record button and add your current IP address which is shown in the dialog box.

These updated rules may take up to 5 minutes for the change to take affect so please be patient.

Moving Your Data and Databases

First, you will need to move databases from the current CTP cluster over to the new cluster.  As mentioned above, these are separate, distinct machine clusters and actually reside in different data centers. More importantly, the data and databases you create in the October CTP will automatically roll over into the production service at go-live – at which point we will start to charge for those databases based on the service offering you’ve sign up for. Rather than risk inadvertently charging people for a bunch of test databases, the team got feedback that it was best to allow people to ‘opt-in’ to the new cluster. That way, people will only get charged for what they need and use.

Creating databases in the October CTP will be even easier and faster than on the August CTP. I’d recommend checking out the Migrating Databases to SQL Azure lab in the Windows Azure Platform Training Kit for guidance on moving data with BCP and SSIS.  With the BULK INSERT support in the October CTP developers can deploy BCP.EXE into a Windows Azure Worker Role eliminating the need to copy the data down locally. 

As I mentioned, SSIS is also an option, although we know that customers have experienced performance issues with the SQL Server 2008 Integration Services and SQL Azure.  The next CTP of SQL Server 2008 R2 will have an update to SSIS which dramatically increases performance when loading data in SQL Azure.

Specify Database Edition

With this CTP you can also use a MAXSIZE clause when executing CREATE TABLE to select Web or Business Edition.

CREATE DATABASE foo (MAXSIZE = 1GB)

Or

CREATE DATABASE foo (MAXSIZE = 10GB)

What’s Next?

Everyone is driving hard towards PDC and we are all very excited for Commercial Availability.  Keep your eyes pealed for updates to SQL Server Management Studio and SQL Server Integration Services as part of the SQL Server 2008 R2 wave.  With the updates to SSMS you will be able to use the Object Browser and have an option for exporting SQL Azure compatible scripts.  With the updates to SSIS you will see dramatic performance improvements when loading data in a SQL Azure database.

USE statement is NOT supported in SQL Azure CTP1

So, now that you’ve got a token and can connect to SQL Azure, you probably want to create a database and start using it.  There’s one thing that can cause a ton of heart ache…  USE <database> is not supported!

The reason USE <database> isn’t support is because when you connect to one database you are essentially being tied to a particular server cluster via the SQL Azure TDS Gateway.  Your database aren’t all on the same physical machine, therefore you must specify the database when you connect.  Does that make sense?

For example, let’s say you are using SQLCMD or SSMS to work with SQL Azure…  Let’s look at a common use case.

First, I’ll connect to SQL Azure with my Administrative User that I created when I redeemed my token.  In this case that username is admin.  This user can be thought of like sa in on-premise SQL Server.  I’ll connect to a server named h38ssfjeiwh201 which was automatically assigned to me.  In this case I won’t specify a database name, so it will default to my virtual master database.

NOTE: In these samples I’m showing connecting via SQLCMD but you won’t get all of the same messages on success, although the errors will be the same.

sqlcmd -S h38ssfjeiwh201.ctp.database.windows.net -U admin@h38ssfjeiwh201

Now, I’ll go ahead and create a new database named sample_db with TSQL.

CREATE DATABASE sample_db;
GO

NOTE: Future versions of SQL Azure will support a MAXSIZE clause to the CREATE DATABASE statement for create 1GB or 10GB databases.

I’ll get a message saying things are looking good.

Command(s) completed successfully.

Great!  Now, I want to start using that database…  So like any novice SQL Server developer I try to use it.

USE sample_db;
GO

The problem is I get the following error…

Msg 911, Level 16, State 1, Line 1

Database ‘sample_db’ does not exist. Make sure that the name is entered correctly.

Uh…  Ok.  Let me try again…  I thought I typed it right but maybe I’m missing something.

CREATE DATABASE sample_db;
GO

Now I get the following error…

Msg 1801, Level 16, State 1, Line 1

Database ‘sample_db’ already exists. Choose a different database name
.

I know… I know… These error messages need to be improved. The problem is like I mentioned in the title of this post. SQL Azure does not currently support the USE <database> statement.

What I need to do is actually reconnect by specifying the database name as a connection parameter in SQLCMD or by specifying the Connect to database in the Options >> on the connection dialogue in SSMS.

sqlcmd -S h38ssfjeiwh201.ctp.database.windows.net -U admin@h38ssfjeiwh201 -d sample_db

Now I can go about interacting with sample_db just like I would any other SQL Server database (for the most part).

For additional information about this see the Intro to SQL Azure hands on lab and demos in the Windows Azure Platform Training Kit.