Final   microsoft cloud summit - windows azure building block services
Upcoming SlideShare
Loading in...5
×
 

Final microsoft cloud summit - windows azure building block services

on

  • 716 views

This is my presentation from the Dallas Cloud Summit on July 10th, 2012. It covers ACS and WIF, Cache, and Service Bus topics.

This is my presentation from the Dallas Cloud Summit on July 10th, 2012. It covers ACS and WIF, Cache, and Service Bus topics.

Statistics

Views

Total Views
716
Views on SlideShare
710
Embed Views
6

Actions

Likes
0
Downloads
1
Comments
0

1 Embed 6

http://www.stratospher.es 6

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Take some time here.
  • By definition, the use of high availability multiplies the amount of required memory for each cached item by the number of copies. Consider this memory impact during capacity planning tasks.
  • Windows Azure offers cache notifications that allow your applications to receive asynchronous notifications when a variety of cache operations occur on the cache cluster. Cache notifications also provide automatic invalidation of locally cached objects.To receive asynchronous cache notifications, add a cache notification callback to your application. When you add the callback, you define the types of cache operations that trigger a cache notification and which method in your application should be called when the specified operations occur. A named cache needs to opt-in and enable cache notifications.
  • Dedicated Demo: /Cache/Dedicated/TwitterDemoCoLocated Demo: /Cache/CoLocated/CoLocatedCacheDemoNuget: Windows Azure Cache Preview (make sure that nuget packages includes “include prerelease”)Nuget Search (ID): Microsoft.WindowsAzure.Caching
  • MVC TempData - http://rachelappel.com/when-to-use-viewbag-viewdata-or-tempdata-in-asp.net-mvc-3-applications
  • Use dedicated cache as ASP.Net session state provider (in CacheWorkerRole2).Demo: /Cache/Dedicated/SessionStateInCacheDemoShow the sections of web.config that wire up the SessionState provider, and hook it to the CacheClient.
  • Use Service Bus Relay to expose a on-premises WCF service to cloudDemo: /ServiceBus/Relay Projects/NetTcpRelayBinding/RelayDemoServer and /RelayDemoClient projects).
  • Demo: (/ServiceBus/Queue Projects/PreWin8/MultipleWorkersDemo/QueueItemCreator and /QueueItemConsumer)Demo: Wasn’t going to show this one, but you can play with it - (/ServiceBus/Queue Projects/PreWin8/QueuesOldSchool)Demo: (If you want to play with Win8, this is the equivalent in Win8/Metro) – (/ServiceBus/Queue Projects/Win8/Queues)
  • Demo: /ServiceBus/Topic Projects/PreWin8/TopicPublisher and /TopicSubscriber
  • Slide Objectives:Security is a common request of applications. However implementing **proper** security is hard. Also, additional security-related code increases complexity and attacking service to your applications. We need authentication and authorization abstracted away so we can focus on business logics.
  • Slide Objectives:Wouldn’t it be nice if “someone” can hide all complexities and just provides simple assertions to us? On Windows Azure, this “someone” is ACS + WIF.
  • Slide Objectives:Wouldn’t it be nice if “someone” can hide all complexities and just provides simple assertions to us? On Windows Azure, this “someone” is ACS + WIF.
  • The Orange Desk is a Gate Agent (Gate 35A, for example).The Green Desk is the Ticketing Counter, who the Gate Agent will send you back to if you don’t have a valid boarding pass.The Pink Desk is the US Passport Agency, and the Blue Desk is the Drivers’ License Bureau.
  • Use ACS to manage accesses using Live ID and Google ID – after this demo, add Yahoo to visualize the interface.

