Azure / Azure/LogicAppsUX

Variable with double @ not properly handled in editor

Open
#4,887 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
111
Forks
109
Avg merge
1d 23h
Merged PRs (30d)
20

Description

### Describe the Bug with repro steps

When you are parsing Graph answer you will automatically get a schema with @@odata.context (double @ instead of @ as one @ is not breaking the schema). Then if you use that variable in the graphical editor the value is null. You have to go to code and replace it with [@odata.context]() like in:

"inputs": {

"name": "nextLink",

"value": "@body('Parse\_JSON\_Get\_Azure\_Applications')?['@odata.nextLink']"

### What type of Logic App Is this happening in?

Consumption (Portal)

### Are you using new designer or old designer

New Designer

### Did you refer to the TSG before filing this issue? [https://aka.ms/lauxtsg]()

Yes

### Workflow JSON

```json
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"For_each_appid": {
"actions": {
"For_each_passwordCredential": {
"actions": {
"Condition": {
"actions": {
"Send_email_(Preview)": {
"inputs": {
"body": {
"content": {
"html": "

Azure App Registration secret is going to expire!

Application name: @{items('For_each_appid')?['displayName']}

Application id: @{items('For_each_appid')?['appId']}

Details:

Secret ID: @{items('For_each_passwordCredential')?['keyId']}

Display Name: @{items('For_each_passwordCredential')?['displayName']}

Expiration date: @{items('For_each_passwordCredential')?['endDateTime']}

Please take action as soon as possible. Registration location: https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/~/Credentials/appId/@{items('For_each_appid')?['appId']}

Please take action as soon as possible.

",
"subject": "Azure App Registration secret is going to expire - [@{items('For_each_appid')?['displayName']}]"
},
"importance": "normal",
"recipients": {
"to": [
{
"email": "@variables('report_email_address')"
}
]
},
"sender": "donotreply@shi-fw.com"
},
"host": {
"connection": {
"name": "@parameters('$connections')['acsemail']['connectionId']"
}
},
"method": "post",
"path": "/emails:send",
"queries": {
"api-version": "2021-10-01-preview"
}
},
"type": "ApiConnection"
}
},
"else": {
"actions": {}
},
"expression": {
"and": [
{
"less": [
"@items('For_each_passwordCredential')?['endDateTime']",
"@addToTime(utcNow(),14,'day')"
]
}
]
},
"type": "If"
}
},
"foreach": "@items('For_each_appid')?['passwordCredentials']",
"runAfter": {
"Set_variable_passwordCredential": [
"Succeeded"
]
},
"type": "Foreach"
},
"Set_variable_appid": {
"inputs": {
"name": "appId",
"value": "@items('For_each_appid')?['appId']"
},
"type": "SetVariable"
},
"Set_variable_displayName": {
"inputs": {
"name": "displayName",
"value": "@items('For_each_appid')?['displayName']"
},
"runAfter": {
"Set_variable_appid": [
"Succeeded"
]
},
"type": "SetVariable"
},
"Set_variable_passwordCredential": {
"inputs": {
"name": "passwordCredential",
"value": "@items('For_each_appid')?['passwordCredentials']"
},
"runAfter": {
"Set_variable_displayName": [
"Succeeded"
]
},
"type": "SetVariable"
}
},
"foreach": "@body('Parse_JSON_Get_Azure_Applications')?['value']",
"runAfter": {
"Set_nextLink_variable": [
"Succeeded"
]
},
"type": "Foreach"
},
"HTTP_Get_Azure_Applications": {
"inputs": {
"authentication": {
"audience": "https://graph.microsoft.com",
"clientId": "@body('client-id')?['value']",
"secret": "@body('client-secret')?['value']",
"tenant": "@body('tenant-id')?['value']",
"type": "ActiveDirectoryOAuth"
},
"method": "GET",
"uri": "@variables('nextLink')"
},
"runAfter": {
"Until_@odata.nextLink": [
"Succeeded"
]
},
"type": "Http"
},
"Initialize_appid": {
"inputs": {
"variables": [
{
"name": "appId",
"type": "string"
}
]
},
"runAfter": {
"client-secret": [
"Succeeded"
]
},
"type": "InitializeVariable"
},
"Initialize_displayName": {
"inputs": {
"variables": [
{
"name": "displayName",
"type": "string"
}
]
},
"runAfter": {
"Initialize_appid": [
"Succeeded"
]
},
"type": "InitializeVariable"
},
"Initialize_passwordCredential": {
"inputs": {
"variables": [
{
"name": "passwordCredential",
"type": "array"
}
]
},
"runAfter": {
"Initialize_displayName": [
"Succeeded"
]
},
"type": "InitializeVariable"
},
"Initialize_variable": {
"inputs": {
"variables": [
{
"name": "report_email_address",
"type": "string",
"value": "miroslaw.iwanowski@shi-g.com"
}
]
},
"runAfter": {},
"type": "InitializeVariable"
},
"Parse_JSON_Get_Azure_Applications": {
"inputs": {
"content": "@body('HTTP_Get_Azure_Applications')",
"schema": {
"properties": {
"@@odata.context": {
"type": "string"
},
"@@odata.nextLink": {
"type": "string"
},
"value": {
"items": {
"properties": {
"appId": {
"type": "string"
},
"displayName": {
"type": "string"
},
"id": {
"type": "string"
},
"passwordCredentials": {
"type": "array"
}
},
"required": [
"id",
"appId",
"displayName",
"passwordCredentials"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
},
"runAfter": {
"HTTP_Get_Azure_Applications": [
"Succeeded"
]
},
"type": "ParseJson"
},
"Set_nextLink_variable": {
"inputs": {
"name": "nextLink",
"value": "@body('Parse_JSON_Get_Azure_Applications')?['@odata.nextLink']"
},
"runAfter": {
"Parse_JSON_Get_Azure_Applications": [
"Succeeded"
]
},
"type": "SetVariable"
},
"Set_nextlink": {
"inputs": {
"variables": [
{
"name": "nextLink",
"type": "string",
"value": "https://graph.microsoft.com/v1.0/applications?$select=id,appId,displayName,passwordCredentials"
}
]
},
"runAfter": {
"Initialize_passwordCredential": [
"Succeeded"
]
},
"type": "InitializeVariable"
},
"Until_@odata.nextLink": {
"actions": {},
"expression": "@contains('@odata.nextLink','https')",
"limit": {
"count": 60,
"timeout": "PT1H"
},
"runAfter": {
"Set_nextlink": [
"Succeeded"
]
},
"type": "Until"
},
"client-id": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['keyvault-2']['connectionId']"
}
},
"method": "get",
"path": "/secrets/@{encodeURIComponent('ADC-LAP-AppRegistrationClientSecretNotification-client-id')}/value"
},
"runAfter": {
"tenant-id": [
"Succeeded"
]
},
"type": "ApiConnection"
},
"client-secret": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['keyvault-2']['connectionId']"
}
},
"method": "get",
"path": "/secrets/@{encodeURIComponent('ADC-LAP-AppRegistrationClientSecretNotification-client-secret')}/value"
},
"runAfter": {
"client-id": [
"Succeeded"
]
},
"type": "ApiConnection"
},
"tenant-id": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['keyvault-2']['connectionId']"
}
},
"method": "get",
"path": "/secrets/@{encodeURIComponent('ADC-LAP-AppRegistrationClientSecretNotification-tenant-id')}/value"
},
"runAfter": {
"Initialize_variable": [
"Succeeded"
]
},
"type": "ApiConnection"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"Recurrence": {
"evaluatedRecurrence": {
"frequency": "Week",
"interval": 1
},
"recurrence": {
"frequency": "Week",
"interval": 1
},
"type": "Recurrence"
}
}
},
"parameters": {
"$connections": {
"value": {
"acsemail": {
"connectionId": "/subscriptions/9612b1cc-8b9f-407e-91e3-30ee8114f3b9/resourceGroups/ADC-RG-AppsAndFunctions/providers/Microsoft.Web/connections/acsemail",
"connectionName": "acsemail",
"id": "/subscriptions/9612b1cc-8b9f-407e-91e3-30ee8114f3b9/providers/Microsoft.Web/locations/westeurope/managedApis/acsemail"
},
"keyvault-2": {
"connectionId": "/subscriptions/9612b1cc-8b9f-407e-91e3-30ee8114f3b9/resourceGroups/ADC-RG-AppsAndFunctions/providers/Microsoft.Web/connections/keyvault",
"connectionName": "keyvault",
"connectionProperties": {
"authentication": {
"type": "ManagedServiceIdentity"
}
},
"id": "/subscriptions/9612b1cc-8b9f-407e-91e3-30ee8114f3b9/providers/Microsoft.Web/locations/westeurope/managedApis/keyvault"
}
}
}
}
}
```

### Screenshots or Videos

*No response*

### Browser

Edge (newest)

### Additional context

*No response*

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.