Azure Service Bus Topic Subscription REST API - azure

How do I use Azure REST APIs to subscribe to a service bus topic? I want to create a subscription with "Enable Sessions" as the ordering of messages is very important for me. I have the below code that works now, that registers a message handler.
subscriptionClient.RegisterSessionHandler(ProcessMessagesInSessionAsync, sessionHandlerOptions);
However, I want to implement this using REST API. Is this possible?

Related

Using Azure service bus to send message to Salesforce

I am working on a POC where I have a publisher which is publishing message to Azure Service Bus using Topics. Multiple subscribers have subscribed to the topic.
One of the subscriber wants to send message to Salesforce. What is the best way to send message to Salesforce
I have following options in mind:
Use Azure function to listen to Service bus and then connect with Salesforce to send data. Not sure if a connector already exists.
Read data from Service bus using a .net client and then send message to Azure Logic Apps. From Logic app use Salesforce connector to send message to Salesforce. Not sure if Logic apps can directly subscribe to Service bus.
What are pros can cons of both the options ?
Both approaches are valid but the one to chose depends on the level of comfort you have with the aforementioned technologies.
Integration with Salesforce is done via REST API. The LogicApps connector simplifies it quite a bit. Except, I would not read data from Service Bus message using a .NET client and then send message to Azure Logic Apps, but rather trigger Logic Apps with an incoming message using Service Bus connector and invoke Salesforce connector. This way there will be less moving parts.
In case you’re comfortable with Salesforce REST API, Function is a valid approach as well.

Azure Service Bus queues

I'm new to azure cloud and my assignments requires me to implement service bus queues.
Question: Implement the Service Bus queues in your application. By using the queues and Service Bus, you will be able to manage the communication between the N-tier applications in Azure.
I have made a library management system using .net C# and not in MVC. and deployed it in the cloud. I don't know how to implement it.
Do i need to make new project for service bus or can i implement it on the existing system.
I have made a form page with Fullname, Email, Subject and Message Box. there is submit Button and onclick event can i implement service bus queue? help please. Thank you for time. Sorry for asking question in unclear manner. New to stackoverflow.
I believe you have already create the service bus queue, still you may check https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-quickstart-portal for your reference.
Then, you need to leverage the nuget pacakges in your project so that you can send messages to and receive messages from a Service Bus queue :
https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dotnet-get-started-with-queues
For more related details : https://github.com/toddkitta/azure-content/blob/master/articles/service-bus/service-bus-dotnet-how-to-use-queues.md
https://www.c-sharpcorner.com/article/azure-service-bus-queues/
https://www.c-sharpcorner.com/article/azure-service-bus-and-queue-implementation-using-c-sharp-small-intro-and-sample-app/
https://azuresdkdocs.blob.core.windows.net/$web/dotnet/Azure.Messaging.ServiceBus/7.0.0-preview.1/api/index.html

Read message from multiple service bus topics subscription using logic app

I have scenario that I want to read all messages from all topics a and a specific subscription using azure logic app connector.
Example: topic ATopic, BTopic has a same name "TestSubscription" subscription
Using azure logic app I want to read all topics messages on above "TestSubscription"
I have mark in read in below image at particular place I want a dynamic topic name
The common pattern for scenarios like this is to have a Logic App for each Trigger/Topic/Subscription.
Then these Logic Apps, two in your case, call a third work Logic App which does any real message processing.
You can use the Event Grid trigger if you have Service Bus premium, to subscribe to Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event. Once the Logic App is triggered, you can then use the Service Bus action to retrieve the actual message and process it.

Can we subscribe an email ID or Cell number as subscriber to Azure event hubs/notification hubs?

In my python application, if any bad/good event happens, I want to send the event details as notification message to user's email addresses or phone #s that have been subscribed to this application. So I am looking for publisher-subscriber model azure cloud
Looks like multiple Azure services achieving similar goal but having a thin line of differences. Event hubs and notification hubs seems promising. So my question is as follows:
Can email ID/phone # be subscribed to Azure event hub and receive the message being sent/produced to Azure event hub?
If not event hub, what is the correct option? Can I achieve it with Service bus or Notification hub?
In AWS, there is a service called SNS (Simple Notification Service) where one can subscribe email/phone number and opt for receiving event messages about that application. I am looking for equivalent to that in Azure.
You can use the Azure Logic Apps / Azure Functions with Event Hubs to achieve this easily.
Using logic apps you can do like simple as below image.
Logic Apps has many in-build connectors for most all Azure Services, you can use Event-hubs,Service bus,SQL etc.,
You can find all the list of available connectors here
Update 1
Once you connected the Event-Hubs to send an Email connector, you will automatically get all the available source data from event-hubs to email task. See below
You can achieve this by using Azure Application Insights. With this, you will be able to monitor your application and receive alerts during application unavailabillity, failures or even during performance issue.
Check this https://learn.microsoft.com/en-us/azure/application-insights/app-insights-tutorial-alert

Using Azure Service Bus in a user subscription model

How would you go about using Service Bus in a scenario where only client applications with unexpired subscriptions can receive messages from the service bus? Let's say you have a paid service where users can buy subscriptions to your messages for a period of time, so you want your service bus to send new messages only to a selected group of clients (clients with active subscriptions). It is much preferred if authorization for this is done on the server side and not on the client app. Looking at the service bus models (queues, topics, relays), none of them seem to fit this use case.
One way I was thinking to implement this was to change the SAS Key every day and get client applications to query the SAS key from a Web API. So only clients with valid subscriptions can refresh their SAS and receive from the service bus. I don't know if SAS could be changed through the API, though.
Is there any better support for this kind of scenario in Azure Service Bus, or can you think of a better way to implement it?

Resources