Skip to content

Commit 4ca0bb5

Browse files
feat: UI Enhancements & refactoring
feat: UI Enhancements & refactoring
2 parents fcf2ca3 + d13d28d commit 4ca0bb5

File tree

93 files changed

+3732
-3375
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+3732
-3375
lines changed

.devcontainer/setupEnv.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ yarn install
2323
cd ../../
2424

2525
echo "Setting up executable permission for shell scripts"
26+
sed -i 's/\r$//' ./infra/scripts/post_deployment.sh
2627
sudo chmod +x ./infra/scripts/docker-build.sh
28+
sudo chmod +x ./infra/scripts/post_deployment.sh
2729
sudo chmod +x ./src/ContentProcessorAPI/samples/upload_files.sh
2830
sudo chmod +x ./src/ContentProcessorAPI/samples/schemas/register_schema.sh
2931

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install Backend Dependencies
3434
run: |
3535
python -m pip install --upgrade pip
36-
pip install -r src/ContentProcessorAPI/requirements.txt
36+
pip install -r src/ContentProcessor/requirements.txt
3737
pip install pytest-cov
3838
pip install pytest-asyncio
3939
@@ -43,7 +43,7 @@ jobs:
4343
- name: Check if Backend Test Files Exist
4444
id: check_backend_tests
4545
run: |
46-
if [ -z "$(find src/ContentProcessorAPI/app/tests -type f -name 'test_*.py')" ]; then
46+
if [ -z "$(find src/ContentProcessor/src/tests -type f -name 'test_*.py')" ]; then
4747
echo "No backend test files found, skipping backend tests."
4848
echo "skip_backend_tests=true" >> $GITHUB_ENV
4949
else
@@ -54,8 +54,8 @@ jobs:
5454
- name: Run Backend Tests with Coverage
5555
if: env.skip_backend_tests == 'false'
5656
run: |
57-
pytest src/ContentProcessorAPI/app/tests
58-
pytest --cov=. --cov-report=term-missing --cov-report=xml
57+
cd src/ContentProcessor
58+
python -m pytest -vv --cov=. --cov-report=xml --cov-report=term-missing --cov-fail-under=80
5959
6060
- name: Skip Backend Tests
6161
if: env.skip_backend_tests == 'true'

azure.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,12 @@ hooks:
1515
windows:
1616
shell: pwsh
1717
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
18-
18+
postprovision:
19+
posix:
20+
shell: sh
21+
run: sed -i 's/\r$//' ./infra/scripts/post_deployment.sh; ./infra/scripts/post_deployment.sh
22+
interactive: true
23+
windows:
24+
shell: pwsh
25+
run: ./infra/scripts/post_deployment.ps1
26+
interactive: true

docs/ConfigureAppAuthentication.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ We will add Microsoft Entra ID as an authentication provider to API and Web Appl
7373
3. Grab Scope Name for Impersonation
7474

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

7979
4. Grab Client Id for Web App
8080

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

8585
## Step 3: Configure Application Registration - API Application
@@ -90,7 +90,7 @@ We will add Microsoft Entra ID as an authentication provider to API and Web Appl
9090
![configure_app_registration_api_1](./Images/configure_app_registration_api_1.png)
9191

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

9696
## Step 4: Add Web Application's Client Id to Allowed Client Applications List in API Application Registration
@@ -112,7 +112,7 @@ Now, we will edit and deploy the Web Application Container with updated Environm
112112

113113
1. Select **Containers** menu under **Application**. Then click **Environment variables** tab.
114114
![update_env_app_1_1](./Images/update_env_app_1_1.png)
115-
2. Update 3 values which were taken in previous steps for **APP_MSAL_AUTH_CLIENT_ID**, **APP_MSAL_AUTH_SCOPE**, **APP_MSAL_TOKEN_SCOPE**.
115+
2. Update 3 values which were taken in previous steps for **APP_WEB_CLIENT_ID**, **APP_WEB_SCOPE**, **APP_API_SCOPE**.
116116
Click on **Save as a new revision**.
117117
The updated revision will be activated soon.
118118

docs/Images/update_env_app_1_1.png

-17.7 KB
Loading

