Posts Tagged ‘Windows Azure’

During the last BUILD 2014, Microsoft has released few updates on Azure, one of them was the latest SDK (software development kit) for developing on it. The main new updates are mainly around the different capabilities you can do through your Visual Studio, like for example creating new Virtual Machines directly from the VS. To do so you have to open your visual Studio and open Server Explorer, you will find one the available drop downs, Windows Azure, connect to your azure account by right clicking on Windows Azure then click on “Connect to Windows Azure” and sign in easily.

If you go to Virtual Machine and you right click on it, choose “Create a Virtual Machine“, you will get a wizard, where the first step is where you can choose which Azure Subscription you will be choose. After that you will follow the normal steps like creating a Microsoft Azure Virtual Machine from the portal.

Choosing the Virtual Machine OS:

Select the Machine Settings:

Select the Cloud Service you want the VM to join:

At the end, customizing the VM Endpoints as you need:

TADA! Now you can create the Virtual Machine directly from your VS.

The second feature that was added to the SDK, is that you can directly connect to your Microsoft Azure Virtual Machines or websites to directly and easily publish the new content without the usual hassle of debugging and uploading the different content of application. You can find all the details and see the different ways to debug a VM or a Website, publish new application through this MSDN link.

I also liked a new way of sending the notification to your device applications, which you can also find in the server explorer node, under the Windows Azure, the “Notification Hub“. You can also find the link here, on how to do that.

Like the same introduction for the Microsoft Azure
CDN, maybe it will be nearly the same for the Microsoft Azure Cache. The network regulation for an IT infrastructure, a better way for sending the content for the end users. If you are dealing with basic websites or HTTP protocols, the Microsoft Azure Cache Service will be the perfect match for you.

Well yes the Microsoft Cache is still in preview, however I will go to some features that might be helpful. The Microsoft Azure Cache Service is a very useful solution for building an accelerated high scalable application, there are several ways to so, based on the MSDN page there are around 3 ways to do so, one is through the Microsoft Azure Portal, you will find the Cache Service in one of the services at the left most of the page, you just need to scroll down. Or you can do the caching service through the In-Role Caching, through your Cloud Service, whether through the WebRole or even the WorkerRole and the third way is through the Sharing Cache Service, I won’t be covering this one as it will retire soon.

So to do the Microsoft Azure Caching service through the portal you will have to go to the Portal and scroll down until you find the cache Service.

Or you can go directly to the Data Services, you will find the “Cache -> Quick Create -> Continue the configuration”

cache configuration

So as normal for the region you will have to choose the nearest place to your target customers, after that we will have few Cache offerings:

  • Basic 128MB to 1GB
  • Standard 1GB to 10GB
  • Premium 5GB to 150GB

After that you can find the cache memory and you will choose what best suits you based on the cache offering chosen.

The other way the In-Role Cache, is a way to cache your data in a previously created, running role whether it was a WebRole or a WorkerRole, you can do so simply by modifying the Role Configuration file (which is ServiceConfigurationSetting) and the Client Configuration file (which is the web.config). You can do so following the instructions from the following link. In this case you don’t need anything from the caching service on the portal just you need to know and understand the capacity planning.

A new feature of Microsoft Azure has been released on the last April 2nd, not quite a very new one, but an updated one. If you are familiar with the CDN or the content Delivery network from previous engagement with Microsoft Azure than you will be certainly aware what it is about.

The CDN stands for content Delivery network, it is like a dummy datacenter that acts only for delivering the content to the customers. With the growth of the internet usage and the also the increasing number of the Cloud Consumers, the datacenter no matter how strong was its network infrastructure cannot process all the incoming requests so what really happens is, that the Microsoft CDN is mainly used for caching the Microsoft Unstructured storage (BLOB) and the static content used by the Cloud Service
(like mentioned in the MSDN page). Their main target is to deliver the content to the target customers in an easy and more effective way. You can check the locations of the latest Microsoft Azure CDNs locations, so for example if you do have an application hosted on Microsoft Azure, you can put your data (BLOB storage) or your web role (Cloud Service) in the nearest place for your customers to better serve them.

So how to work with Microsoft Azure CDN?

First thing go to your portal and go down until you find the CDN tab

Or you can directly create it by pressing “New -> app Services -> CDN -> Quick Create”, now you create CDN based on your previously created Azure Storage account or based on a Cloud Service previously created.

PS: if you choose to create a new CDN based on your storage account, you will find the origin domain will be ““. If you created based on your Cloud Service, the origin domain will be ““.

After you click the create button, you will be able to see the CDN that has been created for you in few seconds. Once you open the CDN you have created you can see all the configuration that are working on your CDN, so let me get to the CDN tabs at the bottom of the page.

What I really want go through is the manage domains, you can get you own customized domains and subdomains to map the exiting CDN domains.


To work more on Microsoft Azure CDN and to learn more about hosting Websites on Azure CDN, kindly follow this link.

