Azure

Highway To AZ-204 – Growing Occasion Primarily based Options

Intro

 

This text’s intention is to clarify the principle expertise measured on this sub-topic of the AZ-204 Certification. Azure Occasion Grid, Azure Notification Hub, and Azure Occasion hub are the principle elements that may have their fundamentals defined right here alongside a sensible instance.

 

This certification could be very intensive and this text approaches solely the principle matters, be sure to know these elements in depth earlier than taking the examination. One other nice tip is doing examination simulators earlier than the official examination in an effort to validate your information.

 

What’s the Certification AZ-204 – Growing Options for Microsoft Azure?

 

The AZ-204 – Growing Options for Microsoft Azure certification measures designing, constructing, testing, and sustaining expertise of an utility and/or service within the Microsoft Azure Cloud setting. It approaches, amongst others, these elements,

  • Azure Digital Machines;
  • Docker;
  • Azure Containers;
  • Service Internet App;
  • Azure Capabilities;
  • Cosmos DB;
  • Azure Storage;
  • Azure AD;
  • Azure Key Vault;
  • Azure Managed Identities;
  • Azure Redis Cache;
  • Azure Logic App;
  • Azure Occasion Grid;
  • Azure Occasion Hub;
  • Azure Notification Hub;
  • Azure Service Bus;
  • Azure Queue Storage.

Goal Viewers

 

Any IT skilled prepared to enhance his information in Microsoft Azure is inspired to take this certification, it’s a good way to measure your expertise inside trending applied sciences. However, some teams of execs are extra eager to take most benefit of it,

  • Azure Builders, with no less than 1 yr of expertise with Microsoft Azure;
  • Skilled Software program Builders, in search of an Architect place in a hybrid setting;
  • Software program Builders, working to maneuver purposes to the cloud setting.

Abilities Measured

 

In line with at this time’s date, the abilities which can be measured within the examination are break up as follows:

  • Develop Azure compute options (25-30%)
  • Implement Azure features
  • Develop for Azure storage (10-15%)
  • Implement Azure safety (15-20%)
  • Monitor, troubleshoot, and optimize Azure options (10-15%)
  • Hook up with and eat Azure companies and third-party companies (25- 30%)

Advantages of Getting Licensed

 

The primary profit right here is having a worldwide acknowledged certification that proves that you’ve got information of this subject. Amongst intrinsic and extrinsic advantages, now we have,

  • Increased development potential, as certifications are an enormous plus;
  • Reductions and offers in Microsoft merchandise and companions, like PluralSight and UpWork;
  • MCP Newsletters, with trending applied sciences;
  • Increased publicity on LinkedIn, as recruiters normally seek for particular certifications;
  • Increased wage, you can be extra useful to your organization;
  • Distinctive happiness when getting the outcome and also you had been authorised, figuring out that every one your efforts had been price it;

Predominant expertise Measured by this Subject

 

What’s Azure Occasion Grid?

 

Azure Occasion Grid is an Azure service to handle routing occasions from any supply to any vacation spot. It offers a easy and robust customizable occasion supply course of the place you may handle at a minimal degree which sort of occasions are going to be obtained in addition to handle at a minimal degree which subscribers are going to obtain these occasions.

It really works completely with event-based architectures the place you may subscribe to occasions from Azure sources and publish these occasions to an occasion handler or webhook. With Customized Subjects you may as well create your customized occasions to be printed in your Occasion Grid.

 

Azure Occasion Grid is grouped by Occasion Sources and Occasion Handlers. Occasion sources are the companies which can be sending info to the Occasion Grid whereas Occasion Handlers are the companies which can be going to be receiving. These days Occasion Grid helps the next Occasion Sources and Occasion Handles,

  • Occasion Sources 
    • Azure App Configuration
    • Azure Blob Storage
    • Azure Communication Providers
    • Azure Container Registry
    • Azure Occasion Hubs
    • Azure IoT Hub
    • Azure Key Vault
    • Azure Machine Studying
    • Azure Maps
    • Azure Media Providers
    • Azure useful resource teams
    • Azure Service Bus
    • Azure SignalR
    • Azure subscriptions
  • Occasion Handlers
    • Azure Automation
    • Azure Capabilities
    • Occasion Hubs
    • Relay Hybrid Connections
    • Logic Apps
    • Energy Automate 
    • Service Bus
    • Queue Storage
    • WebHooks

