question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a warning if logged in into multiple organizations

See original GitHub issue

In https://github.com/Azure/azure-kusto-python/blob/337e4b77116b9316e617a33415068327dc0e6064/azure-kusto-data/azure/kusto/data/_token_providers.py:

folder = os.getenv("AZURE_CONFIG_DIR", None) or os.path.expanduser(os.path.join("~", ".azure"))
token_path = os.path.join(folder, "accessTokens.json")
with open(token_path) as f:
    data = json.load(f)

# TODO: not sure I should take the first
return data[0]

In case accessTokens.json contains multiple tokens, it happens that you grab the wrong credential. Raise a warning in case data has multiple elements, s.t. the user can simplify the reason for failed query.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
yogiladcommented, May 12, 2021

@kopytjuk, we had an internal discussion regarding the current implementation. Bottom line is, it was devised when there was no official integration for az-cli, and it works by delving deep into the private implementation of az. Today Azure.Identity allows for this authentication mode, therefore we will scrap our private implementation in favor of Azure.Identity.

That being said, Azure.Identity will also return one of the logged in accounts token. You may control the account being used with the az account set command. More information on az account can be found here: https://docs.microsoft.com/en-us/cli/azure/account?view=azure-cli-latest

0reactions
yogiladcommented, May 13, 2021

PR #318

Read more comments on GitHub >

github_iconTop Results From Across the Web

Show a warning on logging in via CLI for multiple organizations
When the user has multiple organizations, an exception is thrown from APB CLI while using abp login command. Check if the user has...
Read more >
Enable External Email Warning & Tag in Office 365 and Outlook
Enable the External Email Tag in Exchange Online and add a custom warning to external emails with these examples for Outlook and Office...
Read more >
How to Use the Microsoft Office 365 External Email Warning
One way to add an external email warning is by turning on the global setting that adds a callout on the email header....
Read more >
About admin alerts for suspicious login activity - Google Support
As a Google Workspace administrator, you can use email alerts to notify you if there's suspicious sign-in activity for your users. For example,...
Read more >
Sign Up to Use IPAWS to Send Public Alerts and Warnings
Step #2 – Select IPAWS Compatible Software. Access to IPAWS is free. To send a message using IPAWS, however, an organization must procure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found