Skip to content

Commit af4187a

Browse files
Merge pull request #87 from microsoft/psl-raju-dev
feat: Search functionality and Panel Expand/Collapse functionality
2 parents c08fc17 + f879098 commit af4187a

29 files changed

Lines changed: 645 additions & 263 deletions

azure.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,11 @@ 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+
postprovision:
19+
posix:
20+
shell: sh
21+
run: sed -i 's/\r$//' ./infra/scripts/post_deployment.sh; ./infra/scripts/post_deployment.sh
22+
windows:
23+
shell: pwsh
24+
run: ./infra/scripts/post_deployment.ps1
1825

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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,23 +131,23 @@ 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
}
149149
{
150-
name: 'APP_ISLOGS_ENABLED'
150+
name: 'APP_CONSOLE_LOG_ENABLED'
151151
value: 'false'
152152
}
153153
]

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: 3 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'

infra/main.json

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.34.44.8038",
8-
"templateHash": "17985360808056860425"
8+
"templateHash": "2631796362162534903"
99
}
1010
},
1111
"parameters": {
@@ -67,6 +67,9 @@
6767
"gptModelVersion": {
6868
"type": "string",
6969
"defaultValue": "2024-08-06",
70+
"allowedValues": [
71+
"2024-08-06"
72+
],
7073
"minLength": 1,
7174
"metadata": {
7275
"description": "Version of the GPT model to deploy:"
@@ -480,7 +483,7 @@
480483
"_generator": {
481484
"name": "bicep",
482485
"version": "0.34.44.8038",
483-
"templateHash": "7568462549649877267"
486+
"templateHash": "17770758516688495068"
484487
}
485488
},
486489
"parameters": {
@@ -526,7 +529,6 @@
526529
"enabledForDiskEncryption": true,
527530
"enabledForTemplateDeployment": true,
528531
"enableRbacAuthorization": true,
529-
"enablePurgeProtection": true,
530532
"publicNetworkAccess": "enabled",
531533
"sku": {
532534
"family": "A",
@@ -672,7 +674,7 @@
672674
"_generator": {
673675
"name": "bicep",
674676
"version": "0.34.44.8038",
675-
"templateHash": "10286514074548439078"
677+
"templateHash": "18372681746235366113"
676678
}
677679
},
678680
"parameters": {
@@ -688,7 +690,7 @@
688690
},
689691
"acrSku": {
690692
"type": "string",
691-
"defaultValue": "Premium",
693+
"defaultValue": "Basic",
692694
"metadata": {
693695
"description": "Provide a tier of your Azure Container Registry."
694696
}
@@ -709,25 +711,6 @@
709711
"name": "[parameters('acrSku')]"
710712
},
711713
"properties": {
712-
"adminUserEnabled": true,
713-
"dataEndpointEnabled": false,
714-
"networkRuleBypassOptions": "AzureServices",
715-
"networkRuleSet": {
716-
"defaultAction": "Allow"
717-
},
718-
"policies": {
719-
"quarantinePolicy": {
720-
"status": "disabled"
721-
},
722-
"retentionPolicy": {
723-
"status": "enabled",
724-
"days": 7
725-
},
726-
"trustPolicy": {
727-
"status": "disabled",
728-
"type": "Notary"
729-
}
730-
},
731714
"publicNetworkAccess": "Enabled",
732715
"zoneRedundancy": "Disabled"
733716
}
@@ -1655,7 +1638,7 @@
16551638
"_generator": {
16561639
"name": "bicep",
16571640
"version": "0.34.44.8038",
1658-
"templateHash": "15815884747026956332"
1641+
"templateHash": "1111747132207169107"
16591642
}
16601643
},
16611644
"parameters": {
@@ -2392,23 +2375,23 @@
23922375
"value": "[parameters('containerAppApiEndpoint')]"
23932376
},
23942377
{
2395-
"name": "APP_MSAL_AUTH_CLIENT_ID",
2378+
"name": "APP_WEB_CLIENT_ID",
23962379
"value": "<APP_REGISTRATION_CLIENTID>"
23972380
},
23982381
{
2399-
"name": "APP_MSAL_AUTH_AUTHORITY",
2382+
"name": "APP_WEB_AUTHORITY",
24002383
"value": "[format('{0}/{1}', environment().authentication.loginEndpoint, tenant().tenantId)]"
24012384
},
24022385
{
2403-
"name": "APP_MSAL_AUTH_SCOPE",
2386+
"name": "APP_WEB_SCOPE",
24042387
"value": "<FRONTEND_API_SCOPE>"
24052388
},
24062389
{
2407-
"name": "APP_MSAL_TOKEN_SCOPE",
2390+
"name": "APP_API_SCOPE",
24082391
"value": "<BACKEND_API_SCOPE>"
24092392
},
24102393
{
2411-
"name": "APP_ISLOGS_ENABLED",
2394+
"name": "APP_CONSOLE_LOG_ENABLED",
24122395
"value": "false"
24132396
}
24142397
]
@@ -3178,7 +3161,7 @@
31783161
"_generator": {
31793162
"name": "bicep",
31803163
"version": "0.34.44.8038",
3181-
"templateHash": "15815884747026956332"
3164+
"templateHash": "1111747132207169107"
31823165
}
31833166
},
31843167
"parameters": {
@@ -3915,23 +3898,23 @@
39153898
"value": "[parameters('containerAppApiEndpoint')]"
39163899
},
39173900
{
3918-
"name": "APP_MSAL_AUTH_CLIENT_ID",
3901+
"name": "APP_WEB_CLIENT_ID",
39193902
"value": "<APP_REGISTRATION_CLIENTID>"
39203903
},
39213904
{
3922-
"name": "APP_MSAL_AUTH_AUTHORITY",
3905+
"name": "APP_WEB_AUTHORITY",
39233906
"value": "[format('{0}/{1}', environment().authentication.loginEndpoint, tenant().tenantId)]"
39243907
},
39253908
{
3926-
"name": "APP_MSAL_AUTH_SCOPE",
3909+
"name": "APP_WEB_SCOPE",
39273910
"value": "<FRONTEND_API_SCOPE>"
39283911
},
39293912
{
3930-
"name": "APP_MSAL_TOKEN_SCOPE",
3913+
"name": "APP_API_SCOPE",
39313914
"value": "<BACKEND_API_SCOPE>"
39323915
},
39333916
{
3934-
"name": "APP_ISLOGS_ENABLED",
3917+
"name": "APP_CONSOLE_LOG_ENABLED",
39353918
"value": "false"
39363919
}
39373920
]

