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.

[@azure/identity] Uncaught Error: EnvironmentCredential is not supported in the browser.

See original GitHub issue

Package/Version: @azure/identity@1.2.1

Is your feature request related to a problem? Please describe. When I attempt to use @azure/identity in the browser I get this error: Uncaught Error: EnvironmentCredential is not supported in the browser.

Describe the solution you’d like I would like this use case to actually work. We inject env vars into the build using webpack. Its a convenient way to inject various bits in test scenarios. In our case we make a “fake” Azure Portal wrapper around our project that injects these variables into the page. Webpack will handle the injection for us, but it won’t work when this case is explicitly rejected by the identity SDK.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
bterlsoncommented, Mar 15, 2021

I think I’m fine with manually plumbing environment variables. It might be convenient for tests to have this auto-picked up but it feels like such a risky thing to enable/have built in support for. You really should think hard using env vars in the browser.

0reactions
xirzeccommented, Jul 26, 2021

@southpolesteve For the specific scenario you mention, would you be willing to consider writing a custom TokenCredential that does what you want?

Read more comments on GitHub >

github_iconTop Results From Across the Web

environmentcredential is not supported in the browser while ...
I created Azure app service with , identity system assigned and created the managed identity. I am getting this error while accessing the ......
Read more >
@azure/identity - NET
This library simplifies authentication against Azure Active Directory for Azure SDK libraries. It provides a set of TokenCredential implementations which can be ...
Read more >
Azure Identity client library for JavaScript | Microsoft Learn
A long-term fix to this problem is in progress. In the meantime, consider authenticating via the Azure CLI. Authenticate the client in browsers....
Read more >
node.js - Azure Identity Authentication DefaultAzureCredential ...
The reason you are running into AuthorizationFailed error is because it looks like you have not assigned any permissions (RBAC role) to your ......
Read more >
azure-identity - PyPI
Interactive browser - If enabled, DefaultAzureCredential will interactively authenticate a user via the default browser. This is disabled by default.
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