Previously I have blogged about Windows Azure Blob Storage, getting here in more details about it. The Windows Azure Blob Storage is the unstructured data, where a lot of solutions and services is based on. The Windows Azure PageBlob is another type of the Blob Storage after introducing the Windows Azure BlockBlob.

The Windows Azure PageBlob is mainly used for the pages that requires a lot input and output. For example a static page that waits a lot of incoming users to complete the form. The PageBlob is mainly designed to meet all these requirements. The Maximum size of a PageBlob is 1 TB where each page blob is up to 4MB after the user finish the writing request in the page.

You can also find the following code example for building an application using .Net and C# to start working with the Windows Azure PageBlob.

static void WriteToPageBlob(Uri blobEndpoint, string accountName, string accountKey)


//Create service client for credentialed access to the Blob service.

CloudBlobClient blobClient =

new CloudBlobClient(blobEndpoint, new StorageCredentialsAccountAndKey(accountName, accountKey));

// create container if it does not exist

CloudBlobContainer cloudContainer = blobClient.GetContainerReference(“mypageblobs”);


//Get a reference to the page blob that will be created.

CloudPageBlob pageBlob = cloudContainer.GetPageBlobReference(“apageblob”);

//Generate some data to write.

byte[] data = new byte[1024];

Random rnd = new Random();


//Create a 100 MB page blob.

pageBlob.Create(100 * 1024 * 1024);

//Write two sets of pages. Note that you can write 4 MB per call to WritePages().

pageBlob.WritePages(new MemoryStream(data), 0);

pageBlob.WritePages(new MemoryStream(data), 4096);

//Populate the page blob’s attributes.


Console.WriteLine(“Blob length = {0}”, pageBlob.Properties.Length);

//Print out the current range of pages.

PrintPageRanges(“Before write to 10240:”, pageBlob);

//Write another page.

pageBlob.WritePages(new MemoryStream(data), 10240);

//Print out the new range of pages.

PrintPageRanges(“After write to 10240:”, pageBlob);

//Clear a page.

pageBlob.ClearPages(4096, 1024);

//Print out the new range of pages.

PrintPageRanges(“After clearing page at 4096:”, pageBlob);

//Delete the page blob.



static void PrintPageRanges(string msg, CloudPageBlob cloudBlob)


//Write out the page ranges for the page blob.

IEnumerable<PageRange> ranges = cloudBlob.GetPageRanges();

Console.Write(“{0}:<“, msg);

foreach (PageRange range in ranges)


Console.Write(” [{0}-{1}] “, range.StartOffset, range.EndOffset);




You can find another details about the other type of Windows Azure BlockBlob in this post.

Previously I have blogged about Windows Azure Blob Storage, getting here in more details about it. The Windows Azure Blob Storage is the unstructured data, where a lot of solutions and services is based on. The BlockBlob is a solution based on the Blob Storage that mainly helps optimize the performance. The Blob storage is a perfect way to store data, from different kind, from PDFs, Docs, to PNG, JPEG or AVIs and others.

Now to optimize the transfer of the data Windows Azure Storage introduced the Windows Azure Block Blob that helps dividing the large blobs in smaller blocks to facilitate the transfer between the Windows Azure datacenter and the clients that are trying to access the data. One of the main problems that the BlockBlob helps avoid is that when sending a specified blob to the client, an error may occur when transferring these packets, one of these packets may face any kind of problem. Dropping any kind of these packets will require the transfer of the whole blob another time. However if you are using the Windows Azure BlockBlob, when sending a BlockBlob from the server to the Client, this blob is divided into small blocks if any of these faces any kind of problems the server will only transfer the block dropped.

BlockBlob let you upload a large block efficiently uploaded. The maximum size of a block is 4 MB maximum and the maximum size of the blob block is 200 GB. Each block has a block ID and the block is not committed until you give the all the blocks their IDs. With blob block you can upload multiple blocks parallel in the same time decreasing the time of uploading. You can upload the blocks in any order and define their sequence in the final block list.

You can also find an example for building an application using .Net and C# to start working with the Windows Azure BlockBlob. You can use something like the following code, where it represents another small brief introduction into the Windows Azure BlockBlob but using the Node JS.

var azure = require(‘azure’);

var blobservice= azure.createBlobService();

var options = {contentType: request.uploadedFile.Type };