Azure Occasion Grid helps occasions fan-out with 24-hours retry reliability to verify occasions are delivered, it’s a serverless product to help dynamic scalability with a low price the place you solely pay for the occasions used. To ensure that a greater understanding of Occasion Grid particularities, some key ideas additionally should be higher defined as follows,

  • Area, teams Occasion Grid matters associated to the identical utility in an effort to higher administration;
  • Subject, the endpoint the place occasions are despatched
    • System Subjects, built-in matters supplied by Azure Providers;
    • Customized Subjects, purposes and third-party matters;
    • Accomplice Occasions, offers a method for third events SAAS to publish occasions;
  • Occasions, the occasion that occurred within the service;
  • Publishers, the service that printed the occasion;
  • Occasion Sources, the place the occasion came about;
  • Occasion Subscriptions, the mechanism the routes the occasions;
  • Occasion Subscriptions Expiration
  • Occasion Handlers, the app or service receiving the occasions;
  • Occasion Supply, batch or single occasions;
  • Batching, group of occasions despatched in the identical request;

What’s Azure Occasion Hub?

 

Azure Occasion Hub is an occasion ingestor, with the ability to eat tens of millions of occasions from wherever and additionally it is in a position to course of these occasions, in real-time or micro-batching, with the assistance of the auto-inflate characteristic, which scales mechanically the variety of throughput to attend your dynamic wants. It offers a simple option to join together with your Apache Kafka purposes and shoppers.   

 

Azure Occasion Hub helps you construct your large information pipeline in an effort to analyze logging, anomalies, person, and gadgets telemetry the place you solely pay for what you employ. In an effort to a greater understanding of Azure Occasion Hub, the next terminologies should be higher understood,

  • Namespace, an endpoint to obtain your occasions and distribute to occasion hubs;
  • Occasion Hub, the place your occasions are going to be delivered; 
  • Occasion Hub Cluster, devoted Occasion Hub with a 99,99% SLA;
  • Occasion Hub Seize, allow mechanically seize streaming occasions and put it aside;
  • Occasions Hubs for Apache Kafka, Occasion Hub endpoint appropriate with Apache Kafka;
  • Occasion Publishers, purposes or companies that publish occasions to an Occasion Hub;
  • Writer Coverage, a singular id used to determine publishers;
  • Partitions ordered sequence of occasions in an Occasion Hub;
  • Occasion Shopper, purposes or companies studying occasions from an Occasion Hub;
  • Shopper Group, allows a number of customers to every have a specific view from the consumed occasions;
  • Stream Offset, holds the place of an occasion inside a partition;
  • Checkpointing, the method to trace occasions which can be learn from those that aren’t;

Azure Hub X Azure Grid

 

Azure Occasion Hub and Azure Occasion Grid each deal with occasions however in a really totally different type and with a totally totally different sort of utilization as the next comparative desk reveals.

 

 

What’s Azure Notification Hub?

 

Totally different from the earlier matters, this isn’t a service to eat and publish occasions. Azure Notification Hub’s focus is to ship notifications to cellular apps in an effort to enhance app engagement or app utilization, you may filter the apps or customers which can be going to obtain these notifications with the assistance of tags and people apps will be registered inside Azure Notification Hub in two totally different fashions. 

 

Within the set up mannequin, the app sends an set up request to Azure Notification Hub with all required info to finish the set up course of. This mannequin is simpler to implement and keep.

 

Within the registration mannequin, the app sends a registration request to Azure Notification Hub with the PNS handlers and tags whereas the Azure Notification Hub solutions with the registration id. Native or generic templates can be utilized in an effort to outline the message. 

 

