February 2012 - Posts
Starting the end of February, Canada's TechDays TV will air brand new TechDays sessions (exclusive to TechDays Online). The experts will be LIVE and INTERACTIVE which means that throughout the session, as well as after the session, you’ll be able to post your questions via chat or Twitter and have them answered in real-time.
To launch this new TV channel, MS Canada chose me to talk about "Securing.NET Applications", In this session I discuss a range of security topics including: what is application security, security design and the SDL, identity Management, role-based security and claim based identity, cryptography, secure communication, and input validation. By the end of this session, I emphasized that .NET provides the tools and technologies to implement mitigations for threats identified during the security design.
If you want to watch the recording here
Enjoy
Manu
To use Service Bus, we must ensure that our firewall allows outgoing TCP communication on TCP ports 9350 to 9354. This is not a very strong request yet some customers cannot touch their firewall policy and so their firewall blocks all interaction with the service bus. In such scenarios (any many others) AppFabric REST API is the only alternative to work with the service bus.
When working with the REST API we have to construct Http request to the service bus resource we want to work with. Unfortunately the REST API documentation is not accurate. In this post I will describe how to execute basic operation against service bus topics using REST API.
All operations against the service bus requires authentication. To do that we have to call Access Control Service (ACS), prove our identity and receive a token which will be presented to Service bus. In a previous post ("Securing AppFabric Service Bus with ACS") I described in details how to configure ACS.
Let us call ACS and receive a token:
Create a Token
- public static string GetToken(string serviceNamespace, string issuerName, string issuerSecret)
- {
- var acsEndpoint = string.Format(@"https://{0}-sb.{1}/WRAPv0.9/", serviceNamespace, acsHostName);
- // Note that the realm used when requesting a token uses the HTTP scheme, even though
- // calls to the service are always issued over HTTPS
- var realm = string.Format(@"http://{0}.{1}/", serviceNamespace, sbHostName);
- var values = new NameValueCollection();
- values.Add("wrap_name", issuerName);
- values.Add("wrap_password", issuerSecret);
- values.Add("wrap_scope", realm);
- WebClient webClient = new WebClient();
- byte[] response = webClient.UploadValues(acsEndpoint, values);
- string responseString = Encoding.UTF8.GetString(response);
- var responseProperties = responseString.Split('&');
- var tokenProperty = responseProperties[0].Split('=');
- var token = Uri.UnescapeDataString(tokenProperty[1]);
- return "WRAP access_token=\"" + token + "\"";
- }
Now Let us create a topic
Create a Topic
- public static string CreateTopic(string serviceNamespace, string topicName, string token)
- {
- var topicAddress = string.Format("https://{0}.{1}/{2}", serviceNamespace, sbHostName, topicName);
- WebClient webClient = new WebClient();
- webClient.Headers[HttpRequestHeader.Authorization] = token;
- // Prepare the body of the create queue request
- var putData = @"<entry xmlns=""http://www.w3.org/2005/Atom"">
- <title type=""text"">" + topicName + @"</title>
- <content type=""application/xml"">
- <TopicDescription xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"" />
- </content>
- </entry>";
- byte[] response = webClient.UploadData(topicAddress, "PUT", Encoding.UTF8.GetBytes(putData));
- return Encoding.UTF8.GetString(response);
- }
Before sending a message to the topic let us create a subscription
Create a Subscription
- public static string CreateSubscription(string serviceNamespace, string topicName, string subscriptionName, string token)
- {
- var subscriptionAddress = string.Format("https://{0}.{1}/{2}/subscriptions/{3}", serviceNamespace, sbHostName, topicName, subscriptionName);
-
- WebClient webClient = new WebClient();
- webClient.Headers[HttpRequestHeader.Authorization] = token;
-
- // Prepare the body of the create queue request
- var putData = @"<entry xmlns=""http://www.w3.org/2005/Atom"">
- <title type=""text"">" + subscriptionName + @"</title>
- <content type=""application/xml"">
- <SubscriptionDescription xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"" />
- </content>
- </entry>";
- byte[] response = webClient.UploadData(subscriptionAddress, "PUT", Encoding.UTF8.GetBytes(putData));
- return Encoding.UTF8.GetString(response);
- }
Now we are ready to send a message. This will be described in the next post.
Enjoy
Manu
One of the most common questions customers ask is how does windows azure perform.
Well Microsoft published a series of benchmarks in an excellent web site called azurescope.
The thing is azurescope is going down on January 15th 2012 so I decided to publish these benchmarks here and make sure they will be available to the public.
Let us discuss storage types and compare their performance.
Charts on this page compare the maximum throughput achieved for the various storage types irrespective of the VM Size or values of other parameters on which the test was run. Please refer individual test cases for detailed information.
Key Analysis
- Page Blobs provide better throughput than Block Blobs.
- In best cases, Windows Azure Drives can deliver similar performance as that of a local disk.
- The observed write performance of Sql Azure is better than Windows Azure Tables while the read performance of Windows Azure Tables is better than Sql Azure.


Enjoy
Manu
One of the most common questions customers ask is how does windows azure perform.
Well Microsoft published a series of benchmarks in an excellent web site called azurescope.
The thing is azurescope is going down on January 15th 2012 so I decided to publish these benchmarks here and make sure they will be available to the public.
Let us discuss Sql Azure write latency.
This test measures the write latency observed from a Windows Azure worker role instance while accessing SQL Azure.
Key Analysis
- The number of pre-populated items have almost no affect on the observed latencies

Enjoy
Manu
One of the most common questions customers ask is how does windows azure perform.
Well Microsoft published a series of benchmarks in an excellent web site called azurescope.
The thing is azurescope is going down on January 15th 2012 so I decided to publish these benchmarks here and make sure they will be available to the public.
Let us discuss Sql Azure read latency.
This test measures the read latency observed from a Windows Azure worker role instance while accessing SQL Azure.
Key Analysis
- The number of pre-populated items have almost no affect on the observed latencies.

Enjoy
Manu
One of the most common questions customers ask is how does windows azure perform.
Well Microsoft published a series of benchmarks in an excellent web site called azurescope.
The thing is azurescope is going down on January 15th 2012 so I decided to publish these benchmarks here and make sure they will be available to the public.
Let us discuss Sql Azure write throughput.
This test measures the ability of SQL Azure to handle write requests from simultaneous clients.
Key Analysis
- Throughput increases with the increase in number of concurrent clients (NumberOfWorkers * ThreadsPerWorker), reaches a maximum limit and then decreases with further increase in the number of concurrent clients.


Enjoy
Manu
One of the most common questions customers ask is how does windows azure perform.
Well Microsoft published a series of benchmarks in an excellent web site called azurescope.
The thing is azurescope is going down on January 15th 2012 so I decided to publish these benchmarks here and make sure they will be available to the public.
Let us discuss Sql Azure read throughput.
This test measures the ability of SQL Azure to handle read requests from simultaneous clients.
Key Analysis
- Throughput increases with the increase in number of concurrent clients (NumberOfWorkers * ThreadsPerWorker) and saturates at a maximum value.
- Bigger batch size improves throughput.
- Smaller row size improves throughput.
- Employing more than one thread per worker improves throughput.


Enjoy
Manu