Reputation: 2276
Approach 1
Created an ADX activity in ADF, and in the command field, I wrote the purge command (which I copied from Azure Docs):
.purge table MyTable in database DBName allrecords
I tried running the purge command but it keeps returning syntax error: BadRequest_SyntaxError: Request is invalid and cannot be executed
Approach 2
Created a Web Activity in ADF, where I used a Linked Service, and set the following config:
Base URL as the URI of the Kusto cluster: https://<clusterName>.<region>.kusto.windows.net
Authentication: System Assigned Managed Identity
Resource: https://<clusterName>.<region>.kusto.windows.net
(URI of the Kusto cluster)
Relative URL: v1/rest/mgmt
Method: POST
Body:
{
"db": "DBName",
"csl": ".purge table MyTable in database DBName allrecords"
}
But it also returns the same error: BadRequest_SyntaxError: Request is invalid and cannot be executed
The user/role has Admin privileges to the cluster and Purge is enabled from the ADX Config.
Note that I'm not using the ingest-
endpoint here to run purge because I couldn't get it to work and there isn't info available in the docs as to where to put the ingest-
endpoint URL.
Upvotes: 0
Views: 103
Reputation: 25955
it sounds like you're using the wrong URL/endpoint - as mentioned in the documentation: "Purge execution is invoked by running purge table TableName records command on the Data Management endpoint https://ingest-[YourClusterName].[Region].kusto.windows.net."
Upvotes: 0