Azure Notification Hub important ideas:

  • Routing, the method to pick out the registrations to obtain the push notification;
    • Broadcast, all registrations are going to obtain the push notification;
    • Tag, registrations that comprise the precise tag are going to obtain the push notification;
    • Tag Expression, registrations that match the tag expressions are going to obtain the push notification;
  • Notification Hub Namespace, teams a number of Notification Hub;
  • Tags used to label purposes for higher routing expertise;
  • Templates outline the format on how the consumer goes to obtain the push notifications. Is platform-independent;
  • Platform Notification Service – PNS, every platform has its personal PNS which is accountable to ship the push notifications; 

Sensible Examples

 

Azure Occasion Grid with Azure Operate

 

Right here we’re going to configure an Occasion Subscription capturing subscribed to your Azure Subscription and having its occasions handles by an Azure Operate. 

 

Pre-requisites:

  • Existent Azure Operate App. Right here named as “samplefunctioneventgrid” and with the .Web Core 3.1 runtime stack; 

Creating the Occasion Grid with Azure Portal

 

Out of your Azure Subscription, go to Occasions after which add an Occasion Subscription.

 

Road To AZ-204 - Developing Event Based Solutions

 

Configure the Occasion Subscription to gather each occasion that occurs in your Azure Subscription and set the occasion handler because the Azure Operate.

 

Road To AZ-204 - Developing Event Based Solutions

 

Consequence

 

Road To AZ-204 - Developing Event Based Solutions

 

Testing the Occasion Grid with Azure Operate

 

Let’s delete a useful resource and test the outcome.

 

Road To AZ-204 - Developing Event Based Solutions

 

Azure Occasion Hub with .Web Core

 

Create the Occasion Hub  

 

Out of your Azure Portal, go to Occasion Hub Namespace and create a brand new one. Right here it is named as eventHubWithNetCore. 

 

Road To AZ-204 - Developing Event Based Solutions

 

Create a brand new Occasion Hub, out of your Occasion Hub Namespace go to Entities after which Occasion Hub and add a brand new one. Right here it is named sampleeventhub.

 

Road To AZ-204 - Developing Event Based Solutions

 

Consequence

 

Road To AZ-204 - Developing Event Based Solutions

 

Sending Occasions to your Azure Occasion Hub 

 

Much like what we did earlier than, we’re going to create an Occasion Grid Subscription to get occasions associated to our Azure Subscription however at the moment we’re going to use Azure Occasion Hub as an occasion handler.

 

Road To AZ-204 - Developing Event Based Solutions

 

.Web Core Software to eat occasions

Pre-Requisites

  • Existent .Web Core Undertaking;
  • Occasion-Hub Connection String;
  • Existent Blob Container. Right here named as a sample-blob container;
  • Blob Container Connection String;
  • NuGet Package deal Azure.Messaging.EventHubs;
  • NuGet Package deal Azure.Messaging.EventHubs.Processor; 

Retrieving your Occasion Hub Connection String. Out of your Occasion Hub Namespace go to Shared Entry Signatures beneath Settings.

 

Road To AZ-204 - Developing Event Based Solutions

 

