|
| 1 | +## Retrieve necessary pre-requisite information |
| 2 | +1. Navigate to the resource group containing the solution |
| 3 | +2. Open the frontend container application |
| 4 | + |
| 5 | +  |
| 6 | + |
| 7 | +3. Copy the Application Uri from the app and save it for later use |
| 8 | + |
| 9 | +## Add and configure an Entra App Identity for the Application |
| 10 | +1. In the Azure Portal, Click on `Microsoft Entra ID` from the Azure services bar at the top of the window. |
| 11 | + |
| 12 | +  |
| 13 | + |
| 14 | +2. Click on `App registrations` then click on the 'New registration' button to start creating the registration. |
| 15 | + |
| 16 | +  |
| 17 | + |
| 18 | +3. Fill in the display name for your app registration and press the 'Register' button. |
| 19 | + |
| 20 | + This returns you to the main app registration page. |
| 21 | + |
| 22 | +  |
| 23 | + |
| 24 | +4. Click to 'Add a Redirect URI' |
| 25 | + |
| 26 | +  |
| 27 | + |
| 28 | +5. Click to 'Add a platform' |
| 29 | + |
| 30 | +  |
| 31 | + |
| 32 | +6. Select 'Single Page Application' |
| 33 | + |
| 34 | +  |
| 35 | + |
| 36 | +9. Copy the Application Uri you saved into the 'Redirect URIs' text box |
| 37 | + Select the 'ID tokens (used for implicit and hybrid flows)' checkbox and press 'Configure |
| 38 | + |
| 39 | + To run locally with Authentication configured, select to add another redirect URL, and configure it with a redirect URL of http://localhost:5173. Select the 'ID tokens' checkbox as before. Then repeat this process again with a URL of http://localhost:3000 |
| 40 | + |
| 41 | + When finished you will be back on the authentication page of the app identity |
| 42 | + |
| 43 | +10. Fill in the Front-channel logout URL with the application URI and click the 'Save' button |
| 44 | + |
| 45 | +  |
| 46 | + |
| 47 | +11. Press 'Overview' on the top left view. Copy the Client ID for later use |
| 48 | + |
| 49 | + |
| 50 | +  |
| 51 | + |
| 52 | +## Add Environment Variables to the front end Container App |
| 53 | +Follow the [directions in the documentation ](https://learn.microsoft.com/en-us/azure/container-apps/environment-variables?tabs=portal#add-environment-variables-on-existing-container-apps)to add environment variables on existing container apps, to add the following environment variables and values to your front end container. |
| 54 | + |
| 55 | + ``` |
| 56 | + REACT_APP_MSAL_AUTH_CLIENTID="<which you copied from above step>" |
| 57 | + REACT_APP_MSAL_AUTH_AUTHORITY="https://login.microsoftonline.com/<your tenant ID>" |
| 58 | + REACT_APP_MSAL_REDIRECT_URL="/" |
| 59 | + REACT_APP_MSAL_POST_REDIRECT_URL="/" |
| 60 | + ``` |
| 61 | + |
| 62 | + For local debugging, configure your local variables as follows: |
| 63 | + |
| 64 | + ``` |
| 65 | + VITE_APP_MSAL_AUTH_CLIENTID="<which you copied from above step>" |
| 66 | + VITE_APP_MSAL_AUTH_AUTHORITY="https://login.microsoftonline.com/<your tenant ID>" |
| 67 | + VITE_APP_MSAL_REDIRECT_URL="/" |
| 68 | + VITE_APP_MSAL_POST_REDIRECT_URL="/" |
| 69 | + ``` |
0 commit comments