Posts Tagged '.NET'

Amazon Extends Services for Microsoft Technologies

As someone who works primarily with Microsoft technologies I was delighted to see the Amazon announcement yesterday that they are going to offer two additional options for developers.

First, Amazon RDS is now going to include SQL Server in addition to MySQL and Oracle databases.

SQL Server is available in a variety of versions on RDS and, like Oracle, can have license fees included in the hourly instance charge or can utilize a “bring your own license” model for existing Microsoft Volume Licensing customers that have SQL Server covered by Microsoft Software Assurance contracts. In either case RDS allows SQL Servers to be provisioned on an as-needed, pay-as-you-go basis. The managed service provides automated software patching, monitoring and metrics, automated backups and the ability to create on-demand database snapshots. This offering appears to be in direct competition to Microsoft’s own SQL Azure, so the future should prove interesting!

Second, Amazon Elastic Beanstalk is now going to include support for .NET developers using the Windows/IIS/.NET solution stack rounding out the service offering which already supports Java and PHP.

Elastic Beanstalk is similar but somewhat different as a PaaS concept than Microsoft Azure. Azure is in many ways a more managed approach that takes care of a lot of administration for you behinds the scenes. Elastic Beanstalk exposes the entire underlying infrastructure to you if desired. Both offer a plug-in toolkit for Visual Studio that enables deployment directly from the development environment.

I am a great believer that competition is good and that certainly appears to be the case in the cloud as well. Amazon, in my opinion, has just raised the bar another notch. These two new services from Amazon will likely appeal to some developers familiar with Microsoft technologies. I wonder how, if and when Microsoft will respond!

Kevin Kell

Using the AWS SDK for .NET is Fun, Easy and Productive!

As a programmer, one of the things I really like about Amazon Web Services is that there is SDK support for a variety of languages. That makes it easy to get started automating AWS solutions using tools you are already familiar with. My recent programming experience has been primarily with C#. I chose the Amazon SDK for .NET for my latest project since it was somewhat time critical (when are they not!?) and I had to go with a language I already knew pretty well.

The SDK download from Amazon includes a library for .NET, code samples and a Toolkit for Visual Studio. Once installed the toolkit provides a New Project template in Visual Studio that gives you a good place to start. You also get the AWS Explorer which makes it very easy to manage your Amazon resources right from within Visual Studio.

Figure 1 Visual Studio with AWS Toolkit installed

The library provides an intuitive object wrapper over the Amazon APIs. If you have used the Amazon command line tools or management console you should feel pretty comfortable with the .NET implementation. For example to use EC2 from within a C# application you create an instance of an EC2 client using the AWSClientFactory. You can then call methods on the AmazonEC2 object you create. These methods correspond to the command line commands and API calls you have already been using. The wizard even creates some sample code to get you going.

A simple method to launch an EC2 instance might look like this:

Figure 2 Simple Method to Launch an EC2 Instance

By providing support for multiple languages Amazon opens up AWS to developers from many backgrounds. Whether you program in Java, Ruby, PHP, Python or C# you will find an SDK that will get you started building solutions that leverage the many services offered by Amazon in the Cloud.

Kevin Kell

Windows Azure Interoperability

I was talking to a colleague last week and he asked, “If you deploy an application to Azure, can you move it to a different cloud provider later on?” To answer this question, let’s look at three things. First, what is Azure really? Second, does writing an Azure application lock you into Azure? And third, is there a need for standards in cloud-computing?

Azure is Just Windows Server in a Virtual Machine

Let’s say you write a Web application using ASP.NET. That application will run on any Windows server. Azure is really just a virtual machine running an instance of Windows server. So, moving an application from an Azure virtual machine to an Amazon EC2 virtual machine is no different than moving an application from a Dell server to an HP server. In fact, it would be quicker, because you wouldn’t have to buy the hardware or install the software. That is not to say there are no issues, but it’s really not that big a deal.

You might want to check out this article for a Look Inside a Windows Azure Instance.

Does using Azure Lock you into Microsoft as your Cloud Vendor

There are changes you’d likely make in your Web application to take optimal advantage of Azure’s architecture. For example, you would likely use Azure Storage for sessions, membership and online data. Check out the following article to find out why, Windows Azure Training Series – Understanding Azure Storage.

Surely, that would lock you into Azure. Well not really. Azure Storage can be accessed from anywhere via http. So, while you might be using Azure Storage from an Azure application, you could just as easily use it from an application running on EC2, Google App Engine or from your local area network. So, if you had an application using Azure specific features and wanted to move it, it would not mean a rewrite.

Is there a need for Standards in Cloud Computing

Whenever people start talking about a need for standards I get worried. Standards mean committees and meetings and great long documents. I would argue we already have the standards we need. All of Windows Azure is made available using http and a REST-based API. That means any platform that can make an http request, can use Windows Azure. The same can be said of Amazon Web Services and Google App Engine.

