I have trouble fetching values (using the @appsetting()
expression) from environment variables to parameters.json and connections.json in Azure Logic Apps Standard. I ran into an issue with the SQL trigger when relying on this approach. Is this normal?
STEPS TO REPRODUCE
- Create a test database with a test table - adding the necessary permissions for a logic app instance to said database (must be able to read and create tables)
- Configure the SQL database name and server name into environment variables
- Specify a SQL connection in the connections.json. Something like:
{
"serviceProviderConnections": {
"sql": {
"parameterValues": {
"serverName": "@appsetting('test_sql_server_name')",
"databaseName": "@appsetting('test_sql_db_name')",
"authProvider": {
"Type": "ManagedServiceIdentity"
}
},
"serviceProvider": {
"id": "/serviceProviders/sql"
},
"displayName": "Test-SQL"
}
}
}
- Add a SQL 'When a row if modified' in-app trigger to a workflow
- Insert/update row in the test table
EXPECTED RESULTS
- The SQL trigger fires normally
ACTUAL RESULTS
- The SQL trigger does not fire. Furthermore, there is no indication of an error anywhere
PS. There is a limitation in the V2 telemetry when a trigger fails. This seems like an additional oversight. Switching to the V1 telemetry does reveal an exception and an "Access denied" error. But rather than a permissions problem, it looks like the trigger is unable to expand the @appsetting()
expression. The trigger (+ creating the necessary tracking tables in the az_func schema) does work when typing the literal server and database names into parameterValues instead.