Skip to content

Commit 9e18ad1

Browse files
feat: Code merge to main
1 parent 1afac76 commit 9e18ad1

21 files changed

Lines changed: 85 additions & 445 deletions

.gitignore

Lines changed: 0 additions & 400 deletions
This file was deleted.

docs/API.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ The Content Processing solution accelerator consists of a number of APIs to hand
1010
OpenAPI: https://<content-processing-api-container-url>/redoc
1111

1212
## APIs
13-
Outlined before are the various APIs that are available as both Swagger and OpenAPI specifications within the solution.
13+
Outlined below are the various APIs that are available as both Swagger and OpenAPI specifications within the solution.
1414

1515
### Content Processor
16-
Responsible processing level actions to capture a file, processess, and queue management.
16+
Responsible processing level actions to capture a file, processes, and queue management.
1717
- **[POST]** Processed: Get all processed contents list.
18-
- **[POST]** Submit: Submit a file to be processed with it's selected schema and any custom meta data to pass along with it for external reference.
18+
- **[POST]** Submit: Submit a file to be processed with its selected schema and any custom meta data to pass along with it for external reference.
1919
- **[GET]** Status: Get the status of a file being processed. It shows the status of the file being processed in the pipeline.
2020
- **[GET]** Processed: Get the processed content results.
2121
- **[PUT]** Processed: Updates the processed content results; updates the comment in the process.
@@ -32,11 +32,11 @@ System level configuration for adding and managing schemas in the system related
3232
- **[GET]** Health: Determines the alive state of the solution for processing.
3333
- **[GET]** Startup: Determines the startup state of the solution.
3434

35-
> Note: You can find a sample REST Client calls with endponts and payload examples in the respository at:<br/><br/>
36-
/src/ContentProcessorAPI/tetst_http/invoke_APIs.http
35+
> Note: You can find a sample REST Client call with endpoints and payload examples in the repository at:<br/><br/>
36+
/src/ContentProcessorAPI/test_http/invoke_APIs.http
3737

3838
## Note on Custom Meta Data
39-
Custom meta data can optionally be passed along when submitting a file to be processed on the Content Processor API. This allows for external source system refereence information to be captured and passed through the processing steps. This information stays as reference only for down-stream reference and is not used in in processessing or modifying any data extraction, mapping, or transformation.
39+
Custom meta data can optionally be passed along when submitting a file to be processed on the Content Processor API. This allows for external source system reference information to be captured and passed through the processing steps. This information stays as reference only for down-stream reference and is not used in processing or modifying any data extraction, mapping, or transformation.
4040

4141
## Security
4242
Security is applied to the API by utilizing a vnet for traffic and network control. A service principal with permission can programmatically call the end points and is registered as an application registration in Azure.

docs/ConfigureAppAuthentication_withImage.md

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,53 @@ We will add Microsoft Entra ID as an authentication provider to API and Web Appl
5252
![configuration_app_registration_web_8](./Images/configure_app_registration_web_8.png)
5353

5454

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+
5565
## Step 3: Configure Application Registration - API Application
56-
Add Web Application Registration's Client Id to API's Allowed client application list.
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)
86+
87+
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.
90+
91+
Now, We will Edit and deploy Web Application Container with updated Environment variables.
92+
93+
1. Select **Containers** menu under **Application** then **click Edit and Deploy** menu.
94+
![update_env_app_1](./Images/update_env_app_1.png)
95+
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.
98+
99+
100+
57101

58-
## Step 4: Update Environment Variable in Container App for Web Application
59-
Update Environment variable for Client Id in Web App's application registration, Scope for Web as auth scope, Scope for API as token scope
60102

61103

62104

docs/CustomizeSchemaData.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Using AI, the processing pipeline will extract what is preceived as is the "invo
99

1010
With this concept in mind, schemas need to be created specific to your business and domain requirements. A lot of times schemas may be generally common across industries, but this allows for variations specific to your use case.
1111

12-
A schema should be created that includes all fields you expect to extract and transformed to. Once a schema is added specific to your intended files, you can then programmatically call the API endpoints to submit and process the file for that schema or utilize the web UI to manually process and review.
12+
A schema should be created that includes all fields you expect to extract and transform to. Once a schema is added specific to your intended files, you can then programmatically call the API endpoints to submit and process the file for that schema or utilize the web UI to manually process and review.
1313