infra/scripts/post_deployment.ps1

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Stop script on any error
2+
$ErrorActionPreference = "Stop"
3+
4+
Write-Host "🔍 Fetching container app info from azd environment..."
5+
6+
# Load values from azd env
7+
$CONTAINER_WEB_APP_NAME = azd env get-value CONTAINER_WEB_APP_NAME
8+
$CONTAINER_WEB_APP_FQDN = azd env get-value CONTAINER_WEB_APP_FQDN
9+
10+
$CONTAINER_API_APP_NAME = azd env get-value CONTAINER_API_APP_NAME
11+
$CONTAINER_API_APP_FQDN = azd env get-value CONTAINER_API_APP_FQDN
12+
13+
# Get subscription and resource group (assuming same for both)
14+
$SUBSCRIPTION_ID = azd env get-value AZURE_SUBSCRIPTION_ID
15+
$RESOURCE_GROUP = azd env get-value AZURE_RESOURCE_GROUP
16+
17+
# Construct Azure Portal URLs
18+
$WEB_APP_PORTAL_URL = "https://portal.azure.com/#resource/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.App/containerApps/$CONTAINER_WEB_APP_NAME"
19+
$API_APP_PORTAL_URL = "https://portal.azure.com/#resource/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.App/containerApps/$CONTAINER_API_APP_NAME"
20+
21+
# Get the current script's directory
22+
$ScriptDir = $PSScriptRoot
23+
24+
# Navigate from infra/scripts → root → src/api/data/data.sh
25+
$DataScriptPath = Join-Path $ScriptDir "..\..\src\ContentProcessorAPI\samples\schemas"
26+
27+
# Resolve to an absolute path
28+
$FullPath = Resolve-Path $DataScriptPath
29+
30+
# Output
31+
Write-Host ""
32+
Write-Host "🧭 Web App Details:"
33+
Write-Host " ✅ Name: $CONTAINER_WEB_APP_NAME"
34+
Write-Host " 🌐 Endpoint: https://$CONTAINER_WEB_APP_FQDN"
35+
Write-Host " 🔗 Portal URL: $WEB_APP_PORTAL_URL"
36+
37+
Write-Host ""
38+
Write-Host "🧭 API App Details:"
39+
Write-Host " ✅ Name: $CONTAINER_API_APP_NAME"
40+
Write-Host " 🌐 Endpoint: https://$CONTAINER_API_APP_FQDN"
41+
Write-Host " 🔗 Portal URL: $API_APP_PORTAL_URL"
42+
43+
Write-Host ""
44+
Write-Host "📦 Follow Next steps to import Schemas:"
45+
Write-Host "👉 Run the following commands in your terminal:"
46+
$CurrentPath = Get-Location
47+
Write-Host ""
48+
Write-Host " cd $FullPath"
49+
Write-Host " ./register_schema.ps1 https://$CONTAINER_API_APP_FQDN/schemavault/ schema_info_ps1.json"

0 commit comments

Comments
 (0)