blobservice.createContainerIfNotExists(request.containerName, function(error){


response.send(statusCodes.Ok, {message:’Container Created’});



blobservice.createBlockBlobFromFile(request.containerName,request.fileName, request.uploadedFile.path, options, function(error)


response.send(statusCodes.OK, {message:’blockblob created’});



You can find another details about the other type of Windows Azure PageBlob in this post.

With the introduction of the Windows Azure Media Services, you might not need to use the Windows Azure BlockBlob especially that the Windows Azure Media Services mainly helps a lot in streaming the Media files. However if you are working with files with a large size of file, you will certainly have to think about using the Windows Azure BlockBlob.

The Windows Azure Media Services is a tool that helps the developers storing, transferring and streaming different types of media. It is basically based on the Windows Azure unstructured storage, Blob Storage. This service is mainly to help the developer with mainly three things: Upload Media, Encode Video and Deliver and Stream Video.

First of all you have to create a Media Service account on the Windows Azure, to do so go to your Windows Azure account and follow the steps.

Now Congratulations!! Let’s get in depth about the features that you can start using on the Windows Azure portal.

As you can see in the following, the home page of the media services created, normally in any home page whether in the Windows Azure Mobile Services or Windows Azure Media Services, this page helps you with the basics of the development that will help any developers. As you can see Windows Azure Media Services is only to be created using only 2 programing languages, C# and Java.

It also helps you with the development to achieve any of the previously mentioned issues the upload, the streaming or download and encode.

The last thing is you will find a sample project where you can download and go through the basic of the development whether using the C# and the Java development.

In the Dashboard, you will be able to monitor the performance and the tasks queued, delivered and failed of the Windows Azure Media Service Created. Also you can find a link where you can download the Windows Azure Media Service SDK. For your information, to start developing you will need the following 3 SDKs, the Windows Azure SDK, the Windows Azure Media Service SDK and the WCF Data Services 5.0 for OData V3 libraries.

The third tab is to help you scale your running Media Services whether for streaming or Encoding.

You can also upload some content directly to Windows Azure Media Services without the need to code or create any kind of application. You can do so not only from your local computer but from the Windows Azure Storage if previously uploaded to a Windows Azure Storage account.

The Windows Azure Service Bus Notification Hub is finally released and it is generally available to be used in the development. It supports multiple platform push notification like Google, Microsoft and apple push notification. The Notification Hub will easily help the application to reach millions of users through their mobile or windows application by simply sending them a Notification through the Service Bus.

Here are the differences between the Windows Azure Mobile Services and the Notification Hub push notification. This table is taken from Announcing General Availability of Windows Azure Notification Hubs & Support for SQL Server AlwaysOn Availability Group Listeners

Mobile Services

Notification Hubs

MPNS, WNS, APNS, and GCM support



Turnkey event-triggered push



Device registration management



Interest tags for routing messages to a subset of users



Templates for formatting messages to user preferences including language



Broadcast to >1 million devices at once within minutes



With the release of Microsoft Visual Studio 2013 preview, it didn’t support the Windows Azure SDK 2.0. So the new SDK 2.1 is specially designed to extend the Visual Studio 2013 capabilities to support the Windows Azure development. Certainly the Windows Azure SDK 2.1 also is available for the older visual studio 2010 and 2012.

The first part is related to Windows Azure Virtual Machine, is to take the full control over the Windows Azure Virtual Machine over the Windows Azure. You can now start and stop the Virtual Machine created on the Windows Azure that will help you with more control on the Visual Studio. Now the Virtual Machine after the creation the Virtual Machine, the Virtual Machine start costing you money and every minutes it cost you more as long as the Virtual Machine is running. Now you can take control over the Virtual Machine created because when you stop it, it will stop costing you and will give you the chance to save money until you start it again. This feature is available now from Visual studio directly you can start and stop the Virtual Machines.

The second main feature is the introduction of the Windows Azure Express Emulator. Beside when developing a webrole or a workerrole using the Compute emulator (Cloud Services) you can use the express emulator to run it and test it as the express one doesn’t require you to run as administrator to test your project as it uses less resources.

Certainly there are some new updates in the server explorer that can helps you get more details about your cloud services and resources.

To download Windows Azure SDK 2.1:

For the Relay Messaging Service Bus, it goes with the same process like the Brokered Messaging but only in the configuration part.

Now Congratulation you have created your Windows Azure Service Bus Relay Service on the Windows Azure.

You can follow the following instruction to create a Relay Service, however it is a lot easier than the Brokered Messaging. Before starting working on the Relay Service, I recommend that you learn more about what is the Service Bus Relay Messaging, the Brokered Messaging and what are the difference between them.

After introducing the EAI (Enterprise application Integration), and its solution the Windows Azure Service Bus and its different solution, the Brokered Messaging, the Relay Messaging and the difference between them. I went in details with the Brokered Messaging API and here I am into the Relay Service in deeper.

Unlike the Brokered Messaging target to connect multiple clients to an application, the Windows Azure Relay Service is to connect multiple application together from different datacenter, in our case one will be on the Windows Azure and the second one will be the company datacenter. The Relay service is offering to communicate multiple application across multiple datacenters to deliver reliable application.

To work with the Relay Service, this will require you to develop a WCF Service it doesn’t require more than that. All you have to do later on is to define the service bus endpoints in your configuration file and after that create the endpoint programmatically in your application using the normal WCF with defining the Service Bus Environment in it. Certainly you will have to define what type of binding you are willing to work with. Here are the types of the Binding you can work with and the differences between them, the NetTCPRelayBinding, the WSHTTPRelayBinding, the NetOneWayRelayBinding and the NetEventRelayBinding.