Azure Functions
  • 24 May 2023
  • 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.

Log Activity
The LogActivity is an aggregator API which will do both Start+Update together in one action.

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.

New Connector - Log Activity

This is released as part of Atomic Scope V8.

Log Activity

This API is similar to our Tracking APIs' Log Activity. This is a one time request where Atomic Scope will automatically do Start / Update together. Many of our customers wanted this API exposed on the cloud so that they can avoid exhausting the messaging limit by consuming this API so there's little less number of events processed by the service bus.

Mandatory Properties are similar to other API's. But if you want activity to be continued, example you are processing Stage2 you will have to Send

As-PreviousStage and As-MainActivityId from output of previous LogActivity.

// TODO: add link after publishing
For more info you can refer our [Basics and FAQ]


Was this article helpful?