Looking for an Expert Development Team? Take two weeks Trial! Try Now
Code execution modus operandi where server-side logic is created to run on stateless, event-driven, short-lived compute containers that are run entirely by third parties (MS in our case).
Incidentally, computing without a server does not work without a server; instead, it allows a third party to manage and provide your server execution.
The Azure serverless offering from Microsoft Azure is called Azure Functions.
Mathematically a function is idempotent if it satisfies f(f(x)) = f(x), which means whenever it is applied twice, it gives the same result as if it were applied once. To ensure that the function remains idempotent is to ascertain that the same input isn’t processed twice. In an asynchronous, highly parallelized environment run by short-lived compute containers, we need to implement extra catches to prevent subsequent steps are not impacted by a particular step of execution. To ensure consistency, we need to store the necessary state information with our data, if no further processing is required, allowing the work to exit beautifully.
Azure functions in particular have some built-in protective devices that you can use. For example, for a storage queue triggered function, a queue message processing will be retired five times in case of failure, after which it will be dumped into a poison-message queue.
Azure functions are the best examples of stateless protocols, meaning every time it is invoked, it will forget the details of its previous runs.
These are all event-driven and asynchronous: I am sending across a request and am not waiting for a response from the other end. It is thus necessary to use non-blocking, awaiting calls in functions.
Serverless computing makes it easy to scale the appliance by provisioning more compute resources as required and deallocating whenever the surge goes down. As a result, the developer can now take a break from the fear of failing overflow of user requests, while at the same time descoping resources when the peak time is over.
Click Home → Create a resource → Compute → Function App
Select Subscription: note that all the resources in a given Azure Subscription are billed together
Select a Resource group: a resource group, by definition, is a container of resources that share the same lifecycle, permission and policies.
Function App name: give a proper name, without an ‘_’
Publish as a ‘Code’
Runtime stack: Here you can specify what you wish your source be compiled and exposed as/the runtime you are going to use:
Region: which GEO you are going to use to hoist your FAS
Click Review + Create
Click ‘Create’ to finish the wizard.
Alternately you can switch to ‘Hosting’ tab to validate:
Storage account: Implies the under what storage account under given Azure subscription you are creating the FAS.
Operating System: you can implement the service on Linux/Windows
Plan: This is where you can specify how you wish to pay as you run your FAS. The most easy-to-use one is ‘Consumption’, which ensures ‘pay-as-you-go’.
It will take some time for the Azure app to create and get deployed.
Once deployed, click ‘go to resources’ → Functions (on the left pane) → create new function → select ‘In portal’ → Continue →
For now we are going with WebHook + API → create
Select Functions from left hand pane → On the content pane, you will see the following code:
You can try firing the function in several ways: following example shows how to hop your FAAS URL from POSTMAN:
Copy the FAAS URL and paste it in postman, add a new ‘key’ as ‘Name’ in the ‘Params’ tab and do a Post. It will print ‘Howdie %Your name value%’.
You can test it in the function window itself by pressing ‘run’
You can choose from palette of available templates:
These apart, there a load of other templates that can make your code freely be integrated with pointers like IoT, EventHubs, EventGrid, etc.
Here is a small example that can tell you how to communicate between Logic apps with FAAS.
The following example shows a logic app that can post a message to a channel whenever the message is received as a HTTP request.
@{outputs('Compose')}
", "contentType": "html" } } , "host": { "connection": { "name": "@parameters('$connections')['teams']['connectionId']" } } , "method": "post", "path": "/v3/beta/teams/@{encodeURIComponent('**')}/channels/@{encodeURIComponent('*@thread.skype')}/messages" } , "runAfter": { "Compose": [ "Succeeded"] } , "type": "ApiConnection" } } , "contentVersion": "1.0.0.0", "outputs": {} , "parameters": { "$connections": { "defaultValue": {} , "type": "Object" } } , "triggers": { "manual": { "inputs": { "schema": { "properties": { "AcqMethod": { "type": "string" } , "Description": { "type": "string" } , "PartitionKey": { "type": "string" } , "RowKey": { "type": "string" } } , "type": "object" } } , "kind": "Http", "type": "Request" } } } , "parameters": { "$connections": { "value": { "teams": { "connectionId": "/subscriptions/****/providers/Microsoft.Web/connections/teams-1", "connectionName": "teams-1", "id": "/subscriptions/*****/providers/Microsoft.Web/locations/westus/managedApis/teams" } } } } }We can collaborate various integration to third party systems using FAAS and thereby making easy communication between Dynamics 365 implementation to communicate back and forth, depending on the type of communication/interaction to engage. You can select a FAAS to use when you have an ephemeral system that needs a low frequency-high volume/high frequency-low volume record to exchange. You can expose your available entities from D365 to a third-party system, by routing it through Logic apps and then using oAuth2 to relinquish security.