Microsoft provides Windows Azure for compute services, SQL Azure for relational database and Azure Storage for data services. Amazon has EC2, Elastic Beanstalk, S3 and RDS which collectively provide the same services. Google offers App Engine and Big Table. You can mix and match the services from these providers any way you think is best, and move between them over time.

Summary

So, yes you can deploy an Azure application today and move it elsewhere later. To learn more about Windows Azure, check out Learning Tree course 2602, Windows Azure Platform Introduction: Programming Cloud-Based Applications. Or, to learn more about cloud-computing in general, come to Learning Trees Cloud Computing course.

Doug Rehnstrom

A Look Inside a Windows Azure Instance

Exploring an Azure Instance with RDP

A Windows Azure instance may seem like a mysterious black box, but it is really just Windows Server running in a virtual machine. Using remote desktop, I accessed an instance that I had previously deployed.

Kevin Kell wrote a good article on accessing Azure Instances using RDP, if you are interested.

The instance I accessed was a “Small Instance”, which according to Microsoft, has a 1.67Gh CPU, 1.75 GB of memory and 225 GB of storage. This computer would cost about $80 per month.

Let’s hunt around a bit. A look at Computer properties shows I have Windows Server 2008 Enterprise edition with service pack 2. I can also verify that I have 1.75 GB of RAM and one CPU.

A look at Windows Explorer shows I have three drives, and sure enough 225 GB of instance storage.

 

The instance I deployed was a Web role. That’s just a fancy way of saying IIS is running and the ASP.NET application that I deployed is set up. See the screen shot below.

    

A look at my Web application’s Advanced Settings shows the application I deployed was uploaded into the computer’s E drive.

I was also curious about what versions of the .NET Framework were installed. It turns out they all are.

Conclusion

If you are already a Windows administrator or .NET developer you can take advantage of cloud computing and Azure’s benefits, while leveraging your existing knowledge. Those benefits include, reduced administration, simplified deployment, massive scalability and fault tolerance. If you’d like to learn more about Azure, come to Learning Tree’s Windows Azure training course.

If you want to use Windows Azure, but don’t know .NET programming, come to Learning Tree’s Introduction to .NET training course.

Doug Rehnstrom

Government Should Consider Windows Azure as Part of its “Cloud-First” Strategy

Recently, the United States Chief Information Officer, Vivek Kundra, published a 25 point plan to reform the government’s IT management.

Point number 3 states that the government should shift to a “Cloud-First” policy. When describing that point, Mr. Kundra tells of a private company that managed to scale up from 50 to 4,000 virtual servers in three days, to support a massive increase in demand. He contrasts that with the government’s “Cash-For-Clunkers” program, which was overwhelmed by unexpected demand.

You might be interested in the entire report at this URL, http://www.cio.gov/documents/25-Point-Implementation-Plan-to-Reform-Federal%20IT.pdf.

Microsoft Windows Azure is perfect for this type of scenario. If your program is less successful than you hoped, you can scale down. If you’re lucky enough to be the next Twitter, you can scale up as much as you need to.  Tune your application up or down to handle spikes in demand.  You only pay for the resources that you use, and Microsoft handles the entire infrastructure for you. Scaling up or down is simply a matter of specifying the number of virtual machines required, in a configuration file.

Visual Studio and the .NET Framework make programming Windows Azure applications easy. Visual Studio automates much of the deployment of an Azure application. Web sites can be created using ASP.NET. Web services are easy with Windows Communication Foundation. There’s seamless integration of data using either Azure storage or SQL Azure. Plus, you can leverage the existing knowledge of your .NET developers.

If you prefer Java or PHP, Azure supports those as well. Most any program that will run on Windows will also run on Azure, as under the hood it’s just Windows Server 2008.

In point 3.2 of that report, it states that each agency must find 3 “must move” services to migrate to the cloud. If you’re a government IT worker or contractor trying to help meet that goal, you might be interested in learning more about Windows Azure. Come to Learning Tree course 2602, Windows Azure Platform Introduction: Programming Cloud-Based Applications.

There are many other cloud computing platforms and services besides Azure. These include Amazon EC2, Google App Engine and many others. To learn more about the broad range of cloud services and choices available, you might like to come to Learning Tree Course 1200: Cloud Computing Technologies.

Doug Rehnstrom

Microsoft Windows Azure Free Trial

If you’ve been curious about cloud-computing and Windows Azure, you might be interested in this new offer from Microsoft. They just started a trial program where you can get a month of compute hours, 3 months of SQL Azure, and 500 Mb of storage for free. Check out the offer at this page, http://www.microsoft.com/windowsazure/free-trial/default.aspx.

You can also set up a free development environment for creating Azure applications using Microsoft Visual Web Developer Express and the Azure SDK. For instructions on how to do this, check out my earlier post, Windows Azure Training Series – Setting up a Development Environment for Free.

