question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

parameters.json curly brace handling not working

See original GitHub issue

Describe the Bug

The following in a parameters.json snippet works on Azure, but doesn’t work locally, with error: The provided subscription identifier '@appsetting('WORKFLOWS_SUBSCRIPTION_ID')' is malformed or invalid.

  "arm_authentication": {
    "type": "object",
    "value": {
      "api": {
        "id": "/subscriptions/@appsetting('WORKFLOWS_SUBSCRIPTION_ID')/providers/Microsoft.Web/locations/westeurope/managedApis/arm"
      },
      "connection": {
        "id": "/subscriptions/@appsetting('WORKFLOWS_SUBSCRIPTION_ID')/resourceGroups/@appsetting('WORKFLOWS_RESOURCE_GROUP_NAME')/providers/Microsoft.Web/connections/connection_arm"
      },
      "connectionRuntimeUrl": "@appsetting('CONNECTOR_ARM_RUNTIMEURL')",
      "authentication": {
        "type": "Raw",
        "scheme": "Key",
        "parameter": "@appsetting('arm-connectionKey')"
      }
    }
  },

The following in a parameters.json snippet works locally but doesn’t work on Azure. it creates a gateway timeout error going to the invoked workflow which uses this connection (i’m invoking a workflow from my main workflow, the one i’m invoking gives a timeout).

  "arm_authentication": {
    "type": "object",
    "value": {
      "api": {
        "id": "/subscriptions/@{appsetting('WORKFLOWS_SUBSCRIPTION_ID')}/providers/Microsoft.Web/locations/westeurope/managedApis/arm"
      },
      "connection": {
        "id": "/subscriptions/@{appsetting('WORKFLOWS_SUBSCRIPTION_ID')}/resourceGroups/@{appsetting('WORKFLOWS_RESOURCE_GROUP_NAME')}/providers/Microsoft.Web/connections/connection_arm"
      },
      "connectionProperties": {
        "authentication": {
          "audience": "https://management.core.windows.net/",
        NOT RELEVANT FOR SAMPLE

        }
      },
      "connectionRuntimeUrl": "@appsetting('CONNECTOR_ARM_RUNTIMEURL')",
      "authentication": {
        NOT RELEVANT FOR SAMPLE
      }
    }
  },

my connections.json:

{
  "managedApiConnections": {
    "azuresentinel": "@parameters('azuresentinel_authentication')",
    "service-now": "@parameters('servicenow_authentication')",
    "office365": "@parameters('office365_authentication')",
    "arm": "@parameters('arm_authentication')"
  }
}

So situation is:

  1. ONLY works locally: connections.json --> pointing to parameters.json where in this file it’s using is curly brackets to point to appsettings
  2. ONLY works in azure: connections.json --> pointing to parameters.json where in this file it’s NOT using curly brackets to point to appsettings

I would understand if situation 2 is not supported but situation 1 should get supported i guess…

Related to https://github.com/Azure/logicapps/issues/527, it’s about connections.json but it should be fixed for parameters.json in this situation too…

Plan Type

Standard

Steps to Reproduce the Bug or Issue

Setup the linked files like explained above and test.

I’m running in the latest runtime (v4) and using the latest v1.0.45 extension (just released).

Workflow JSON

No response

Screenshots or Videos

No response

Additional context

No response

AB#16780108

Issue Analytics

  • State:closed
  • Created 8 months ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
AbodeSaafancommented, Apr 24, 2023

@ccastrotrejo can you take a look at the first issue above where parameterizing the whole connection object is causing designer to not load in VSCode.

@erwinkramer for the las tissue you mentioned where the appsetting is not being resolved for identity, we are tracking that issue and we have a fix almost ready for it but no ETA yet on when it will be deployed out. I can update you when we have that.

1reaction
ccastrotrejocommented, Apr 24, 2023

Hi @erwinkramer thanks for raising this issue. Parameterization resolver isn’t picking the connection data when storing the whole object in parameters.json, the immediate work-around I can suggest is to keep the connection data object in connections.json . I will work on solving this issue and make it work it back again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CURL does not work with URLs with curly braces in ...
Curly brackets are unsafe in URLs. cURL (unlike Google Chrome) tries to do you a favor and automatically encodes the URL.
Read more >
Creating JSON Array without Curly Braces - Claris Community
Working my way thru my first JSON project, and have run into an issue with creating an array devoid of curly braces. A...
Read more >
Problem using curly brace { in a json string as http request
I can build the expression no problem, but where I'm having trouble is the curly braces. I can build the expression as a...
Read more >
Article: How to Escape JSON Content in the Message shape
JSON syntax contains special characters including curly braces { } and double quotation marks " " that conflict with reserved characters in ...
Read more >
Solve common issues with JSON in SQL Server
Question. I want to create a JSON text result from a simple SQL query on a single table. FOR JSON PATH and FOR...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found