While Creating a Power Automate Flow, using approvales I go the following error message:

After a few retries you get to see the Output when clicking on the “Show rap outputs” button.

{
    "statusCode": 502,
    "headers": {
        "Pragma": "no-cache",
        "x-ms-request-id": "westeurope:863c8735-22c7-44d3-a29a-a579750f193e",
        "x-ms-correlation-request-id": "863c8735-22c7-44d3-a29a-a579750f193e",
        "x-ms-flow-mobile-ios-version": "1.3.0",
        "x-ms-flow-routing-request-id": "WESTEUROPE:20210414T121928Z:863c8735-22c7-44d3-a29a-a579750f193e",
        "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
        "X-Content-Type-Options": "nosniff",
        "Timing-Allow-Origin": "*",
        "x-ms-apihub-cached-response": "true",
        "Cache-Control": "no-cache",
        "Date": "Wed, 14 Apr 2021 12:19:28 GMT",
        "Content-Length": "820",
        "Content-Type": "application/json",
        "Expires": "-1"
    },
    "body": {
        "error": {
            "code": 502,
            "source": "europe-002.azure-apim.net",
            "clientRequestId": "4872c0bd-4051-45dd-80f3-7506385675d0",
            "message": "BadGateway",
            "innerError": {
                "error": {
                    "code": "XrmApiServerError",
                    "message": "Request to XRM API failed with server error: 'The cache request to assign a role failed with status code 'BadRequest' and message: 'Message: Principal user (Id=96082ce1-9772-eb11-a812-000d3ab023b1, type=8, roleCount=1, privilegeCount=94, accessMode=4), is missing prvReadAsyncOperation privilege (Id=e84acc8f-0c61-43e3-a716-20964a483bdf) on OTC=4700 for entity 'asyncoperation'. context.Caller=5cf2b69f-439f-40f0-be5a-5005d6cf3f1b\nCode: 0x80040299\nInnerError: '.'. The tracking Id is '863c8735-22c7-44d3-a29a-a579750f193e'."
                }
            }
        }
    }
}

Based on that we’ve managed to narrow it down to the following issue:

Principal user (Id=96082ce1-9772-eb11-a812-000d3ab023b1, type=8, roleCount=1, privilegeCount=94, accessMode=4), is missing prvReadAsyncOperation privilege (Id=e84acc8f-0c61-43e3-a716-20964a483bdf) on OTC=4700 for entity 'asyncoperation'

So it turns out the user “Microsoft¬†MicrosoftFlowCDSIntegrationService” is missing read-access to the “System Job” Entity.

Adding this to the “Approvals Administrator” Security Role fixed the issue for me:

Leave a Reply

Your email address will not be published. Required fields are marked *