Are you sure you want to quit the chat?
In one of the projects my client required to have a code/process/business logic to be available on a shared location to be executed automatically/on demand by different applications. Any shared processes/applications like this require to be hosted on a server or machine. In my scenario my client had Azure subscription but was reluctant to acquire/purchase more infrastructure as client’s internal process of acquiring/approving such resources was complex and lengthy. To cut the story short that had to be SERVER LESS!
By using Azure app functions one can develop an event-driven serverless compute platform. It’s a way to run small pieces of code in the cloud. This can be built, debugged and deployed from your local machine to Azure Cloud using Visual Studio 2019 or Visual Studio 2017(you need to install the latest Azure Functions tools as extension and update in Visual studio 2017). You can develop with several languages such as C#, Python, Java,F# Typescript and Javascripts.
Azure app functions have different types of Triggers available to execute Azure app function code. Triggers are what cause a function to run. A trigger defines how a function is invoked and a function must have exactly one trigger.
I will be using three different triggers in my solution HTTP Trigger, Timer Trigger and Azure service bus queue trigger. I will explain why I have chosen these three later. Lets first see what each trigger is used for.
HTTP Trigger: Execute a function when an HTTP request is received.
Timer Trigger: Execute a function at a set interval.
Azure Service Bus trigger: Run a function when a Service Bus queue or topic message is created.
Now let me share the complete requirement
1. Web/Mobile applications should be able to execute the shared code synchronously
2. Web/Mobile application should be able to execute the shared code Asynchronously
3. A scheduled process should be able to execute this code.
I cannot use just one type of trigger-function to address all three scenarios (Synchronous, Asynchronous and scheduled process) mentioned above. So I will use three types of triggers but my shared logic will be placed only in one of the Azure app function as this is the main requirement to have a code logic in only one place and shared with different applications.
Lets see how easy it is to develop and deploy an App Function from Visual Studio:
I will give example of HTTP trigger using C# language and visual studio. The other two triggers have similar way to develop but some other configuration steps.
You can also create functions and triggers directly from Azure portal.
If you don’t have an Azure subscription, create a free account before you begin https://azure.microsoft.com/en-us/free/.
Publish in Azure from VS
Cloud Explorer lets you use Visual Studio to view the contents of the site, start and stop the function app, and browse directly to function app resources on Azure and in the Azure portal.
To access any on premise database you have to use Hybrid Connections in Azure. https://docs.microsoft.com/en-us/azure/app-service/app-service-hybrid-connections
Azure Functions uses a component called the scale controller to monitor the rate of events and determine whether to scale out or scale in.
If you expect your function to be executed by multiple clients, it would be prudent to estimate the usage and calculate the cost of using functions accordingly. It might be cheaper to host your service on a VM. If you know your maximum possible number of executions, you can estimate your cost by using below link. https://azure.microsoft.com/en-us/pricing/details/functions/
Then you can go for Durable functions options. Durable Functions allows you to orchestrate the executions of multiple functions using different patterns without any timeout. You can get more information on link below.
Suggested Read: MSAL for Vanilla JS SPA: Get JWT Access & ID Tokens
As part of the deduplication process, we also updated our reference table to reflect old-to-new key mappings. This allowed us to ensure that the correct GUIDs were assigned to the deduplicated records, maintaining the integrity of the data relationships in CRM.
At ITKnocks, we are more than an IT consulting company; we’re your strategic partner in business evolution. With a global footprint and a passion for technology, we craft innovative solutions, ensuring your success. Join us on a journey of excellence, where collaboration meets cutting-edge IT expertise.