Final   microsoft cloud summit - windows azure building block services Final microsoft cloud summit - windows azure building block services Presentation Transcript

  • @stratospher_es http://stratospher.es
  • Memcached
  • Microsoft.ApplicationServer.Caching.DataCache cache = newMicrosoft.ApplicationServer.Caching.DataCache ("default");ObjectType myCachedObject = (ObjectType)cache.Get("cacheKey");cache.Add("cacheKey", myObjectRequiringCaching);
  • <caching> <outputCache defaultProvider="DistributedCache"> <providers> <add name="DistributedCache"type="Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider, Microsoft.Web.DistributedCache" cacheName="default" dataCacheClientName="default" /> </providers> </outputCache></caching><%@ OutputCache Duration="60" VaryByParam="*" %>
  • Memcached Shim Memcached Shim Memcached Client Memcached ServerNuget: Microsoft.WindowsAzure.Caching.MemcacheShim
  • // the endpoint that is projected back through the service bus (note: NetTcpRelayBinding)// This DNS name will be "sb://[serviceNamespace].servicebus.windows.net/solver"host.AddServiceEndpoint( typeof(IProblemSolver), new NetTcpRelayBinding(), ServiceBusEnvironment.CreateServiceUri("sb", ‚metrobus", "solver")).Behaviors.Add(new TransportClientEndpointBehavior{TokenProvider =TokenProvider.CreateSharedSecretTokenProvider("owner", Microsoft.WindowsAzure.CloudConfiguratManager.GetSetting("ServiceBusSecret"))});
  • .Behaviors.Add( new TransportClientEndpointBehavior { TokenProvider =TokenProvider.CreateSharedSecretTokenProvider("owner",Microsoft.WindowsAzure.CloudConfigurationManager.GetSetting("ServiceBusSecret")) });
  • .Behaviors.Add( new TransportClientEndpointBehavior { TokenProvider = TokenProvider.CreateSharedSecretTokenProvider( "owner", Microsoft.WindowsAzure.CloudConfigurationManager .GetSetting("ServiceBusSecret")) });
  • http://aka.ms/q-vs-q
  • http://aka.ms/q-vs-q
  • http://aka.ms/q-vs-q
  • Comparison Criteria Windows Azure Queues Service Bus Queues Yes - First-In-First-Out (FIFO)Ordering guarantee No (through the use of messaging sessions) At-Least-OnceDelivery guarantee At-Least-Once At-Most-Once YesTransaction support No (through the use of local transactions) 30 seconds (default) 60 seconds (default)Lease/Lock duration 7 days (maximum) 5 minutes (maximum) YesBatched send No (through the use of transactions or client-side batching) http://aka.ms/q-vs-q
  • namespaceManager = Microsoft.ServiceBus.NamespaceManager .CreateFromConnectionString(‚…‛);if (!namespaceManager.QueueExists(queueName)) namespaceManager.CreateQueue(queueName);
  • Endpoint= sb://<namespace>.servicebus.windows.net/; SharedSecretIssuer=<issuer>; SharedSecretValue=<sharedSecret>
  • if (messagingFactory == null) messagingFactory = MessagingFactory.CreateFromConnectionString(‚…‛);if (messageSender == null) messageSender = messagingFactory.CreateMessageSender(queueName);
  • BrokeredMessage message = new BrokeredMessage();message.Label = ‚Hello from your new message.‛message.Properties.Add( new KeyValuePair<string,object>(‚FirstName", ‚Adam"));message.Properties.Add( new KeyValuePair<string,object>(‚LastName", ‚Hoffman"));messageSender.Send(message);
  • if (messagingFactory == null) messagingFactory = MessagingFactory.CreateFromConnectionString(‚…‛);if (messageReceiver == null) messageReceiver =messagingFactory.CreateMessageReceiver(queueName);
  • BrokeredMessage message = new BrokeredMessage();// wait only 5 seconds...message = messageReceiver.Receive(new TimeSpan(0, 0, 5));if (message != null){ try{ … // Remove message from queue message.Complete(); } catch (Exception){ // Indicate a problem, unlock message in queue message.Abandon(); }}
  • namespaceManager =Microsoft.ServiceBus.NamespaceManager .CreateFromConnectionString(‚…‛);if (!namespaceManager.TopicExists(topicName)) namespaceManager.CreateTopic(topicName);
  • TopicClient topicClient =TopicClient.CreateFromConnectionString(‚…‛, topic);BrokeredMessage message = new BrokeredMessage();message.Label = ‚Hello from your new message.‛message.Properties.Add( new KeyValuePair<string,object>(‚FirstName", ‚Adam"));message.Properties.Add( new KeyValuePair<string,object>(‚LastName", ‚Hoffman"));topicClient.Send(message);
  • if (!NamespaceManager .SubscriptionExists(topicName, "AllMessages")) { NamespaceManager.CreateSubscription( topicName, "AllMessages"); ListenForMessages(topicName); }
  • MessagingFactory mf = MessagingFactory.CreateFromConnectionString(‚…‛);MessageReceiver mr = mf.CreateMessageReceiver( topicName + "/subscriptions/" + "AllMessages");BrokeredMessage message = mr.Receive();…// Remove message from subscriptionmessage.Complete();Or…// Indicate a problem, unlock message in subscriptionmessage.Abandon();
  • SqlFilter highMessagesFilter = new SqlFilter("MessageNumber > 3");NamespaceManager.CreateSubscription("TestTopic", "HighMessages",highMessagesFilter);SqlFilter highMessagesFilter = new SqlFilter(‚FirstName = ‘Adam’");NamespaceManager.CreateSubscription("TestTopic", ‚GuysNamedAdam",adamMessageFilter);MessageReceiver mr = mf.CreateMessageReceiver( topicName + "/subscriptions/" + ‚GuysNamedAdam");
  • Customer support Data Management protection UI Forget password? User store User mapping More LDAP User mapping Authentication Authorization Integration Synchronization Facebook with AD Auth API More IntegrationSynchronization With Facebook
  • IdPWIF ACS IdP
  • public class RoleSetter : ClaimsAuthenticationManager{ public override ClaimsPrincipal Authenticate(string resourceName, ClaimsPrincipal incomingPrincipal) { if (incomingPrincipal != null && incomingPrincipal.Identity.IsAuthenticated == true) { //DECIDE ON SOME CRITERIA IF CURRENT USER DESERVES THE ROLE ClaimsIdentity identity = (ClaimsIdentity)incomingPrincipal.Identity; IEnumerable<Claim> claims = identity.Claims; if (DoYourCheckHere()) ((ClaimsIdentity)incomingPrincipal.Identity).AddClaim( new Claim(ClaimTypes.Role, "Admin")); } return incomingPrincipal; }
  • <system.identityModel> <identityConfiguration> <claimsAuthenticationManager type="ClaimsTransformer.RoleSetter, ClaimsTransformer"/>…
  • if (User.IsInRole("Admin")) Response.Write("The code is 42...<br/>");else Response.Write(‚No soup for you.");
  • http://aka.ms/Azure90DayTrial http://aka.ms/MSDNAzure