29. // 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.CloudConfigurat
Manager.GetSetting("ServiceBusSecret"))
});
38. 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-Once
Delivery guarantee At-Least-Once
At-Most-Once
Yes
Transaction support No (through the use of local
transactions)
30 seconds (default) 60 seconds (default)
Lease/Lock duration
7 days (maximum) 5 minutes (maximum)
Yes
Batched send No (through the use of transactions
or client-side batching)
http://aka.ms/q-vs-q
39.
40. namespaceManager =
Microsoft.ServiceBus.NamespaceManager
.CreateFromConnectionString(‚…‛);
if (!namespaceManager.QueueExists(queueName))
namespaceManager.CreateQueue(queueName);
42. if (messagingFactory == null)
messagingFactory =
MessagingFactory.CreateFromConnectionString(‚…‛);
if (messageSender == null)
messageSender =
messagingFactory.CreateMessageSender(queueName);
43. 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);
44. if (messagingFactory == null)
messagingFactory =
MessagingFactory.CreateFromConnectionString(‚…‛);
if (messageReceiver == null)
messageReceiver =
messagingFactory.CreateMessageReceiver(queueName);
45. 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();
}
}
52. 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);
57. 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
Integration
Synchronization With
Facebook
63. 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;
}
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
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.