Azure / azure-kusto-python

Kusto client libraries for Python
MIT License
183 stars 107 forks source link

Does the kusto client connection expire? #546

Closed rishimalhotra2 closed 4 months ago

rishimalhotra2 commented 4 months ago

When i run the following commands, do the credentials ever expire? If so, is there a way to check for expiry so that i can reinstantiate the credentials?

kcsb = KustoConnectionStringBuilder.with_aad_managed_service_identity_authentication(
            cluster, client_id="29d4659c-b7fe-4513-91be-cb3d8df29b19"
        )

or

kcsb = KustoConnectionStringBuilder.with_az_cli_authentication(cluster)
AsafMah commented 4 months ago

The clients try to get a cached token, and refresh it when they can't.

For managed identity, it should remain refreshed with no issues.

For AzCli, while the client will try to refresh it, it will depend on az cli itself and how long it stays logged in for.

You should check the AzCli docs for more information.

For most cases, it should be seamless.