API to get all metastores on the account

iwan_aucamp
New Contributor III

The Unity Catalog API 2.1 only supports retrieving the unity catalogs associated with individual workspaces

> The listMetastores endpoint does not list all Metstores that exist in the customer account. Instead it restricts the list by what the Workspace (as determined by the client’s PAT token) can access.

I have checked what happens in the WebUI when I access https://accounts.azuredatabricks.net/data - and it does a GET on https://accounts.azuredatabricks.net/api/2.0/accounts/${DATABRICKS_ACCOUNT_ID}/metastores

I tried calling this using an AzureAD access token, but this is not working, I keep getting a 303 with location: https://accounts.azuredatabricks.net/login?next_url=%2Fapi%2F2.0%2Faccounts%2F...%2Fmetastores - using the exact same access token with GET on https://accounts.azuredatabricks.net/api/2.0/accounts/${DATABRICKS_ACCOUNT_ID}/scim/v2/Users works fine.

Is there some other API that I can use to get all metastores on the account? Or is there some way you can make this API work with access tokens? Would also be nice to have it in some OpenAPI spec.