We will need a bit more information. Are you asking: A) how an external user who is skilled at code can invoke a sql query via api. or B) how a non-technical external user can run a query via a simple ui?
If it's option A: then you can create a personal access token in the portal and it can be used to call the sql execution rest api. It works well for small and medium queries. Once the result is over 16MB-20MB, i forget the exact limit, you have to retrieve the result in chunks.
https://learn.microsoft.com/en-us/azure/databricks/dev-tools/sql-execution-tutorial
https://docs.databricks.com/api/azure/workspace/statementexecution
This is the example from the docs where they invoke the sql query api from the bash shell.