infra/container_app/deploy_container_app_api_web.bicep

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,21 +131,25 @@ module containerAppWeb 'deploy_container_app.bicep' = {
131131
value: containerAppApiEndpoint
132132
}
133133
{
134-
name: 'APP_MSAL_AUTH_CLIENT_ID'
134+
name: 'APP_WEB_CLIENT_ID'
135135
value: '<APP_REGISTRATION_CLIENTID>'
136136
}
137137
{
138-
name: 'APP_MSAL_AUTH_AUTHORITY'
138+
name: 'APP_WEB_AUTHORITY'
139139
value: '${environment().authentication.loginEndpoint}/${tenant().tenantId}'
140140
}
141141
{
142-
name: 'APP_MSAL_AUTH_SCOPE'
142+
name: 'APP_WEB_SCOPE'
143143
value: '<FRONTEND_API_SCOPE>'
144144
}
145145
{
146-
name: 'APP_MSAL_TOKEN_SCOPE'
146+
name: 'APP_API_SCOPE'
147147
value: '<BACKEND_API_SCOPE>'
148148
}
149+
{
150+
name: 'APP_CONSOLE_LOG_ENABLED'
151+
value: 'false'
152+
}
149153
]
150154
minReplicas: minReplicaContainerWeb
151155
maxReplicas: maxReplicaContainerWeb

infra/deploy_ai_foundry.bicep

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -213,23 +213,6 @@ resource aiHub 'Microsoft.MachineLearningServices/workspaces@2023-08-01-preview'
213213
aiServicesDeployments
214214
]
215215
}
216-
217-
resource aiServiceContentUnderstandingConnection 'connections@2024-07-01-preview' = {
218-
name: '${aiHubName}-cu-connection-AzureOpenAI'
219-
properties: {
220-
category: 'AIServices'
221-
target: aiServices_CU.properties.endpoint
222-
authType: 'AAD'
223-
isSharedToAll: true
224-
metadata: {
225-
ApiType: 'Azure'
226-
ResourceId: aiServices_CU.id
227-
}
228-
}
229-
dependsOn: [
230-
aiServicesDeployments
231-
]
232-
}
233216
}
234217

235218
resource aiHubProject 'Microsoft.MachineLearningServices/workspaces@2024-01-01-preview' = {

infra/deploy_container_registry.bicep

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,31 @@
33
targetScope = 'resourceGroup'
44

55
param environmentName string
6-
6+
77
var uniqueId = toLower(uniqueString(subscription().id, environmentName, resourceGroup().location))
88
var solutionName = 'cps-${padLeft(take(uniqueId, 12), 12, '0')}'
9-
9+
1010
var containerNameCleaned = replace('cr${solutionName }', '-', '')
11-
11+
1212
@description('Provide a location for the registry.')
1313
param location string = resourceGroup().location
14-
14+
1515
@description('Provide a tier of your Azure Container Registry.')
16-
param acrSku string = 'Premium'
17-
16+
param acrSku string = 'Basic'
17+
1818
resource containerRegistry 'Microsoft.ContainerRegistry/registries@2021-09-01' = {
1919
name: containerNameCleaned
2020
location: location
2121
sku: {
2222
name: acrSku
2323
}
2424
properties: {
25-
adminUserEnabled: true
26-
dataEndpointEnabled: false
27-
networkRuleBypassOptions: 'AzureServices'
28-
networkRuleSet: {
29-
defaultAction: 'Allow'
30-
}
31-
policies: {
32-
quarantinePolicy: {
33-
status: 'disabled'
34-
}
35-
retentionPolicy: {
36-
status: 'enabled'
37-
days: 7
38-
}
39-
trustPolicy: {
40-
status: 'disabled'
41-
type: 'Notary'
42-
}
43-
}
4425
publicNetworkAccess: 'Enabled'
4526
zoneRedundancy: 'Disabled'
4627
}
4728
}
48-
29+
4930
output createdAcrName string = containerNameCleaned
5031
output createdAcrId string = containerRegistry.id
5132
output acrEndpoint string = containerRegistry.properties.loginServer
33+

infra/deploy_keyvault.bicep

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = {
3232
enabledForDiskEncryption: true
3333
enabledForTemplateDeployment: true
3434
enableRbacAuthorization: true
35-
enablePurgeProtection: true
3635
publicNetworkAccess: 'enabled'
3736
// networkAcls: {
3837
// bypass: 'AzureServices'

infra/main.bicep

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ param gptModelName string = 'gpt-4o'
4141

4242
@minLength(1)
4343
@description('Version of the GPT model to deploy:')
44+
@allowed([
45+
'2024-08-06'
46+
])
4447
param gptModelVersion string = '2024-08-06'
4548

4649
//var gptModelVersion = '2024-02-15-preview'
@@ -248,3 +251,8 @@ module updateContainerApp './container_app/deploy_container_app_api_web.bicep' =
248251
}
249252
dependsOn: [roleAssignments]
250253
}
254+
255+
output CONTAINER_WEB_APP_NAME string = containerApps.outputs.containerAppWebName
256+
output CONTAINER_API_APP_NAME string = containerApps.outputs.containerAppApiName
257+
output CONTAINER_WEB_APP_FQDN string = containerApps.outputs.containweAppWebEndPoint
258+
output CONTAINER_API_APP_FQDN string = containerApps.outputs.containweAppApiEndPoint

0 commit comments

Comments
 (0)