Azure / logicapps

Azure Logic Apps labs, samples, and tools
MIT License
368 stars 302 forks source link

Dataverse Connector Preview Action Failing #1179

Open aliiqbalvsi opened 1 month ago

aliiqbalvsi commented 1 month ago

Describe the Bug

Getting error on Dataverse Connector Preview Action, everything working fine yesterday. Below are the error details:

{ "statusCode": 502, "headers": { "Date": "Mon, 23 Sep 2024 18:14:18 GMT", "Content-Length": "1667", "Content-Type": "application/json" }, "body": { "Message": "The backend request failed with error code '400'", "Reason": "{\"status\":400,\"source\":\"https://logic-apis-uksouth.consent.azure-apim.net:443/api/tokens/exchange?api-version=2015-11-01-preview\",\"message\":\"Failed to retrieve token for resource=https%253A%252F%252Forgd9fc4efc.crm11.dynamics.com. Message=Failed to exchange client credentials for token. Response code=BadRequest, Details:\r\n{\\"error\\":\\"invalid_resource\\",\\"error_description\\":\\"AADSTS500011: The resource principal named https%253A%252F%252Forgd9fc4efc.crm11.dynamics.com was not found in the tenant named hidingthename.com. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant. Trace ID: 0e162f9b-417a-4c44-b418-616843640000 Correlation ID: e46854f8-3672-44a2-aad9-e9145f5a353b Timestamp: 2024-09-23 18:14:18Z\\",\\"error_codes\\":[500011],\\"timestamp\\":\\"2024-09-23 18:14:18Z\\",\\"trace_id\\":\\"0e162f9b-417a-4c44-b418-616843640000\\",\\"correlation_id\\":\\"e46854f8-3672-44a2-aad9-e9145f5a353b\\",\\"error_uri\\":\\"https://login.microsoftonline.com/error?code=500011\\"}\"}", "OperationId": "ListRecords", "ClientRequestId": "3f4afe5d-81de-490d-bee7-51e7b20be574", "ClientRequestUrl": "https://ddecfb20dd159f76.03.common.logic-uksouth.azure-apihub.net/apim/commondataservice/66d04a98732c497884ba84f008552aeb/api/data/v9.1/ef_employee?%24select=ef_name+ef_age&%24filter=ef_name+eq+'demo" } }

Screenshot: image

Plan Type

Standard

Steps to Reproduce the Bug or Issue

  1. Go to Logic App Standard
  2. Create a new HTTP triggered workflow
  3. Add Dataverse Connector and use List rows (preview) action
  4. Create a new connection and select service principal
  5. Provide Connection name, Client ID, Client Secret & Tenant and click create new button
  6. Select Environment and Table Name
  7. Save the workflow
  8. Go to the overview tab from the sidebar and run the workflow

Workflow JSON

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "List_rows_(preview)": {
                "inputs": {
                    "headers": {
                        "accept": "application/json;odata.metadata=full",
                        "organization": "@{encodeURIComponent(encodeURIComponent('hiding the url'))}",
                        "prefer": "odata.include-annotations=*"
                    },
                    "host": {
                        "connection": {
                            "referenceName": "commondataservice-1"
                        }
                    },
                    "method": "get",
                    "path": "/api/data/v9.1/@{encodeURIComponent(encodeURIComponent('ef_employee'))}",
                    "queries": {
                        "$filter": "ef_name eq 'demo'",
                        "$select": "ef_name, ef_age"
                    }
                },
                "runAfter": {},
                "type": "ApiConnection"
            },
            "Response": {
                "inputs": {
                    "statusCode": 200
                },
                "kind": "Http",
                "runAfter": {
                    "List_rows_(preview)": [
                        "SUCCEEDED"
                    ]
                },
                "type": "Response"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "triggers": {
            "When_a_HTTP_request_is_received": {
                "kind": "Http",
                "type": "Request"
            }
        }
    },
    "kind": "Stateful"
}

Screenshots or Videos

No response

Additional context

No response

JaKovac87 commented 1 month ago

+1 got this error today

d-kassian commented 1 month ago

I have also gotten this error starting Sept 25th. Going back to the Legacy actions solved it, but cannot get any of the new actions to work. This is happening for us on all the preview actions (list rows, update row, etc).

JaKovac87 commented 1 month ago

We found the reason.

On all new preview action that is created from yesterday and today this is a issue. Left hand side works so update you logic app code via the Logic App Code View under developer tools in logic app. Skip the uri encoding on organization.

I did report this via the azure portal as a bug.

                    "organization": "@{encodeURIComponent(encodeURIComponent('hiding the url'))}",

Should only be the flat URL

image

aliiqbalvsi commented 1 month ago

Yes the issue is related to the encoding in the organization field. Logic App team needs to fix it.

nagarjun-sutrave commented 1 month ago

Yes even i 'm facing this issue since yesterday.always getting 502 Response { "statusCode": 502, "headers": { "Date": "Wed, 25 Sep 2024 15:15:36 GMT", "Content-Length": "1561", "Content-Type": "application/json" }, "body": { "Message": "The backend request failed with error code '400'", "Reason": "{\"status\":400,\"source\":\"https://logic-apis-australiaeast.consent.azure-apim.net:443/api/tokens/exchange?api-version=2015-11-01-preview\",\"message\":\"Failed to retrieve token for resource=https%253A%252F%252Fvtacdevenv.crm6.dynamics.com. Message=Failed to exchange client credentials for token. Response code=BadRequest, Details:\r\n{\\"error\\":\\"invalid_resource\\",\\"error_description\\":\\"AADSTS500011: The resource principal named https%253A%252F%252Fcrm6.dynamics.com was not found in the tenant named "xxx". This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant. Trace ID: c402f49a-5e16-43f8-ae7f-c28ea5e44a00 Correlation ID: 1398644e-68f4-4374-bc3b-f3812dafd7c4 Timestamp: 2024-09-25 15:15:37Z\\",\\"error_codes\\":[500011],\\"timestamp\\":\\"2024-09-25 15:15:37Z\\",\\"trace_id\\":\\"c402f49a-5e16-43f8-ae7f-c28ea5e44a00\\",\\"correlation_id\\":\\"1398644e-68f4-4374-bc3b-f3812dafd7c4\\",\\"error_uri\\":\\"https://login.microsoftonline.com/error?code=500011\\"}\"}", "OperationId": "SubscribeWebhookTrigger", "ClientRequestId": "f6e50c50-ddf6-4126-b3e2-30a9d9af9896", "ClientRequestUrl": "https://b66f427bd6689eca.19.common.logic-australiaeast.azure-apihub.net/apim/commondataservice/c194df5242c84abcaa73ed01ac35be07/api/data/v9.1/callbackregistrations" } } image

And also Facing some other issues as below is one of them I am currently facing an issue with our Logic App(Logic apps not getting triggered or fired when some action happen in datverse entity), specifically related to reading values dynamically from the appsettings. The "URLS" are configured in the appsettings as environment variables,

Could you please assist me in resolving this issue? Any guidance on how to properly access these values would be greatly appreciated.

Thank you for your help!

bstalley commented 1 month ago

Also having this issue. Earlier Logic apps are fine. But any new dataverse actions or triggers I add have this issue where the Organization is getting encoded for some reason. organization": "@{encodeURIComponent(encodeURIComponent('https://acmne.com'))}" organization": "https://acmne.com" Removing via the code editor as mentioned above provides a work around.

cornevanklink commented 1 month ago

Facing the same issue

WayneSimpson commented 1 month ago

I'm also having this issue since yesterday and of course the Legacy connectors have now been removed! 🤯

OliverFlint commented 1 month ago

I am also experiencing this issue. And have replicated it in with two separate azure tenants.

BACBcnorris commented 1 month ago

I can confirm the same issue. We are getting the same error message.

by removing the encoding on organization does work.