Skip to content

Commit 4d9bc8e

Browse files
committed
updating readmes, deployment script
1 parent bf02913 commit 4d9bc8e

9 files changed

Lines changed: 206 additions & 188 deletions

azure.yaml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
# # yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json
22
# metadata:
33
# template: azd-init@1.11.1
4-
environment:
5-
name: content-processing-service
6-
location: eastus
4+
name: content-processing
5+
76
metadata:
8-
name: content-processing-service@1.0
9-
10-
parameters:
11-
solutionPrefix:
12-
type: string
13-
default: cps-azdtest
7+
template: content-processing@1.0
8+
name: content-processinge@1.0
149

1510
hooks:
1611
preprovision:
@@ -21,8 +16,3 @@ hooks:
2116
shell: pwsh
2217
run: $timestamp = Get-Date -Format "yyyyMMdd-HHmmss"; $logFile = "azd_preprovision_$timestamp.log"; ./infra/scripts/docker-build.ps1 $env:AZURE_SUBSCRIPTION_ID $env:AZURE_ENV_NAME $env:AZURE_LOCATION $env:AZURE_RESOURCE_GROUP $env:USE_LOCAL_BUILD *>&1 | Tee-Object -FilePath $logFile
2318

24-
deployment:
25-
mode: Incremental
26-
template: ./infra/main.bicep # Path to the main.bicep file inside the 'infra' folder
27-
parameters:
28-
solutionPrefix: ${parameters.solutionPrefix}

docs/ConfigureAppAuthentication_withImage.md

Lines changed: 77 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -3,106 +3,107 @@
33
This document provides step-by-step instructions to configure Azure App Registrations for a front-end and back-end application.
44

55
## Prerequisites
6+
67
- Access to **Azure Active Directory (Azure AD)**
78
- Necessary permissions to create and manage **App Registrations**
89

9-
## Step 1: Add Authentication Provider
10-
We will add Microsoft Entra ID as an authentication provider to API and Web Application.
10+
## Step 1: Add Authentication Provider
11+
12+
We will add Microsoft Entra ID as an authentication provider to API and Web Application.
13+
14+
1. Add Authentication Provider in Web Application
1115

12-
1. Add Authentication Provider in Web Application
13-
14-
- Go to deployed Container App and select ca-< your environment >-< randomname >-web and click **Add Identity Provider** button in Authentication
15-
![add_auth_provider_web_1](./Images/add_auth_provider_web_1.png)
16+
- Go to deployed Container App and select `ca-<your environment>-<randomname>-web` and click **Add Identity Provider** button in Authentication.
17+
![add_auth_provider_web_1](./Images/add_auth_provider_web_1.png)
1618

17-
- Select **Microsoft** and set **Client secret expiration** then Click **Add** button
18-
![add_auth_provider_web_2](./Images/add_auth_provider_web_2.png)
19+
- Select **Microsoft** and set **Client secret expiration**, then click **Add** button.
20+
![add_auth_provider_web_2](./Images/add_auth_provider_web_2.png)
1921

20-
2. Add Authentication Provider in API Service
21-
22-
- Go to deployed Container App and select **ca-< your environment >-< randomname >-api** and click **Add Identity Provider** button in Authentication
23-
![add_auth_provider_web_1](./Images/add_auth_provider_api_1.png)
22+
2. Add Authentication Provider in API Service
2423

25-
- Select **Microsoft** and set **Client secret expiration**
26-
![add_auth_provider_web_2](./Images/add_auth_provider_api_2.png)
24+
- Go to deployed Container App and select `ca-<your environment>-<randomname>-api` and click **Add Identity Provider** button in Authentication.
25+
![add_auth_provider_api_1](./Images/add_auth_provider_api_1.png)
2726

28-
- Set **Unauthenticated requests** then Click **Add** button
29-
![add_auth_provider_web_3](./Images/add_auth_provider_api_3.png)
27+
- Select **Microsoft** and set **Client secret expiration**.
28+
![add_auth_provider_api_2](./Images/add_auth_provider_api_2.png)
29+
30+
- Set **Unauthenticated requests**, then click **Add** button.
31+
![add_auth_provider_api_3](./Images/add_auth_provider_api_3.png)
3032

