Skip to content

Commit e50d9f0

Browse files
Merge branch 'main' into dev
2 parents 7443f70 + 5e9a684 commit e50d9f0

13 files changed

Lines changed: 347 additions & 239 deletions

.github/workflows/deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ jobs:
7575
id: generate_rg_name
7676
run: |
7777
echo "Generating a unique resource group name..."
78-
TIMESTAMP=$(date +%Y%m%d%H%M%S)
79-
COMMON_PART="pslautomationRes"
80-
UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}"
78+
ACCL_NAME="docgen" # Account name as specified
79+
SHORT_UUID=$(uuidgen | cut -d'-' -f1)
80+
UNIQUE_RG_NAME="arg-${ACCL_NAME}-${SHORT_UUID}"
8181
echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV
82-
echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}"
82+
echo "Generated RESOURCE_GROUP_NAME: ${UNIQUE_RG_NAME}"
8383
8484
- name: Check and Create Resource Group
8585
id: check_create_rg

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ __pycache__/
99
venv
1010
myenv
1111

12-
scriptsenv/
12+
scriptsenv/
13+
14+
scriptenv

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Here are some example regions where the services are available: East US, East US
6666

6767
### Configurable Deployment Settings
6868

69-
When you start the deployment, most parameters will have **default values**, but you can update the following settings:
69+
When you start the deployment, most parameters will have **default values**, but you can update the below settings by following the steps [here](./docs/CustomizingAzdParameters.md):
7070

