Skip to content

Commit ea28b52

Browse files
committed
2 parents bc09318 + 083f2b4 commit ea28b52

25 files changed

Lines changed: 269 additions & 60 deletions

README.md

Lines changed: 152 additions & 52 deletions
Large diffs are not rendered by default.

docs/AddAuthentication.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
![ContainerApp](images/add_authentication/front_end.png)
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+
![App Registration](images/add_authentication/app_reg_1.png)
13+
14+
2. Click on `App registrations` then click on the 'New registration' button to start creating the registration.
15+
16+
![New Registration](images/add_authentication/app_reg_2.png)
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+
![App Registration](images/add_authentication/app_reg_3.png)
23+
24+
4. Click to 'Add a Redirect URI'
25+
26+
![Add URL](images/add_authentication/platform_config.png)
27+
28+
5. Click to 'Add a platform'
29+
30+
![Add platform](images/add_authentication/single_page.png)
31+
32+
6. Select 'Single Page Application'
33+
34+
![Single Page App](images/add_authentication/single_page_2.png)
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+
![App Auth](images/add_authentication/app_auth.png)
46+
47+
11. Press 'Overview' on the top left view. Copy the Client ID for later use
48+
49+
50+
![Client Id](images/add_authentication/client_id.png)
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+
```
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## [Optional]: Customizing resource names
2+
3+
By default this template will use the environment name as the prefix to prevent naming collisions within Azure. The parameters below show the default values. You only need to run the statements below if you need to change the values.
4+
5+
6+
> To override any of the parameters, run `azd env set <key> <value>` before running `azd up`. On the first azd command, it will prompt you for the environment name. Be sure to choose 3-20 charaters alphanumeric unique name.
7+
8+
Change the Content Understanding Location (allowed values: Sweden Central, Australia East)
9+
10+
```shell
11+
azd env set AZURE_ENV_CU_LOCATION 'swedencentral'
12+
```
13+
14+
Change the Secondary Location (example: eastus2, westus2, etc.)
15+
16+
```shell
17+
azd env set AZURE_ENV_SECONDARY_LOCATION eastus2
18+
```
19+
20+
Change the Model Deployment Type (allowed values: Standard, GlobalStandard)
21+
22+
```shell
23+
azd env set AZURE_ENV_MODEL_DEPLOYMENT_TYPE GlobalStandard
24+
```
25+
26+
Set the Model Name (allowed values: gpt-4o-mini, gpt-4o, gpt-4)
27+
28+
```shell
29+
azd env set AZURE_ENV_MODEL_NAME gpt-4o-mini
30+
```
31+
32+
Change the Model Capacity (choose a number based on available GPT model capacity in your subscription)
33+
34+
```shell
35+
azd env set AZURE_ENV_MODEL_CAPACITY 30
36+
```
37+
38+
Change the Embedding Model
39+
40+
```shell
41+
azd env set AZURE_ENV_EMBEDDING_MODEL_NAME text-embedding-ada-002
42+
```
43+
44+
Change the Embedding Deployment Capacity (choose a number based on available embedding model capacity in your subscription)
45+
46+
```shell
47+
azd env set AZURE_ENV_EMBEDDING_MODEL_CAPACITY 80
48+
```
146 KB
Loading
99.5 KB
Loading
53 KB
Loading
35.2 KB
Loading
37.5 KB
Loading
77.8 KB
Loading
27.3 KB
Loading

0 commit comments

Comments
 (0)