Skip to content

How to get an access token for SQL connection without an individual app_id #90

@innir

Description

@innir

I'm looking for an equivalent of this Python code where I can get an access token for a connection to a SQL database.

from azure.identity import InteractiveBrowserCredential
scope = "https://database.windows.net/.default"
token = InteractiveBrowserCredential().get_token(scope)

The closest I could get is, but I don't have an app_id at hand

scope <- "https://database.windows.net/.default"
tenant <- "common"
app_id <- "?"
token <- AzureAuth:::get_azure_token(scope, tenant, app_id, auth_type="authorization_code")

I see that there is a similar way to get a token for Azure Kusto in R:

server <- "https://myclust.westeurope.kusto.windows.net"
tenant <- "common"
token <- AzureKusto::get_kusto_token(server, tenant)

As the package defaults to the App ID of the KustoClient app that's hard-coded in the package at https://github.com/Azure/AzureKusto/blob/02188f9578f7a09106858aa3cf418a0d9dec6977/R/kusto_token.R#L2.

Any idea how to achieve the same in R for a SQL connection in a similar way as it's done in the Python module?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions