Hi @ntropic,
Your observation appears to be correct. Indeed it does seem like the current authorization process for the Azure Service Principal is as follows:
- The driver retrieves an AzureAD token from Microsoft Azure based on the Azure properties provided in the connection configuration.
- Once the AzureAD token is retrieved, the driver makes use of the token and creates a Personal Access Token (PAT) from Databricks.
- This newly retrieved PAT is used to authenticate the REST API for Databricks.
We are not entirely sure about the reason behind this initial implementation in the Azure Databricks driver however looking at the Microsoft documentation it does look like it is possible to access the REST API without the need of a PAT from Databricks.
https://learn.microsoft.com/en-us/azure/databricks/dev-tools/service-prin-aad-token
That said, we have a ticket in our system about this and the developers are currently looking into making this change. This means once the change is implemented the driver will only use the token generated from Microsoft Azure, eliminating the need to create a Databricks PAT. We will be sure to update you once the change is made.
Thank you very much for the response