Nowadays, multiple organizations are storing their data everywhere, it is in Cloud or On-premise and it is increasing day by day with the help of internet connectivity. Organizations are asking their developers to respond with highly-scalable solutions. Solutions that often require developers to implement on-demand or scheduled batch jobs to reconcile transactions, ingest and process data, or react to events in real-time. To accomplish this huge demand we have Azure functions.
Azure Functions is a serverless compute service that lets you run event-triggered code without having to explicitly provision or manage infrastructure.
Today we will see how to call an azure function from the below components.
- JavaScript
- Plugin & Custom Workflow
- Power Automate
- JavaScript: There are many scenarios where we need to execute complex logic from the client-side code.
You can use below jquery code in your JavaScript to trigger azure function and you can also pass the expected parameter in that request.
function TriggerAzurefunction()
{
var urlPath = "https:// functioncreatemultiplecontact20200723025939.azurewebsites.net/api/CreateMultipleBookings?code=XktEMAGwdjCXKIksnSKTdFKGP/iqo9WiJMYkTMObAa07bkBcYKrjaQ==&name=testname ";
if (typeof($) === 'undefined') {
$ = parent.$;
jQuery = parent.jQuery;
}
$.ajax({
url: urlPath,
type: "GET",
dataType: "json",
async: false,
crossDomain: true,
success: function (data, textStatus, xhr) {
return JSHelper.toJson(data);
},
error: function () {
}
})
.done(function (data, status, jqxhr) {
});
}
- Plugin & Custom workflow: Using webclient we can call azure function from Plugin, use below code to trigger azure function.
public void CallAzureFunction()
{
//create MemoryStream object to pass parameters
MemoryStream memoryStream = new MemoryStream();
var jsonObject = Encoding.Default.GetString(memoryStream.ToArray());
//creat web client object to call http request.
var webClient = new WebClient();
//Add required headers.
webClient.Headers[HttpRequestHeader.ContentType] = "application/json";
//Azure function URL you can query parameters as below
var serviceUrl = "https:// orderscreate.azurewebsites.net/api/Function1?code=RUydvGtO6IHRLhWjagoKUYaa0WQfJcBXq39SYSEuYbQ==&OrderNo=" + OrderNumber + "&Orderid=" + Entity.Id.ToString();
//upload the data using Post method
string response = webClient.UploadString(serviceUrl, jsonObject);
}
- Power Automate: In power automate it more easy to call azure function, it already have HTTP connector, you just need to provide function details in below properties,
1. URI: Provide azure function URL (you will get it in azure portal)
2. Headers: “code” and value, provide your azure function security code in header as shown below.
3. Queries: provide your parameters as per your requirement.

Check out my recent blog post:
- Audit History Using Azure Function
- Automate Microsoft’s Teams Meetings using Custom Connector in Power Automate.
- Sub-Grid Dependent On Another Sub-Grid.
- SharePoint Integration with Dynamics 356 using Power Automate.
- Dynamics CRM No-Code Low-Code Integrations using Power Automate (MS FLOW)
- Programmatically Create the Team’s Meeting.
- Invoke Power Automate on Creation of New Users in Azure AD
- Automate Microsoft’s Teams Meetings using Custom Connector in Power Automate.