Connecting and dealing with Occasions from an Occasion Hub

  1. non-public const string ehubNamespaceConnectionString = “Endpoint=sb://eventhubwithnetcore.servicebus.home windows.web/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=ARWoRUTA++GrBmNnumYvDBveo2Gkrs7cMFUCYH9euic=”;  
  2.         non-public const string eventHubName = “sampleeventhub”;  
  3.         non-public const string blobStorageConnectionString = “DefaultEndpointsProtocol=https;AccountName=storageaccountcloud8c65;AccountKey=oRVheUO8Xs/5PiimGjJoOwCA7Ee0YMCh4HQXAicCzg8noRYZMT8M2oWbyevLeodvmtv099Yj0UPJeFL23/K8RQ==;EndpointSuffix=core.home windows.web”;  
  4.         non-public const string blobContainerName = “sampleblobcontainer”;  
  5.         static async Job Predominant(string[] args)  
  6.         {  
  7.               
  8.             string consumerGroup = EventHubConsumerClient.DefaultConsumerGroupName;  
  9.   
  10.               
  11.             BlobContainerClient storageClient = new BlobContainerClient(blobStorageConnectionString, blobContainerName);  
  12.   
  13.               
  14.             EventProcessorClient processorClinet = new EventProcessorClient(storageClient, consumerGroup, ehubNamespaceConnectionString, eventHubName);  
  15.   
  16.               
  17.             processorClinet.ProcessEventAsync += ProcessEventHandler;  
  18.             processorClinet.ProcessErrorAsync += ProcessErrorHandler;  
  19.   
  20.               
  21.             await processorClinet.StartProcessingAsync();  
  22.   
  23.               
  24.             DateTime finishProcessing = DateTime.Now.AddMinutes(10);  
  25.               
  26.             whereas (DateTime.Now < finishProcessing)  
  27.             {  
  28.                   
  29.                 await Job.Delay(TimeSpan.FromSeconds(10));  
  30.             }  
  31.   
  32.               
  33.             await processorClinet.StopProcessingAsync();  
  34.         }  

Consuming a profitable occasion

  1. static async Job ProcessEventHandler(ProcessEventArgs eventArgs)  
  2.      {  
  3.            
  4.          Console.WriteLine(“tRecevied occasion: {0}”, Encoding.UTF8.GetString(eventArgs.Knowledge.Physique.ToArray()));  
  5.   
  6.            
  7.          await eventArgs.UpdateCheckpointAsync(eventArgs.CancellationToken);  
  8.      }  

Consuming an occasion with error

  1. static Job ProcessErrorHandler(ProcessErrorEventArgs eventArgs)  
  2.     {  
  3.           
  4.         Console.WriteLine($“tPartition ‘{ eventArgs.PartitionId}’: an unhandled exception was encountered.”);  
  5.         Console.WriteLine(eventArgs.Exception.Message);  
  6.         return Job.CompletedTask;  
  7.     }   

Consequence 

 

From the console window

 

Road To AZ-204 - Developing Event Based Solutions

 

From the Blob Container 

 

Road To AZ-204 - Developing Event Based Solutions

 

.Web Core Software to publish batch of occasions

Pre-Requisites

  • Existent .Web Core Undertaking;
  • Occasion-Hub Connection String;
  • Nuget Package deal Azure.Messaging.EventHubs;

Sending a random batch of occasions

  1. non-public const string connectionString = “Endpoint=sb://eventhubwithnetcore.servicebus.home windows.web/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=ARWoRUTA++GrBmNnumYvDBveo2Gkrs7cMFUCYH9euic=”;  
  2.   non-public const string eventHubName = “sampleeventhub”;  
  3.   static async Job Predominant(string[] args)  
  4.   {  
  5.       Random random = new Random();  
  6.       int numberOfEvents = random.Subsequent(5, 10);  
  7.       await utilizing (var producerClient = new EventHubProducerClient(connectionString, eventHubName))  
  8.       {  
  9.             
  10.           utilizing EventDataBatch eventBatch = await producerClient.CreateBatchAsync();  
  11.   
  12.   
  13.             
  14.           for (int i = 0; i < numberOfEvents; i++)  
  15.           {  
  16.               eventBatch.TryAdd(new EventData(Encoding.UTF8.GetBytes($“Occasion quantity {i}”)));  
  17.           }  
  18.   
  19.             
  20.           await producerClient.SendAsync(eventBatch);  
  21.           Console.WriteLine($“A batch of {numberOfEvents} occasions has been printed.”);  
  22.       }  
  23.   }  

The outcome from the console consumer

 

Road To AZ-204 - Developing Event Based Solutions

 

From Occasion Hub

 

Road To AZ-204 - Developing Event Based Solutions

 

Azure Notification Hub

 

In an effort to show an Azure Notification Hub an existent cellular app is required, and my buddy Prasanna Murali provides a wonderful walkthrough on easy methods to use it:

Tags
Show More

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Close