Azure Functions
  • 27 May 2020
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Azure Functions

  • Dark
    Light
  • PDF

Article Summary

There are four main Azure Functions which servers as an API for the Logic App Custom Connectors.

Start Activity
This is the first step in starting an activity to push data inside Atomic Scope.

Update Activity
The update activity function is used to update the object created in the StartActivity with the parameters provided.

Archive Activity
This can be used to archive the message body at any point of time using the AS-Archive Message Header as true.

Log Exception Activity
The Log Exception Activity is used to log an exception on a specific stage using an exception message and exception code.

All the functions are accessible via their HTTP endpoint to post data to Atomic Scope.

Configuration and corresponding Header Values

  • Business Process Name – AS-BusinessProcess
  • Business Transaction Name-AS-BusinessTransaction
  • Stage Name-AS-CurrentStage
  • API Resource ID (for localhost) – AS-ResourceId
  • Resource Group Name (Azure Function) – x-ms-workflow-resourcegroup-name
  • Subscription Id (Azure Function) -x-ms-workflow-subscription-id

Note: Function App settings from the Azure portal can have mandatory headers or you can pass these header values from the received request.

Start Activity

The request to the start activity should contain the above mandatory headers as well as message body in the below format.

{
"MessageBody": "some message...",
"MessageHeader":"headers.."
}

The Start Activity response will contain the MainActivityId and StageActivityId which are mandatory to be passed to the Update Activity function.

Update Activity

We need to send the response of Start Activity as headers or parameters to the Update Activity function. Add the response as headers with the flag to Archive the message inside Atomic Scope and call the Update Activity Azure function.

LogException Activity

To Log an Exception in a transaction you can make use of this to post an Exception / Failure with status code and reason. To do so , you will need the StageActivityId from the startActivity response.

The AS-StageActivityId should be passed in the header and it is mandatory to Log an Exception. You can also pass the other parameters in the headers with respective values. The parameters are listed below.

  • AS-ExceptionMessage - The actual reason for exception / Failure
  • AS-ExceptionCode - HTTP Code / Custom code for error
  • AS-BusinessProcess - Name of the Business Process
  • AS-StageActivityId - StageActivityId from the response of StartActivity.

All the above parameters are mandatory for Logging an exception.

Archive Activity

To archive a message pass the message in the similar format to StartActivity with the below mandatory headers.

  • AS-BusinessProcess: Name of the Business Process
  • AS-StageActivityId - StageActivityId from the response of StartActivity.
  • AS-BusinessTransaction: Name of the Business Transaction
  • AS-CurrentStage: Current Stage under execution

You can also Archive the message within the Start / Update Activities setting the AS-ArchiveMessage to True in the headers for those activities.


Was this article helpful?