Skip to content

Latest commit

 

History

History

react-app

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

react-app sample

This sample was created using create-react-app.

How to run

Setup in Azure portal

  • Register a single page application in the Microsoft identity platform
  • Configure the app registration with a redirect URI to specify where the Microsoft identity platform should redirect the client along with any security tokens.
  • In this sample, we list the subscriptions available in your Azure account and the Storage accounts available in your Azure subscription. For this to work, you need to ensure that your application has the right permission for the Azure Service Management and Azure Storage APIs. To do so, follow the below instructions:
    • In your app registration in the Azure portal, go to API Permissions
    • Click on Add a permission, select Azure Service Management and check the box for user_impersonation permission
    • Click on Add a permission, select Azure Storage and check the box for user_impersonation permission
  • Keep in mind that the account administrator may need to grant admin consent for the Default Directory.

Update and run the sample

  • Copy "sample.env" as ".env" and add your own clientId, tenantId, and subscriptionId values
  • Run npm install and npm start

Some browsers may disable third party cookies by default. Since @azure/ms-rest-browserauth uses Implicit Flow to authenticate, make sure that the browser you use allows third party cookies to be stored.

Please see src/App.tsx for the most relevant example code.