2

Programmatically Accessing App Settings from Logic Apps Expressions

 1 year ago
source link: https://techcommunity.microsoft.com/t5/integrations-on-azure-blog/programmatically-accessing-app-settings-from-logic-apps/ba-p/3680407
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Programmatically Accessing App Settings from Logic Apps Expressions

Programmatically Accessing App Settings from Logic Apps Expressions
Published Nov 21 2022 06:00 AM 1,029 Views

Blog Post Contributors: Rama Krishna Rayudu (Principal Software Engineering Manager), Rohitha Hewawasam

  (Principal Software Engineering Manager) and Kent Weare (Principal Product Manager)

Recently, a customer asked about how to retrieve some details about the running Azure Logic Apps (Standard) instance. They were interested in some specific details that would help them populate error traces including:

  • Logic App URL
  • Logic App Name
  • Subscription
  • Workflow Name

The question now is how we go ahead and retrieve these values at runtime? The answer lies in expressions. However, some of the expressions used to obtain these values aren't visible, hence documenting it here. When it comes to Workflow Name, an existing property exists as part of the workflow() expression. But, for the others we can take advantage of the appsetting() expression.

Attribute Expression Example

Logic App URL

appsetting('WEBSITE_HOSTNAME')
integrate-2022-logistics.azurewebsites.net

Logic App Name

appsetting('WEBSITE_SITE_NAME')
Integrate-2022-Logistics

Subscription

appsetting('WEBSITE_OWNER_NAME')
********-****-****-****-f1f963299f8e+Integrate-2022-CanadaCentralwebspace
Workflow Name
workflow()['name']
Hello World

Here is an example of how you can retrieve the Logic App's URL by using the appsetting() expression.

thumbnail image 1 of blog post titled                                              Programmatically Accessing App Settings from Logic Apps Expressions

The next question is what other values can I take advantage of using this approach? All of the App Service app settings have been documented here: Environment variables and app settings reference - Azure App Service | Microsoft Learn.

Note: There may be some settings which are not relevant for Azure Logic Apps and as a result may not have been implemented.

But, we can look at the App Settings that have been included for your Logic Apps instance by viewing the App Settings for your Logic App (Standard) instance in Kudu. For instructions on how to access Kudu, please see the following post.

thumbnail image 2 of blog post titled                                              Programmatically Accessing App Settings from Logic Apps Expressions

To view this content in video format, please check out the following YouTube video:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK