web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Cannot connect to Azur...
Power Automate
Answered

Cannot connect to Azure Data Explorer in flow

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello Poweruser Community,

 

I am using Azure Data Explorer within flow, however am receiving a 400 bad request when connecting to Azure Data Explorer.  For reference, I have used Run Query and List Results(preview) step within the Send email on a recurring basis if Azure Kusto query returns results template. 

I have verified connection and that query returns results from: https://dataexplorer.azure.com/
in order to narrow down the issue to the connector.

Below is the telemetry associated with the bad request:
Headers

Pragma
no-cache
x-ms-request-id
ac203ac9-fee9-4fdd-85fb-baeeb60e05e8
Strict-Transport-Security
max-age=31536000; includeSubDomains
X-Content-Type-Options
nosniff
X-Frame-Options
DENY
Timing-Allow-Origin
*
x-ms-apihub-cached-response
true
Cache-Control
no-store, no-cache
Date
Fri, 13 Mar 2020 00:39:35 GMT
Set-Cookie
ARRAffinity=c0c0e2cbf160983fb14d8f38467064b10673a9e32c4b8ae701adc9d95cb6deba;Path=/;HttpOnly;Domain=kusto-wcus.azconn-wcus-01.p.azurewebsites.net
Content-Length
7850
Content-Type
application/json
Expires
-1


Body

{
"ClassName": "Kusto.Data.Exceptions.SemanticException",
  "Message": "clientRequestId: ac203ac9-fee9-4fdd-85fb-baeeb60e05e8",
  "Data": null,
  "InnerException": null,
  "HelpURL": null,
  "StackTraceString": "   at Kusto.Cloud.Platform.Http.KustoHttpClient.<ThrowKustoExceptionFromResponseMessageAsync>d__4.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kusto.Data.Net.Client.RestClient2.<MakeHttpRequestAsyncImpl>d__40.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kusto.Cloud.Platform.Utils.MonitoredActivity.<InvokeAsync>d__15`2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Kusto.Cloud.Platform.Utils.MonitoredActivity.<InvokeAsync>d__15`2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kusto.Data.Net.Client.RestClient2.<MakeHttpRequestAsync>d__38.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Kusto.Data.Net.Client.RestClient2.<ExecuteQueryAsync>d__27.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.Azure.Connectors.KustoConnector.Controllers.KustoController.<ForwardRequestToKustoAsync>d__27.MoveNext() in X:\\bt\\1026498\\repo\\src\\source\\SAAS\\Kusto\\Controllers\\KustoController.cs:line 369",
  "RemoteStackTraceString": null,
  "RemoteStackIndex": 0,
  "ExceptionMethod": "8\nMoveNext\nKusto.Data, Version=6.1.8.0, Culture=neutral, PublicKeyToken=829a00acde12d551\nKusto.Cloud.Platform.Http.KustoHttpClient+<ThrowKustoExceptionFromResponseMessageAsync>d__4\nVoid MoveNext()",
  "HResult": -2146233088,
  "Source": "Kusto.Data",
  "WatsonBuckets": null,
  "creationMessage": null,
  "creationContext": {
    "Timestamp": "2020-03-13T00:39:36.1354884Z",
    "ServiceAlias": "",
    "MachineName": "RD00155D063F24",
    "ProcessName": "w3wp",
    "ProcessId": 9204,
    "ThreadId": 25972,
    "AppDomainName": "/LM/W3SVC/296980501/ROOT-1-132282821686374824",
    "ActivityContext": {
      "ActivityId": "18b42e0f-cb48-4eb1-9622-56af5f5bc262",
      "SubActivityId": "18b42e0f-cb48-4eb1-9622-56af5f5bc262",
      "ParentActivityId": "18b42e0f-cb48-4eb1-9622-56af5f5bc262",
      "ClientRequestId": "ac203ac9-fee9-4fdd-85fb-baeeb60e05e8",
      "ActivityType": "DN-RestClient-ExecuteControlCommand"
    },
    "ActivityStack": "(Activity stack: CRID=ac203ac9-fee9-4fdd-85fb-baeeb60e05e8 ARID=18b42e0f-cb48-4eb1-9622-56af5f5bc262 > DN-RestClient-ExecuteControlCommand/18b42e0f-cb48-4eb1-9622-56af5f5bc262)",
    "TracingContext": null,
    "MonitoredActivityContext": {
      "Created": "2020-03-13T00:39:35.3854432Z",
      "Activity": {
        "ActivityId": "18b42e0f-cb48-4eb1-9622-56af5f5bc262",
        "SubActivityId": "18b42e0f-cb48-4eb1-9622-56af5f5bc262",
        "ParentActivityId": "18b42e0f-cb48-4eb1-9622-56af5f5bc262",
        "ClientRequestId": "ac203ac9-fee9-4fdd-85fb-baeeb60e05e8",
        "ActivityType": "DN-RestClient-ExecuteControlCommand"
      }
    },
    "TestContext": null
  },
  "ErrorCode": "SEM0001",
  "ErrorReason": "BadRequest",
  "ErrorMessage": "Ensure that expression: deploymentPayload.[\"DeploymentRequestAction\"] is indeed a simple name",
  "DatabaseName": "ClxProd",
  "ClientRequestId": "ac203ac9-fee9-4fdd-85fb-baeeb60e05e8",
  "ActivityId": "ed09b29b-627a-48cd-9761-18f79fccd9b4",
  "Text": "let migrationDetails = ClxStateEvents \n| where (message contains 'DeploymentServiceDBMigrationWorkflow') and TIMESTAMP between (datetime(2020-01-27) .. datetime(2020-01-29))\n| extend eploymentPayload = parsejson(payload) \n| extend RequestAction = tostring(deploymentPayload[\"DeploymentRequestAction\"]) \n| extend deploymentPayload = parsejson(payload) \n| extend TopologyName = tostring(deploymentPayload[\"TopologyName\"]) \n| extend RequestAction = tostring(deploymentPayload[\"DeploymentRequestAction\"]) \n| extend EnvironmentId = tostring(deploymentPayload[\"EnvironmentId\"]) \n| extend EnvironmentName = tostring(deploymentPayload[\"EnvironmentName\"]) \n| extend DataCenter = tostring(deploymentPayload[\"DataCenter\"]) \n| extend SubscriptionId = tostring(deploymentPayload[\"AzureSubscription\"]) \n| extend ExecutionTime = round(todouble(duration)/60, 2) \n| extend TenantId = tostring(deploymentPayload[\"TenantId\"]) \n| extend ProjectId = tolong(strcat(\"0x\",substring(TenantId, 2, 6))) \n| extend EnvironmentDetails = strcat(\"https://lcs.dynamics.com/V2/EnvironmentDetailsV3New/\",ProjectId,\"?EnvironmentId=\",EnvironmentId) \n| extend ApplicationVersion = strcat(tostring(deploymentPayload[\"ApplicationVersion\"]),\" [\",tostring(deploymentPayload[\"AX7Version\"]),\"] - \",tostring(deploymentPayload[\"AX7Branch\"])) \n| extend TopologySkuType = tostring(deploymentPayload[\"TopologySkuType\"]) \n| project startTime, endTime, ExecutionTime,PreciseTimeStamp,ActivityId, ProjectId,EnvironmentId,EnvironmentName,stateStatus,EnvironmentDetails,SubscriptionId,TenantId,ApplicationVersion,TopologySkuType,DataCenter,TopologyName, payload; \nlet activityids = migrationDetails | distinct ActivityId; \nlet request = ClxExecutionEvents \n| where ActivityId in (activityids) \n| where component == \"DeploymentServiceEngine\" and message contains \"Attempting to Migrate the [[\" \n| distinct ActivityId, message \n| project ActivityId, DatabaseTypes = message; \nlet result = ClxExecutionEvents  \n| where ActivityId in (activityids) \n| where component == \"DeploymentServiceEngine\" and message contains \"returned status of\" \n| distinct ActivityId, message \n| project ActivityId, MigrationResult = message; \nmigrationDetails \n| join kind = leftouter (request) on $left.ActivityId == $right.ActivityId \n| join kind = leftouter (result) on $left.ActivityId == $right.ActivityId \n| extend DatabaseTypes = trim_end(\"\\\\]\\\\] Database to Elastic Pool\", trim_start(\"Attempting to Migrate the \\\\[\\\\[\", DatabaseTypes))\n| extend MigrationState = trim_end(\"\\\\]\",trim_start(\"State \\\\[\",extract(\"State \\\\[([A-Za-z0-9]+?)\\\\]\",0,MigrationResult))) \n| extend MigrationStatus = trim_end(\"\\\\]\",trim_start(\"Staus \\\\[\",extract(\"Staus \\\\[([A-Za-z0-9]+?)\\\\]\",0,MigrationResult))) \n| project  \nActivityId,  \nProjectId, \nEnvironmentName, \nDatabaseTypes, \nstateStatus, \nMigrationState, \nMigrationStatus, \nEnvironmentId, \nTenantId, \nSubscriptionId,  \nstartTime,  \nendTime,  \nExecutionTime,  \nPreciseTimeStamp,  \nEnvironmentDetails, \nApplicationVersion, \nTopologySkuType, \nDataCenter, \nTopologyName,  \npayload;",
  "SemanticErrors": "Ensure that expression: deploymentPayload.[\"DeploymentRequestAction\"] is indeed a simple name"
}

 

Categories:
I have the same question (0)
  • Verified answer
    rimatos Profile Picture
    Microsoft Employee on at

    Hi @cclaiborne

     

    I just verified that this post is a duplicate from: https://powerusers.microsoft.com/t5/Connecting-To-Data/400-bad-request-when-using-Azure-Data-Explorer/td-p/497901

     

    With this said, apart from the suggestion that was presented in the previous post, I would also check on the query that you are using if there are no errors inserted.

     

    The error message that you are getting with the 400 bad request is the following:


     "ErrorMessage": "Ensure that expression: deploymentPayload.[\"DeploymentRequestAction\"]  is indeed a simple name", 

     

    As such, I would start by verifying the query that you are using and see what is being included in this deployentPayload. If you are using this as a custom property or custom measurement in an aggregation function, you should cast them to their exact type.

     

    Also verify if there might be any typos in writing this expression, which could also be causing this issue. 

     

     

    Hope this helps!

     

    Regards,

    Ricardo

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 103 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 87

#3
trice602 Profile Picture

trice602 63 Super User 2026 Season 1

Last 30 days Overall leaderboard