Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataverse connector breaks Environment path in new designer #1204

Open
amploid opened this issue Oct 12, 2024 · 0 comments
Open

Dataverse connector breaks Environment path in new designer #1204

amploid opened this issue Oct 12, 2024 · 0 comments

Comments

@amploid
Copy link

amploid commented Oct 12, 2024

Describe the Bug

Hi,
Yesterday I reported a problematic behaviour with the Dataverse Connector, when using manually entered environment references using parameters.

When setting up a connector and manually enters the environment, this happens when using the new designer:
Image

Followed by this little problem, during runtime:

Image

Image

As you can see the Organization property is getting wrongfully ecoded, compared to older apps that are in use.

I fought with this for many hours, until I rolled back to the Legacy Designer. The behaviour vanished, and the connector was then correct again, even when switching back to the new designer. So from my standpoint the only was I could fix this was due to the fact that the old designer is still available, since Code View now is in read-only mode for the new designer.

This is the "automagic fix" from the old designer:
Image

The screenshots are a mix of two flows created yesterday with the exact same error and behavior, in case you notice that the naming or path differs. The problem seems to be with the parsing and storing of the "Organization" value.

Please look into this since this is potential risk of huge proportions for our ongoing projects and architecture.

Plan Type

Consumption

Steps to Reproduce the Bug or Issue

  1. Create a new flow using the new designer
  2. Create a Dataverse List Rows actions
  3. Set the environment to "Edit manually" and insert a parameter
  4. Run the flow
  5. 502 Bad Gateway might appear and the input will show that the environments "https://" is encoded, causing this error

Workflow JSON

{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"env": {
"defaultValue": "REDACTED",
"type": "String"
},
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"When_a_HTTP_request_is_received": {
"type": "Request",
"kind": "Http",
"inputs": {
"schema": {
"type": "object",
"properties": {
"FirstName": {
"type": "string"
},
"LastName": {
"type": "string"
},
"Email": {
"type": "string"
},
"Country": {
"type": "string"
},
"StoreUser": {
"type": "string"
},
"OktaId": {
"type": "string"
},
"AccountNumber": {
"type": "string"
},
"Company": {
"type": "string"
}
}
}
}
}
},
"actions": {
"FindContact": {
"runAfter": {},
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['commondataservice-2']['connectionId']"
}
},
"method": "get",
"headers": {
"prefer": "odata.include-annotations=",
"accept": "application/json;odata.metadata=full",
"organization": "@{encodeURIComponent(encodeURIComponent(parameters('env')))}"
},
"path": "/api/data/v9.1/@{encodeURIComponent(encodeURIComponent('contacts'))}",
"queries": {
"$filter": "REDACTED'"
},
"retryPolicy": {
"type": "none"
}
}
},
"Switch": {
"runAfter": {
"varContactId": [
"Succeeded"
]
},
"cases": {
"0": {
"case": 0,
"actions": {
"CreateContact": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['commondataservice']['connectionId']"
}
},
"method": "post",
"body": {
"msdyn_partynumber": " ",
"lastname": " "
},
"headers": {
"prefer": "return=representation,odata.include-annotations=
",
"organization": "@parameters('env')"
},
"path": "/api/data/v9.1/@{encodeURIComponent(encodeURIComponent('contacts'))}"
}
},
"setContactIdForNewContact": {
"runAfter": {
"CreateContact": [
"Succeeded"
]
},
"type": "SetVariable",
"inputs": {
"name": "ContactId",
"value": "@Body('CreateContact')?['contactid']"
}
}
}
},
"1": {
"case": 1,
"actions": {
"setContactIdForExisting": {
"type": "SetVariable",
"inputs": {
"name": "ContactId",
"value": "@FIRST(body('FindContact')?['value']['contactid'])"
}
}
}
}
},
"default": {
"actions": {}
},
"expression": "@Length(body('FindContact')?['value'])",
"type": "Switch"
},
"varContactId": {
"runAfter": {
"FindContact": [
"Succeeded"
]
},
"type": "InitializeVariable",
"inputs": {
"variables": [
{
"name": "ContactId",
"type": "string"
}
]
}
},
"CreateContactForParty": {
"runAfter": {
"Switch": [
"Succeeded"
]
},
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['commondataservice']['connectionId']"
}
},
"method": "post",
"body": {
"[email protected]": "/cdm_companies(@{triggerBody()['Company']})",
"[email protected]": " ",
"msdyn_contactforpartynumber": " ",
"[email protected]": "/accounts(@{triggerBody()?['AccountNumber']})",
"[email protected]": "/contacts(@{variables('ContactId')})"
},
"headers": {
"prefer": "return=representation,odata.include-annotations=*",
"organization": "@{encodeURIComponent(encodeURIComponent(parameters('env')))}"
},
"path": "/api/data/v9.1/@{encodeURIComponent(encodeURIComponent('msdyn_contactforparties'))}"
}
}
},
"outputs": {}
},
"parameters": {
"$connections": {
"value": {
"commondataservice-2": {
"id": "/subscriptions/04a4ca35-9cb5-4652-b245-f1782aa43b25/providers/Microsoft.Web/locations/northeurope/managedApis/commondataservice",
"connectionId": "/subscriptions/04a4ca35-9cb5-4652-b245-f1782aa43b25/resourceGroups/STORE-MIGRATION-20241011/providers/Microsoft.Web/connections/commondataservice-2",
"connectionName": "commondataservice-2"
},
"commondataservice": {
"id": "/subscriptions/04a4ca35-9cb5-4652-b245-f1782aa43b25/providers/Microsoft.Web/locations/northeurope/managedApis/commondataservice",
"connectionId": "/subscriptions/04a4ca35-9cb5-4652-b245-f1782aa43b25/resourceGroups/STORE-MIGRATION-20241011/providers/Microsoft.Web/connections/commondataservice",
"connectionName": "commondataservice"
}
}
}
}
}

Screenshots or Videos

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant