Azure SDK samples for React (TypeScript)

This sample application shows how to use the TypeScript client libraries for Azure in some common scenarios.

In this sample, we build a simple Todo application in React using create-react-app and integrating with various Azure services.

  • Integration with Azure Event Hubs to support real-time updates across multiple instances of the application.

  • Integration with Azure Storage Blob for persisting ToDo attachments.

https://github.com/Azure/azure-sdk-for-js/tree/master/samples/frameworks/react/ts

Authenticating client side browser applications

For client side applications running in the browser, the InteractiveBrowserCredential provides the simplest user authentication experience and is the only credential type that we support in the browser. To get started, you will want to configure an AAD application for interactive browser authentication. Please refer to the Single-page application: App registration guide for additional information on how to configure your app registration for the browser.

You may also refer to Authenticating a user account interactively in the browser for an example of how you can use the InteractiveBrowserCredential once the app registration is configured.

AKV not work for browser

https://github.com/Azure/azure-sdk-for-js/issues/10645

sadasant commented on Aug 20, 2020

@jeremymengDefaultAzureCredential currently has the following sequence of credentials: EnvironmentCredential, ManagedIdentityCredential, AzureCliCredential and VisualStudioCodeCredential.https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/src/credentials/defaultAzureCredential.ts#L43-L52None of these work in the browser.

Also, the Key Vault service doesn’t support browser authentication yet.All of these credentials have proper errors when they fail, just like the one the user is describing: “environmentcredential is not supported in the browser”.When they run inside of the DefaultAzureCredential, these errors only bubble up if all of the credentials fail. They do appear in the logs depending on the verbosity of the logs. My main point being that if one of the credentials in the chain inside of DefaultAzureCredential pass, then no errors are reported, it just works. Granted, this is not the case for the browser, since none of these credentials are supported in the browser yet.