Using Azure service bus to send message to Salesforce - azure

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.

Related

Is that possible to send and retrieve message to queue or topic using Azure resource manager API

I am a beginner in Azure and using PHP and Azure Manager or Service REST API passing a message to queue or subscriber.
I am able to send and receive messages using a service API (servicebus.windows.net).
is that way to send and receive messages using Azure Manager API(Management.azure.com)?
No there is no way, with the management API you can do certain operations such as deleting the namespace, authorization rules, entities,etc.
Sending and Receiving messages are data operations that can only be done via the Service API.

Use a custom angular client application with Azure IoT Central

I am exploring the Azure IoT central rest APIs to create a custom Angular client. Is this possible or does it have any limitations? IoT Central is attractive due to its pricing. Specifically, I found that retrieving multiple telemetry values isn't possible as per the following documentation page. Which means you have to send individual "get" requests to fetch multiple telemetry.
Azure IoT Central (get telemetry value)
Is there a possibility to register a call back and receive regular updates of the values like in event hubs? Basically I want to develop a custom client facing app with the IoT Central Pricing. Is it possible?
It is possible, to receive regular updates on telemetry you can use continuous data export. You can export to Service Bus, Event Hubs and Blob Storage. See the documentation here on how to set that up. You can receive those events in any JavaScript application.
Please be aware that continuous data export will give you updates from all devices. If you need to filter them out you will need to build something to filter that out. One example I have built in the past is a .NET Core application that listens to the messages and sends that to the different clients over SignalR.

Azure Service Bus Topic Subscription REST API

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?

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

IOT hub to Email Notification

I am developing a Azure IOTHUB use case.
Multiple Load cells are sending continuously (every 1/2 sec) sending data to IOTHUB. (DeviceID, weight).
SQL Table with User Data .
I want to make a system that that sends an email notification on certain weight to the device owner.
What is the right approach to achieve that.
I have seen Logic apps is an option but how to implement it with multiple user account and devices.
I would use IoT Hub routing to push the messages that meet the weight criteria to a service bus queue. From there you can use an Azure Function with a Service Bus Trigger. I assume the user account information (e-mail address?) is available via a query in the SQL table. Azure Functions have a SendGrid binding that you'd then use to send out the e-mail.
Note that routing IoT Hub directly to a function is on the backlog.
Basically, there are two solutions for your scenario, when each device has own criteria on the weight:
The device twin desired property contains a weight value used for publishing a non-telemetry alert message by a real device to the Azure IoT Hub. This alert message can be routed in the Azure IoT Hub Routes to the custom endpoint the same way like is described in Jim's answer (ServiceBus->AzureFuction->SendGrid)
The second solution is more complex, generic, very flexible and it doesn't require any special coding on the device side or device twin. It's based on the standard telemetry stream pipeline with Azure Stream Analytics (ASA) job for analyzing events and generating a notification message for output to the Azure Function with SendGrid. The ASA job used a reference data (user data, weight, etc.) from the blob file generated and refreshed by SQL Database.
The following screen snippet shows this solution:
I would like to present one another approach which I think is correct too (I tested this flow):
Data is sent to the Azure IoT Hub from device
Azure Stream Analytics filters this data basing on weight and deviceID
Once data is analyzed there is a call to the Azure Function which triggers Azure Logic App with data collected from the Stream Analytics
Azure Logic App receives data (HTTP trigger) from Azure Function App
Then Logic App uses "Get row" action step to get user data from SQL Database
Last step is up to you - you can use either "SendGrid - send e-mail" action or integrate Logic App with Outlook or even Office365, Gmail and other services.
Here are the links to the documentation:
Connect to SQL Server or Azure SQL Database from Azure Logic Apps
Send emails and manage mailing lists in SendGrid by using Azure Logic Apps

Resources