7171
| **Setting** | **Description** | **Default value** |
7272
|------------|----------------| ------------|
@@ -138,6 +138,7 @@ If you're not using one of the above options for opening the project, then you'l
138138
* [Python 3.9+](https://www.python.org/downloads/)
139139
* [Docker Desktop](https://www.docker.com/products/docker-desktop/)
140140
* [Git](https://git-scm.com/downloads)
141+
* [Powershell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5) (Required for Windows users only. Follow the steps [here](./docs/PowershellSetup.md) to add it to the Windows PATH.)
141142

142143
2. Download the project code:
143144

@@ -192,7 +193,12 @@ To change the azd parameters from the default values, follow the steps [here](./
192193
* This deployment will take *7-10 minutes* to provision the resources in your account and set up the solution with sample data.
193194
* If you get an error or timeout with deployment, changing the location can help, as there may be availability constraints for the resources.
194195
195-
5. Once the deployment has completed successfully, open the [Azure Portal](https://portal.azure.com/), go to the deployed resource group, find the App Service and get the app URL from `Default domain`.
196+
5. Once the deployment has completed successfully and you would like to use the sample data, run the bash command printed in the terminal. The bash command will look like the following:
197+
```shell
198+
bash ./infra/scripts/process_sample_data.sh <Storage-Account-name> <Storgae-Account-container-name> <Key-Vault-name> <CosmosDB-Account-name> <Resource-Group-name>
199+
```
200+
201+
6. Open the [Azure Portal](https://portal.azure.com/), go to the deployed resource group, find the App Service and get the app URL from `Default domain`.
196202
197203
6. You can now delete the resources by running `azd down`, if you are done trying out the application.
198204
<!-- 6. You can now proceed to run the [development server](#development-server) to test the app locally, or if you are done trying out the app, you can delete the resources by running `azd down`. -->

azure.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,18 @@ hooks:
3131
run: |
3232
Write-Host "Web app URL: "
3333
Write-Host "$env:WEB_APP_URL" -ForegroundColor Cyan
34+
Write-Host "`nIf you want to use the Sample Data, run the following command in the Bash terminal to process it:"
35+
Write-Host "bash ./infra/scripts/process_sample_data.sh $env:STORAGE_ACCOUNT_NAME $env:STORAGE_CONTAINER_NAME $env:KEY_VAULT_NAME $env:COSMOSDB_ACCOUNT_NAME $env:RESOURCE_GROUP_NAME" -ForegroundColor Cyan
3436
shell: pwsh
3537
continueOnError: false
3638
interactive: true
3739
posix:
3840
run: |
3941
echo "Web app URL: "
4042
echo $WEB_APP_URL
43+
echo ""
44+
echo "If you want to use the Sample Data, run the following command in the terminal to process it:"
45+
echo "bash ./infra/scripts/process_sample_data.sh $STORAGE_ACCOUNT_NAME $STORAGE_CONTAINER_NAME $KEY_VAULT_NAME $COSMOSDB_ACCOUNT_NAME $RESOURCE_GROUP_NAME"
4146
shell: sh
4247
continueOnError: false
4348
interactive: true

docs/PowershellSetup.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Add PowerShell 7 to PATH in Windows
2+
3+
This guide will help you add **PowerShell 7** (PowerShell Core) to your system’s PATH variable on Windows, so you can easily run it from any Command Prompt or Run dialog.
4+
5+
## Prerequisites
6+
7+
- You should have **PowerShell 7** installed on your machine. If you haven’t installed it yet, you can download it following the guide here: [Installing PowerShell on Windows | Microsoft Learn](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5).
8+
- **Administrative privileges are not required** unless you're modifying system-wide environment variables. You can modify your **user-specific PATH** without admin rights.
9+
10+
## Steps to Add PowerShell 7 to PATH
11+
12+
### 1. Open **System Properties**
13+
- Press `Win + X` and choose **System**.
14+
- Click on **Advanced system settings** on the left sidebar. This will open the **System Properties** window.
15+
- In the **System Properties** window, click on the **Environment Variables** button at the bottom.
16+
17+
### 2. Edit User Environment Variables
18+
- In the **Environment Variables** window, under **User variables**, find the `Path` variable.
19+
- Select the `Path` variable and click **Edit**. (If the `Path` variable doesn’t exist, click **New** and name it `Path`.)
20+
21+
### 3. Check if PowerShell 7 Path is Already in PATH
22+
- Before adding the path, make sure the following path is not already present in the list:
23+
```
24+
C:\Program Files\PowerShell\7\
25+
```
26+
- If the path is already there, you don't need to add it again.
27+
### 4. Add PowerShell 7 Path
28+
- If the path is not already in the list, click **New** in the **Edit Environment Variable** window.
29+
- Add the following path to the list:
30+
```
31+
C:\Program Files\PowerShell\7\
32+
```
33+
> **Note:** If you installed PowerShell 7 in a custom location, replace the above path with the correct one.
34+
### 5. Save Changes
35+
- After adding the path, click **OK** to close the **Edit Environment Variable** window.
36+
- Click **OK** again to close the **Environment Variables** window.
37+
- Finally, click **OK** to exit the **System Properties** window.
38+
### 6. Verify PowerShell 7 in PATH
39+
- Open **Command Prompt** or **Run** (press `Win + R`).
40+
- Type `pwsh` and press Enter.
41+
- If PowerShell 7 opens, you've successfully added it to your PATH!
42+
---
43+
## Troubleshooting
44+
- **PowerShell 7 not opening:** Ensure the path to PowerShell 7 is entered correctly. If you're using a custom installation folder, check that the correct path is added to the `Path` variable.
45+
- **Changes not taking effect:** Try restarting your computer or logging out and logging back in for the changes to apply.

docs/quota_check.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
## Check Quota Availability Before Deployment
22

3-
Before deploying the accelerator, **ensure sufficient quota availability** for the required model. \
3+
Before deploying the accelerator, **ensure sufficient quota availability** for the required model.
4+
5+
### Login if you have not done so already
6+
```
7+
azd auth login
8+
```
9+
410

511
### 📌 Default Models & Capacities:
612
```

infra/deploy_ai_foundry.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ resource applicationInsights 'Microsoft.Insights/components@2020-02-02' = {
9292
properties: {
9393
Application_Type: 'web'
9494
publicNetworkAccessForIngestion: 'Enabled'
95-
publicNetworkAccessForQuery: 'Disabled'
95+
publicNetworkAccessForQuery: 'Enabled'
9696
WorkspaceResourceId: logAnalytics.id
9797
}
9898
}

infra/main.bicep

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,14 @@ module cosmosDBModule 'deploy_cosmos_db.bicep' = {
424424
}
425425
scope: resourceGroup(resourceGroup().name)
426426
}
427+
// output copykbfiles string = './infra/scripts/copy_kb_files.sh ${storageAccount.outputs.storageName} ${storageAccount.outputs.storageContainer} ${managedIdentityModule.outputs.managedIdentityOutput.clientId}'
428+
// output createindex string = './infra/scripts/run_create_index_scripts.sh ${kvault.outputs.keyvaultName} ${managedIdentityModule.outputs.managedIdentityOutput.clientId}'
429+
430+
output STORAGE_ACCOUNT_NAME string = storageAccount.outputs.storageName
431+
output STORAGE_CONTAINER_NAME string = storageAccount.outputs.storageContainer
432+
output KEY_VAULT_NAME string = kvault.outputs.keyvaultName
433+
output COSMOSDB_ACCOUNT_NAME string = cosmosDBModule.outputs.cosmosAccountName
434+
output RESOURCE_GROUP_NAME string = resourceGroup().name
427435

428436

429437
// //========== Deployment script to upload sample data ========== //
@@ -452,21 +460,21 @@ module cosmosDBModule 'deploy_cosmos_db.bicep' = {
452460
// dependsOn:[keyVault,uploadFiles]
453461
// }
454462

455-
//========== Deployment script to upload sample data ========== //
456-
module uploadFiles 'deploy_post_deployment_scripts.bicep' = {
457-
name : 'deploy_post_deployment_scripts'
458-
params:{
459-
solutionName: solutionPrefix
460-
solutionLocation: secondaryLocation
461-
baseUrl: baseUrl
462-
storageAccountName: storageAccount.outputs.storageName
463-
containerName: storageAccount.outputs.storageContainer
464-
managedIdentityObjectId:managedIdentityModule.outputs.managedIdentityOutput.id
465-
managedIdentityClientId:managedIdentityModule.outputs.managedIdentityOutput.clientId
466-
keyVaultName:aifoundry.outputs.keyvaultName
467-
logAnalyticsWorkspaceResourceName: aifoundry.outputs.logAnalyticsWorkspaceResourceName
468-
}
469-
}
463+
// //========== Deployment script to upload sample data ========== //
464+
// module uploadFiles 'deploy_post_deployment_scripts.bicep' = {
465+
// name : 'deploy_post_deployment_scripts'
466+
// params:{
467+
// solutionName: solutionPrefix
468+
// solutionLocation: secondaryLocation
469+
// baseUrl: baseUrl
470+
// storageAccountName: storageAccount.outputs.storageName
471+
// containerName: storageAccount.outputs.storageContainer
472+
// managedIdentityObjectId:managedIdentityModule.outputs.managedIdentityOutput.id
473+
// managedIdentityClientId:managedIdentityModule.outputs.managedIdentityOutput.clientId
474+
// keyVaultName:aifoundry.outputs.keyvaultName
475+
// logAnalyticsWorkspaceResourceName: aifoundry.outputs.logAnalyticsWorkspaceResourceName
476+
// }
477+
// }
470478

471479

472480
// resource CosmosDB 'Microsoft.DocumentDB/databaseAccounts@2023-04-15' = {

0 commit comments

Comments
 (0)