{tocify} $title={Table of Contents}
Provide Connection name, Select Authentication Type as Access Key (other options are Azure AD Integrated and Logic Apps Managed Identity)
To see and use the ProcessFlag value, let's add a variable and assign it to the output of above action.
Select the Storage account name and Table from dropdown, provide value against Partition Key and Row Key.
As can be seen value was assigned to LastRunDateTime, to validate let's check in ConfigTable in Table Storage
So a row gets added in the table implicitly by logic app (It created), now again I manually triggered the logic app to test the Update functionality
Introduction
I stumbled upon a scenario where I had to decide whether a section of actions in Logic app workflow is to be executed or not based on a flag.
If Flag is True, then execute those actions else no.
Using IF Else is what is to be done, but the value(flag) to be checked is not part of data coming in.
It has to be stored somewhere which needs to be referred at runtime, as the flag value would be changed by Business Team as per their need.
Now the question was where to store it?
Options are in config file stored as blob, in a SQL Table but both of it doesn't look optimal.
So went ahead with another option - Azure Storage account Table.
What is Azure Table Storage
It is a sub-service of Azure Storage account service.
Azure Table storage is a service that stores structured NoSQL data in cloud, providing a key/attribute store with a schema less design and no relationships.
It is a collection of rows(entity). And each entity can have up to 255 properties (columns and values) out of which following property are default- Partition key, Row key and Timestamp.
Partition key and Row key are used for Indexing.
Let's see now, how to create Table in storage account, adding an entity in it then how to read the entity from Logic App and how to create/update an entity in Table using Logic app.
Create a Table in Storage account
On Azure portal search for Storage account, create one storage account
In the storage account, go to Data Storage section, select Tables and click on +Table
Provide the name and click OK.
After the table is created, let's add an entity in it.
Click on Storage Browser from left Pane -> Select Tables -> ConfigTable -> +Add entity
Click on Add Property button and add the key and its value as shown in above image.
And below is how it looks - Azure Table storage with an entity
Now, let's see how to read an entity in Logic App
Create a Logic app
Just for the sake of demo, creating a Recurrence trigger-based logic app
1. Add a Recurrence Trigger
2. Add new step, Search for Table and from the list select Get Entity or Get Entity(v2)
As this is first time we are connecting to it, following will be presented to create a Connection first
Provide Connection name, Select Authentication Type as Access Key (other options are Azure AD Integrated and Logic Apps Managed Identity)
Next provide the name of Storage account (which you created above)
To get the access key, go to storage account -> Security + networking -> Access keys and copy either key1 or key2
Provide this Access Key against Shared Storage Key
To see and use the ProcessFlag value, let's add a variable and assign it to the output of above action.
Against value provide : body('Get_entity_(V2)')?['ProcessFlag']
That's all we need to do to get value from Table storage.
Testing - Read an entity from Table
Manually triggered the logic App, checked the Run history
And it is set using the value which is returned from above action (Get entity (V2)), lets see what is output of it to get more clarity
Suppose, after finishing the above steps in Logic App, we want to log the current timestamp to denote when the last processing was done.
To achieve this we can add another entity in the table to hold this value.
We have two options to go with
1. Go to Table Storage and create an entity and update that using Logic App
2. Create and Update an entity in Logic App using single Action (Insert or Replace entity action in Logic App)
Let's see the second option, in the logic app add another action - from Azure Table Storage select Insert or Replace Entity (V2) action
As we have already created a connection to same Table storage is used, however if needed it can be changed.
Select the Storage account name and Table from dropdown, provide value against Partition Key and Row Key.
And against Entity provide following:
{
"LastRunDateTime": "utcnow()" }
That's it. Above action will create entity if it does not exist, if exist it will simply replace it
Testing - Update an entity in Table
To test, manually triggered the logic app and checked the Run history
As can be seen value was assigned to LastRunDateTime, to validate let's check in ConfigTable in Table Storage
So a row gets added in the table implicitly by logic app (It created), now again I manually triggered the logic app to test the Update functionality
Learn More about Logic App
- How to configure Logic App Standard workflow behind Azure APIM
- How to Query Azure Table storage from Logic App | How to filter results of Azure Table storage from Logic App
- Understanding expressions in Logic Apps | Frequently used expressions in Logic Apps | What is expressions in Logic App
- How to use Logic app Run History | How to troubleshoot Logic App workflow execution
- Logic App and Slack - Sending messages to slack channel | Logic app and slack integration | Connecting Logic App to Slack channel
- How to access Application settings fields value from Logic app Standard workflow | Using Application settings as configuration store for Logic app standard workflow
- Developing Logic app standard workflow which uses Map locally and deploying to Azure
- Developing Logic App Standard Workflow Using Visual Studio Code | Create Logic App Standard Workflow Using Visual Studio Code
- Logic App - Xml to Json using Liquid Map | Append in Liquid Map
- How to use Azure Event Grid Custom Topic | Publishing and Subscribing from Azure Event Grid Custom Topic using Logic App
- Using Azure Storage Account Table as Config Store for Logic Apps | How to read and write from Logic App to Azure Storage Account Table
- Get Logic App Name in Logic App
- Difference between Logic App Consumption and Logic App Standard
- Getting Started with Logic App Standard | Overview of Logic App Standard | Basics of Logic App Standard
- How to find count of Logic App executions using Azure Portal
- Azure Functions vs Azure Logic App | Difference between Azure Functions and Azure Logic App
- Getting started with Logic App : Liquid Map | Using Liquid template in Logic app
- How to get actual error message of Scope in Logic App | Exception Handling in Logic app
- Interview questions and answers on Logic Apps | Interview questions for azure logic app developers
- How to execute Stored Procedure in Logic App | How to connect to SQL in Logic App
- How to get current date in logic app | How to format date time in Logic App
- BizTalk Developer getting started with Logic App
- Getting Started with Logic Apps - Fundamentals
- Getting Started with Logic Apps - Enterprise Application Integration
- Getting Started with Logic Apps - AS2
- Getting Started with Logic Apps - EDI X12 Fundamentals
- Getting Started with Logic Apps - XML to EDI X12
- Getting Started with Logic Apps - EDI X12 to XML
- Getting Started with Logic Apps - What happened to the Request?
- Inserting Multiple Records In On Prem SQL Using Logic App
- Inserting data in On Premises SQL Database using Logic Apps
- Installing and Configuring On Premises Data Gateway - By adding user to Active Directory
- XML Batching(Aggregation) in Logic App
- Batching(Aggregating) messages in Logic App
- Debatching(Splitting) JSON Message in Logic Apps - ForEach and SplitOn
- Debatching(Splitting) XML Message in Logic Apps - ForEach and SplitOn
- Securing Logic App with Azure Active Directory authentication
- Removing ns0: prefix from xml output from BizTalk/Logic app XSLT map
- Using Managed Identity in Logic Apps for Calling Active Directory Secured Function App
- Logic Apps : Fetching ISA and GS Segment Values From Interchange Envelope and Mapping
- Logic Apps : For Each Inside a For Each - Fetching values from field in an array inside an array
- How to configure Logic App Standard workflow behind Azure APIM
- How to Query Azure Table storage from Logic App | How to filter results of Azure Table storage from Logic App
- Understanding expressions in Logic Apps | Frequently used expressions in Logic Apps | What is expressions in Logic App
- How to use Logic app Run History | How to troubleshoot Logic App workflow execution
- Logic App and Slack - Sending messages to slack channel | Logic app and slack integration | Connecting Logic App to Slack channel
- How to access Application settings fields value from Logic app Standard workflow | Using Application settings as configuration store for Logic app standard workflow
- Developing Logic app standard workflow which uses Map locally and deploying to Azure
- Developing Logic App Standard Workflow Using Visual Studio Code | Create Logic App Standard Workflow Using Visual Studio Code
- Logic App - Xml to Json using Liquid Map | Append in Liquid Map
- How to use Azure Event Grid Custom Topic | Publishing and Subscribing from Azure Event Grid Custom Topic using Logic App
- Using Azure Storage Account Table as Config Store for Logic Apps | How to read and write from Logic App to Azure Storage Account Table
- Get Logic App Name in Logic App
- Difference between Logic App Consumption and Logic App Standard
- Getting Started with Logic App Standard | Overview of Logic App Standard | Basics of Logic App Standard
- How to find count of Logic App executions using Azure Portal
- Azure Functions vs Azure Logic App | Difference between Azure Functions and Azure Logic App
- Getting started with Logic App : Liquid Map | Using Liquid template in Logic app
- How to get actual error message of Scope in Logic App | Exception Handling in Logic app
- Interview questions and answers on Logic Apps | Interview questions for azure logic app developers
- How to execute Stored Procedure in Logic App | How to connect to SQL in Logic App
- How to get current date in logic app | How to format date time in Logic App
- BizTalk Developer getting started with Logic App
- Getting Started with Logic Apps - Fundamentals
- Getting Started with Logic Apps - Enterprise Application Integration
- Getting Started with Logic Apps - AS2
- Getting Started with Logic Apps - EDI X12 Fundamentals
- Getting Started with Logic Apps - XML to EDI X12
- Getting Started with Logic Apps - EDI X12 to XML
- Getting Started with Logic Apps - What happened to the Request?
- Inserting Multiple Records In On Prem SQL Using Logic App
- Inserting data in On Premises SQL Database using Logic Apps
- Installing and Configuring On Premises Data Gateway - By adding user to Active Directory
- XML Batching(Aggregation) in Logic App
- Batching(Aggregating) messages in Logic App
- Debatching(Splitting) JSON Message in Logic Apps - ForEach and SplitOn
- Debatching(Splitting) XML Message in Logic Apps - ForEach and SplitOn
- Securing Logic App with Azure Active Directory authentication
- Removing ns0: prefix from xml output from BizTalk/Logic app XSLT map
- Using Managed Identity in Logic Apps for Calling Active Directory Secured Function App
- Logic Apps : Fetching ISA and GS Segment Values From Interchange Envelope and Mapping
- Logic Apps : For Each Inside a For Each - Fetching values from field in an array inside an array