1414
## Steps to add a Custom Schema
1515
1. **Create .py class to define schema**<br/>
@@ -33,13 +33,13 @@ A schema should be created that includes all fields you expect to extract and tr
3333
- Base import statements.
3434
- Class and subclass definitions that inherit from pydantic BaseModel.
3535
- Each class has fields, methods, and meta data.
36-
- Classes include a class name, a string describing the class, it's attributes, and the attributes descriptions These are used during mapping and data transformation in the processing pipeline.
36+
- Classes include a class name, a string describing the class, its attributes, and the attributes descriptions. These are used during mapping and data transformation in the processing pipeline.
3737
- Classes also include fields and methods.
3838

3939

4040
#### Fields
4141

42-
- Fields are defined in the class to represent what data this class hold. This is a 1-to-1 relationship with what gets extracted from a file being processed is mapped to this specific field. If your file has a field you'd like to extract called "invoice date", you'd have a field defined in your class to represent that.
42+
- Fields are defined in the class to represent what data this class holds. This is a 1-to-1 relationship with what gets extracted from a file being processed is mapped to this specific field. If your file has a field you'd like to extract called "invoice date", you'd have a field defined in your class to represent that.
4343
- Each field has annotations to designate if it is optional or required.
4444
- Fields also have a string describing what it is and it is used as a prompt to help with data evaluation/validation, mapping and transformation in the processing pipeline. Include an example in the description to help with specificity or experiment with simple logic to help the LLM process the content correctly.
4545

docs/DeploymentGuide.md

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ Here are some example regions where the services are available: East US, East US
2626
Pick from the options below to see step-by-step instructions for: GitHub Codespaces, VS Code Dev Containers, Local Environments, and Bicep deployments.
2727

2828

29-
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/content-processing-solution-accelerator) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/content-processing-solution-accelerator) | [![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Fcontent-processing-solution-accelerator%2Fmain%2Finfra%2Fmain.json) |
30-
|---|---|---|
29+
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/content-processing-solution-accelerator) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/content-processing-solution-accelerator) |
30+
|---|---|
3131

3232
<details>
3333
<summary><b>Deploy in GitHub Codespaces</b></summary>
@@ -48,7 +48,7 @@ You can run this solution using GitHub Codespaces. The button will open a web-ba
4848
<details>
4949
<summary><b>Deploy in VS Code</b></summary>
5050

51-
### VS Code Dev Containers
51+
### VS Code Dev Containers
5252

5353
You can run this solution in VS Code Dev Containers, which will open the project in your local VS Code using the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers):
5454

@@ -66,7 +66,7 @@ You can run this solution in VS Code Dev Containers, which will open the project
6666
<details>
6767
<summary><b>Deploy in your local environment</b></summary>
6868

69-
### Local environment
69+
### Local environment
7070

7171
If you're not using one of the above options for opening the project, then you'll need to:
7272

@@ -89,20 +89,10 @@ You can run this solution in VS Code Dev Containers, which will open the project
8989

9090
</details>
9191

92-
<details>
93-
<summary><b>Deploy with Bicep/ARM template</b></summary>
94-
95-
### Bicep
96-
97-
Click the following deployment button to create the required resources for this solution directly in your Azure Subscription.
98-
99-
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2Fcontent-processing-solution-accelerator%2Fmain%2Finfra%2Fmain.json)
100-
101-
</details>
10292
<br/>
10393

94+
Consider the following settings during your deployment to modify specific settings:
10495

105-
Next, consider the following settings during your deployment:
10696
<details>
10797
<summary><b>Configurable Deployment Settings</b></summary>
10898

@@ -178,7 +168,7 @@ To change the azd parameters from the default values, follow the steps [here](./
178168
- **Get API Service's Endpoint**
179169
- Get API Service Endpoint Url from your container app for API
180170
Name is **ca-**<< your environmentName >>-**api**
181-
![Check API Service Url](images/CheckAPIService.png)
171+
![Check API Service Url](Images/CheckAPIService.png)
182172

183173

184174
- Copy the URL
@@ -197,11 +187,11 @@ To change the azd parameters from the default values, follow the steps [here](./
197187
198188
199189
```Powershell
200-
./register_schema.ps1 http://<< API Service Endpoint>>/schemavault/ schema_info_ps1.json
190+
./register_schema.ps1 http://<< API Service Endpoint>>/schemavault/ .\schema_info_ps1.json
201191
```
202192
203193
- **Verify Results**
204-
![schema file registration](images/SchemaFileRegistration.png)
194+
![schema file registration](./Images/SchemaFileRegistration.png)
205195
206196
207197
227 KB
Loading
221 KB
Loading
177 KB
Loading
209 KB
Loading
163 KB
Loading

0 commit comments

Comments
 (0)