You might also like to work your way through a series of articles I’ve written on using Azure. The links are as follows:

Windows Azure Training Series – Understanding Subscriptions and Users
Windows Azure Training Series – Setting up a Development Environment for Free
Windows Azure Training Series – Creating Your First Azure Project
Windows Azure Training Series – Understanding Azure Roles
Windows Azure Training Series – Deploying a Windows Azure Application
Windows Azure Training Series – Understanding Azure Storage
Windows Azure Training Series – Creating an Azure Storage Account
Windows Azure Training Series – Writing to Blob Storage

Kevin Kell has also written some good articles on using Windows Azure, and he has also posted some videos you might like. Check out these links:

Remote Desktop Functionality in Azure Roles
More Open Source on Azure
Microsoft Azure Does Open Source
Using C++ in an Azure Worker Role for a Compute Intensive Task
Worker Role Communications in Windows Azure – Part 2.
Worker Role Communication in Windows Azure – Part 1.

After you get done with all of that, you might be interested in Learning Tree course 2602, Windows Azure Platform Introduction: Programming Cloud-Based Applications. Whether you end up using Microsoft Windows Azure for a production application or not, it’s certainly worth learning. It’s an incredibly easy-to-use, cost-effective, massively scalable platform for deploying your applications. There’s nothing else available quite as sophisticated. Don’t take my word for it though, check it out.

Doug Rehnstrom

Windows Azure Training Series: Writing to Blob Storage

My last couple posts covered the basics of Azure storage. See, Windows Azure Training Series:  Understanding Azure Storage and Windows Azure Training Series:  Creating an Azure Storage Account. Now let’s write some code.

Accessing Blob Storage

Blob storage is accessed using the CloudBlobClient class. When creating it, specify the configuration information, as shown in the last post. Notice below, a property encapsulates the creation of this class. All methods that read or write to blob storage will utilize this property.

private static CloudBlobClient cloudBlobClient{ get { CloudStorageAccount cloudStorageAccount = CloudStorageAccount.FromConfigurationSetting("DataConnectionString"); return cloudStorageAccount.CreateCloudBlobClient(); } } 

Creating a Blob Container

Before we can write a blob, we need to create a container for it. It’s just 2 lines of code as shown below. The “containerName” variable is just a string, which represents the name of the container. A container is like a folder on a hard disk.

CloudBlobContainer container = cloudBlobClient.GetContainerReference(containerName); container.CreateIfNotExist(); 

Uploading Blobs to Containers

The following function writes a file to a blob container. Files can be uploaded using an html file upload control. Notice, you need to first get a reference to the container, and then use the UploadFromStream() method to write the file.

public static void CreateBlob(string containerName, HttpFileCollection files) { CloudBlobContainer container = cloudBlobClient.GetContainerReference(containerName); foreach (string name in files) { var file = files[name]; string blobName = System.IO.Path.GetFileName(file.FileName); CloudBlob cloudBlob = container.GetBlobReference(blobName); cloudBlob.Metadata["rightanswer"] = file.FileName; cloudBlob.UploadFromStream(file.InputStream); } } 

Listing the Files in a Blob Container

The following code will list all the files in a container specified.

CloudBlobContainer container = cloudBlobClient.GetContainerReference(containerName); return container.ListBlobs().ToList(); 

Accessing Blobs

The following code can be used to access a blob. In this case, the first blob in the container specified.

CloudBlob blob; var blobs = cloudBlobClient.GetContainerReference(containerName).ToList(); blob = blobs[0] as CloudBlob; 

Or, we can access a blob by its name as shown below.

CloudBlobContainer container = cloudBlobClient.GetContainerReference(containerName); CloudBlob cloudBlob = container.GetBlobReference(blobName); 

Deleting Blobs

The following code can be used to delete a blob.

CloudBlobContainer container = cloudBlobClient.GetContainerReference(containerName); CloudBlob cloudBlob = container.GetBlobReference(blobName); cloudBlob.Delete(); 

In the next post, we’ll take a look at the code required to write to Windows Azure Table storage.

Doug Rehnstrom

To learn more about Windows Azure, check out Learning Tree’s course, Windows Azure Platform Introduction:  Programming Cloud-Based Applications.


Learning Tree Logo

Cloud Computing Training

Learning Tree offers over 210 IT training and Management courses, including Cloud Computing training.

Enter your e-mail address to follow this blog and receive notifications of new posts by e-mail.

Join 53 other followers

Follow Learning Tree on Twitter

Archives

Do you need a customized Cloud training solution delivered at your facility?

Last year Learning Tree held nearly 2,500 on-site training events worldwide. To find out more about hosting one at your location, click here for a free consultation.
Live, online training
.NET Blog

%d bloggers like this: