Closed jimbobbennett closed 2 years ago
You need to escape names that include special characters:
.add database ['iotea-scales'] viewers ('aadapp=
@sloutsky - I am aware you need to escape entity names with special characters, this was mentioned in the issue.
The problem is for folks who don't know that these need to be escaped. If you don't know this, then the error is unhelpful as Syntax error:
with no actual syntax error details shown to help guide them to the answer.
My ask with this issue is to either make the error useful and report what the syntax error is, or even better be smart enough to detect that there should be a database name in that field and guide you to escaping it.
Kusto allows certain special characters in entity names, such as
-
,_
and.
. When using these names in queries you need to escape them, according to the Kusto Entity name documentation.Unfortunately, if you are not aware that these need to be escaped, and use them in queries, the error message you get just says 'Syntax error', and doesn't lead you towards solving the problem. It would be better if the error message provided more guidance.
To reproduce
I have been setting up Azure Data Explorer to show data in Grafana, using the Visualize data from Azure Data Explorer in Grafana guide. I am using my own database and table names, and my database is called
iotea-scales
.There is a set to set up Azure Active Directory, and you run this query:
I adjusted this for my database, giving the following:
When running this, I get this error:
The syntax error is not described, it is just shown as a syntax error.
Expected
The syntax error should be more descriptive, helping to find and fix the issue.
Based on the structure of the query, the text between spaces after
.add database
should be a database name, so is it possible for the parser to know this, and guide the user to escape the name if it contains special characters?