3133
## Step 2: Configure Application Registration - Web Application
34+
3235
1. Set Redirect URI in Single Page Application Platform
33-
- Go to deployed Container App **ca-< your environment >-< randomname >-web** and select **Authentication** menu then select created Application Registration
34-
![configure_app_registration_web_1](./Images/configure_app_registration_web_1.png)
35-
36-
- Select **Authentication** then Select **+ Add a platform** menu
37-
![configuration_app_registration_web_2](./Images/configure_app_registration_web_2.png)
38-
39-
- Select **Single-page application**
40-
![configuration_app_registration_web_3](./Images/configure_app_registration_web_3.png)
41-
42-
- Add Container App **ca-< your environment >-< randomname >-web**'s URL
43-
![configuration_app_registration_web_4](./Images/configure_app_registration_web_4.png)
44-
- You may get this URL from here in your Container App
45-
![configuration_app_registration_web_5](./Images/configure_app_registration_web_5.png)
46-
47-
2. Add Permission and Grant Permission
48-
- Add Permission for API application. Select **+ Add a permission** button then search API application with name **ca-< your environment name >-<unique string>-api**
49-
![configuration_app_registration_web_6](./Images/configure_app_registration_web_6.png)
50-
![configuration_app_registration_web_7](./Images/configure_app_registration_web_7.png)
51-
- Grant admin consent to permissions
52-
![configuration_app_registration_web_8](./Images/configure_app_registration_web_8.png)
53-
54-
55-
3. Grap Scope Name for Impersonation
56-
- Select **Expose an API** in left menu. Copy the Scope name then paste in some temporary place.
57-
The copied text will be used for Web Application Environment variable - **APP_MSAL_AUTH_SCOPE**.
58-
![configuration_app_registration_web_9](./Images/configure_app_registration_web_9.png)
59-
60-
4. Grap Client Id for Web App
61-
- Select **Overview** in left menu. Copy the Client Id then paste in some temporary place.
62-
The copied text will be used for Web Application Environment variable - **APP_MSAL_AUTH_CLIENT_ID**
63-
![configuration_app_registration_web_10](./Images/configure_app_registration_web_10.png)
64-
65-
## Step 3: Configure Application Registration - API Application
66-
1. Grap Scope Name for Impersonation
67-
- Go to deployed Container App **ca-< your environment >-< randomname >-api** and select **Authentication** menu then select created Application Registration
68-
![configuration_app_registration_api_1](./Images/configure_app_registration_api_1.png)
69-
70-
- Select **Expose an API** in left menu.Copy the Scope name then paste in some temporary place.
71-
The copied text will be used for Web Application Environment variable - **APP_MSAL_TOKEN_SCOPE**.
72-
![configuration_app_registration_api_2](./Images/configure_app_registration_api_2.png)
73-
74-
2. Grap Client Id for API
75-
- Select **Overview** in left menu. Copy the Client Id then paste in some temporary place.
76-
The copied text will be used for **allowed client applications** list
77-
![configuration_app_registration_api_3](./Images/configure_app_registration_api_3.png)
78-
79-
## Step 4: Add API Client Id to Allowed Client Applications list in Web Application's Registration
80-
1. Go to deployed Container App **ca-< your environment >-< randomname >-web** and select **Authentication** menu then select **Edit**
81-
![add_client_id_to_web_1](./Images/add_client_id_to_web_1.png)
82-
2. Select **Allow requests from specific client applications** then click **pencil** icon to add client Id
83-
![add_client_id_to_web_2](./Images/add_client_id_to_web_2.png)
84-
1. Add **Client Id** from [API App registration from previous step] then Save(#step-3-configure-application-registration---api-application).
85-
![add_client_id_to_web_3](./Images/add_client_id_to_web_3.png)
8636

37+
- Go to deployed Container App `ca-<your environment>-<randomname>-web` and select **Authentication** menu, then select created Application Registration.
38+
![configure_app_registration_web_1](./Images/configure_app_registration_web_1.png)
8739

88-
## Step 5: Update Environment Variable in Container App for Web Application
89-
In previous 2 steps for [Configure Application Registration - Web Application](#step-2-configure-application-registration---web-application) and [Configure Application Registration - API Application](#step-3-configure-application-registration---api-application), we could grap Client Id for Web App's Application Registration and Scopes for Web and API's Application Registration.
40+
- Select **Authentication**, then select **+ Add a platform** menu.
41+
![configure_app_registration_web_2](./Images/configure_app_registration_web_2.png)
42+
43+
- Select **Single-page application**.
44+
![configure_app_registration_web_3](./Images/configure_app_registration_web_3.png)
45+
46+
- Add Container App `ca-<your environment>-<randomname>-web`'s URL.
47+
![configure_app_registration_web_4](./Images/configure_app_registration_web_4.png)
48+
49+
- You may get this URL from here in your Container App.
50+
![configure_app_registration_web_5](./Images/configure_app_registration_web_5.png)
51+
52+
2. Add Permission and Grant Permission
9053

91-
Now, We will Edit and deploy Web Application Container with updated Environment variables.
54+
- Add Permission for API application. Select **+ Add a permission** button, then search API application with name `ca-<your environment name>-<unique string>-api`.
55+
![configure_app_registration_web_6](./Images/configure_app_registration_web_6.png)
56+
![configure_app_registration_web_7](./Images/configure_app_registration_web_7.png)
9257

93-
1. Select **Containers** menu under **Application** then **click Edit and Deploy** menu.
94-
![update_env_app_1](./Images/update_env_app_1.png)
58+
- Grant admin consent to permissions.
59+
![configure_app_registration_web_8](./Images/configure_app_registration_web_8.png)
9560

96-
2. Select Container image and Click **Edit**. under **Environment variables** sections, update 3 values which were taken in previous steps for **APP_MSAL_AUTH_CLIENT_ID**, **APP_MSAL_AUTH_SCOPE**, **APP_MSAL_TOKEN_SCOPE**.
97-
Now updated Revision will be activated soon.
61+
3. Grab Scope Name for Impersonation
9862

63+
- Select **Expose an API** in the left menu. Copy the Scope name, then paste it in some temporary place.
64+
The copied text will be used for Web Application Environment variable - **APP_MSAL_AUTH_SCOPE**.
65+
![configure_app_registration_web_9](./Images/configure_app_registration_web_9.png)
9966

67+
4. Grab Client Id for Web App
10068

69+
- Select **Overview** in the left menu. Copy the Client Id, then paste it in some temporary place.
70+
The copied text will be used for Web Application Environment variable - **APP_MSAL_AUTH_CLIENT_ID**.
71+
![configure_app_registration_web_10](./Images/configure_app_registration_web_10.png)
10172

73+
## Step 3: Configure Application Registration - API Application
10274

75+
1. Grab Scope Name for Impersonation
10376

77+
- Go to deployed Container App `ca-<your environment>-<randomname>-api` and select **Authentication** menu, then select created Application Registration.
78+
![configure_app_registration_api_1](./Images/configure_app_registration_api_1.png)
10479

80+
- Select **Expose an API** in the left menu. Copy the Scope name, then paste it in some temporary place.
81+
The copied text will be used for Web Application Environment variable - **APP_MSAL_TOKEN_SCOPE**.
82+
![configure_app_registration_api_2](./Images/configure_app_registration_api_2.png)
10583

84+
## Step 4: Add Web Application's Client Id to Allowed Client Applications List in API Application Registration
85+
86+
1. Go to the deployed Container App `ca-<your environment>-<randomname>-api`, select **Authentication**, and then click **Edit**.
87+
![add_client_id_to_api_1](./Images/add_client_id_to_api_1.png)
88+
89+
2. Select **Allow requests from specific client applications**, then click the **pencil** icon to add the Client Id.
90+
![add_client_id_to_api_2](./Images/add_client_id_to_api_2.png)
91+
92+
3. Add the **Client Id** obtained from [Step 2: Configure Application Registration - Web Application](#step-2-configure-application-registration---web-application), then save.
93+
![add_client_id_to_web_3](./Images/add_client_id_to_web_3.png)
94+
95+
## Step 5: Update Environment Variable in Container App for Web Application
96+
97+
In previous steps for [Configure Application Registration - Web Application](#step-2-configure-application-registration---web-application) and [Configure Application Registration - API Application](#step-3-configure-application-registration---api-application), we grabbed Client Id for Web App's Application Registration and Scopes for Web and API's Application Registration.
98+
99+
Now, we will edit and deploy the Web Application Container with updated Environment variables.
100+
101+
1. Select **Containers** menu under **Application**, then click **Edit and Deploy** menu.
102+
![update_env_app_1](./Images/update_env_app_1.png)
103+
104+
2. Select Container image and click **Edit**. Under **Environment variables** section, update 3 values which were taken in previous steps for **APP_MSAL_AUTH_CLIENT_ID**, **APP_MSAL_AUTH_SCOPE**, **APP_MSAL_TOKEN_SCOPE**.
105+
The updated revision will be activated soon.
106106

107107
## Conclusion
108+
108109
You have successfully configured the front-end and back-end Azure App Registrations with proper API permissions and security settings.

docs/CustomizeSchemaData.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ A schema should be created that includes all fields you expect to extract and tr
5858
5959
Below is the sample call with areas you would modify:
6060

61-
1. The location of the schema class you created.
62-
2. The name of the schema class that will get registered, matching the main class in your .py class file.
63-
3. Friendly, readable description of the schema.
61+
> **Note:** To create and execute requests in `.http` files, you must install the [REST Client VSCode extension](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) in your Visual Studio Code. Ensure this extension is installed before proceeding to the next step.
62+
63+
1. The file name for created Schema file(**<< your file >>**.py)
64+
2. The file location of the schema class will be registered.
65+
3. The name of the main schema class that will get instantiated.
66+
4. Friendly, readable description of the schema. this value will be show up in UI.
6467

6568
> ![Schema Registartion REST API call with payload](./images/schema-register-api.png)
6669

0 commit comments

Comments
 (0)