Logic Apps Standard — Parameters & App settings
When you build any integration workflows, the ability to define environment specific variables in a way that can be stored securely and be defined in a seperate files per environment is very important. This sets up the CI/CD pipelines to be able to deploy to different environments, with their environment specific variables.
In logic apps standard workflows, this can be achieved using “Parameters”. Parameters are accessible from either within the workflow designer or Parameters tab from the Logic apps left hand side control blade.
Types of parameters:
Secure parameters:
As you can see from the above list, there is no visible ways to declare a secure parameter. There is an option to declare secure parameter from Logic Apps consumption. Reason why thats not available in Logic App standard is because Standard is built on Function runtime and it has the ability to define application settings.
We can define an application settings with the value as the key vault type. The following syntax retrieves the secrets from the key vault.
@Microsoft.KeyVault(VaultName=<keyVaultName>;SecretName=<secretName>)
If logic app has the right access and the right secret is available in the key vault, it will display a green tick otherwise a red tick as per the below images:
Logic App needs to have access to the key vault as below:
Key Vault with RBAC: Key Vault secret reader access
Key Vault with Access Policies: An access policy with List and Get secret access
Refer App settings from Parameters:
Once the app settings are defined, the same can be referred from Parameters with @appsetting tag.
Parameters are stored as json file and the json representation of a parameter which refers values from app settings as below:
"flatFileToFlatFileTransformLAAppID": { "type": "String", "value": "@appsetting('flatFileToFlatFileTransformLAAppID')"}
Refer parameters in the workflow:
Once the parameters are defined, any actions in the logic app workflow can refer the parameters. Triggers don’t seem to be supporting parameters at the moment.
Refer parameters in connections:
Connections can also refer application settings. Sample representation is provided below:
"AzureBlob": {"displayName": "blob-connection-dev","parameterValues": { "connectionString": "@appsetting('AzureBlob_connectionString')"},"serviceProvider": { "id": "/serviceProviders/AzureBlob" }}