Skip to content

Commit 3642453

Browse files
Refactor process_sample_data.sh to streamline required variable retrieval (#725)
1 parent ad68642 commit 3642453

File tree

4 files changed

+576
-486
lines changed

4 files changed

+576
-486
lines changed

azure.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ hooks:
1616
Write-Host "Web app URL: "
1717
Write-Host "$env:WEB_APP_URL" -ForegroundColor Cyan
1818
Write-Host "`nRun the following command in your Bash terminal. It will grant the necessary permissions between resources and your user account, and also process and load the sample data into the application."
19-
Write-Host "bash ./infra/scripts/process_sample_data.sh $env:AZURE_RESOURCE_GROUP" -ForegroundColor Cyan
19+
Write-Host "bash ./infra/scripts/process_sample_data.sh" -ForegroundColor Cyan
2020
shell: pwsh
2121
continueOnError: false
2222
interactive: true
@@ -26,7 +26,7 @@ hooks:
2626
echo $WEB_APP_URL
2727
echo ""
2828
echo "Run the following command in your Bash terminal. It will grant the necessary permissions between resources and your user account, and also process and load the sample data into the application."
29-
echo "bash ./infra/scripts/process_sample_data.sh $env:AZURE_RESOURCE_GROUP"
29+
echo "bash ./infra/scripts/process_sample_data.sh"
3030
shell: sh
3131
continueOnError: false
3232
interactive: true

docs/AVMPostDeploymentGuide.md

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,51 @@
11
# AVM Post Deployment Guide
2+
3+
> **📋 Note**: This guide is specifically for post-deployment steps after using the AVM template. For complete deployment from scratch, see the main [Deployment Guide](./DeploymentGuide.md).
4+
5+
---
6+
27
This document provides guidance on post-deployment steps after deploying the Build Your Own Copilot Accelerator from the [AVM (Azure Verified Modules) repository](https://github.com/Azure/bicep-registry-modules/tree/main/avm/ptn/sa/build-your-own-copilot).
38

49
## Post Deployment Steps
5-
1. Clone the Repository
6-
First, clone this repository to access the post-deployment scripts:
7-
```bash
8-
git clone https://github.com/microsoft/Build-your-own-copilot-Solution-Accelerator.git
9-
```
10-
```bash
11-
cd Build-your-own-copilot-Solution-Accelerator
12-
```
1310

14-
2. Import Sample Data -Run bash command printed in the terminal. The bash command will look like the following:
11+
### 1. Clone the Repository
12+
First, clone this repository to access the post-deployment scripts:
13+
14+
```bash
15+
git clone https://github.com/microsoft/Build-your-own-copilot-Solution-Accelerator.git
16+
cd Build-your-own-copilot-Solution-Accelerator
17+
```
18+
19+
### 2. Import Sample Data
20+
21+
**Choose the appropriate command based on your deployment method:**
22+
23+
**If you deployed using custom templates, ARM/Bicep deployments, or `az deployment group` commands:**
24+
```bash
25+
bash ./infra/scripts/process_sample_data.sh <your-resource-group-name>
26+
```
27+
> **Note**: Replace `<your-resource-group-name>` with the actual name of the resource group containing your deployed Azure resources.
28+
29+
> **💡 Tip**: If the deployment metadata does not exist in Azure or has been deleted, the script will prompt you to manually enter the required configuration values.
30+
31+
**If you deployed using `azd up` command:**
32+
```bash
33+
bash ./infra/scripts/process_sample_data.sh
34+
```
35+
> **Note**: The script will automatically take required values from your `azd` environment.
36+
37+
> **💡 Tip**: Since this guide is for AVM deployments, you'll most likely use the first command with your resource group name.
38+
39+
### 3. Configure Authentication
1540

16-
```bash
17-
bash ./infra/scripts/process_sample_data.sh <resourceGroupName>
18-
```
19-
If the deployment does not exist or has been deleted – The script will prompt you to manually enter the required values
41+
Follow the steps in [App Authentication](./AppAuthentication.md) to configure authentication in App Service.
2042

21-
3. Add Authentication Provider
43+
> **Note**: Authentication changes can take up to 10 minutes to propagate.
2244
23-
Follow steps in [App Authentication](https://github.com/microsoft/Build-your-own-copilot-Solution-Accelerator/blob/main/docs/AppAuthentication.md) to configure authentication in app service.
24-
>Note that Authentication changes can take up to 10 minutes.
45+
### 4. Troubleshooting: Cleaning Up After a Failed Deployment
2546

26-
4. Deleting Resources After a Failed Deployment
47+
If your deployment fails and you need to clean up resources, follow the steps in [Delete Resource Group](./DeleteResourceGroup.md).
2748

28-
Follow steps in [Delete Resource Group](https://github.com/microsoft/Build-your-own-copilot-Solution-Accelerator/blob/main/docs/DeleteResourceGroup.md) if your deployment fails and/or you need to clean up the resources.
49+
---
2950

30-
By following these steps, youll ensure a smooth transition from deployment to hands-on usage.
51+
By following these steps, you'll ensure a smooth transition from deployment to hands-on usage.

docs/DeploymentGuide.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -238,22 +238,35 @@ This will rebuild the source code, package it into a container, and push it to t
238238
239239
## Post Deployment Steps
240240
241-
1. **Import Sample Data**
242-
-please open a **Git Bash** terminal and run the bash command printed below. The bash command will look like the following:
243-
```shell
244-
bash ./infra/scripts/process_sample_data.sh
245-
```
246-
if you don't have azd env then you need to pass parameters along with the command. Then the command will look like the following:
247-
```shell
248-
bash ./infra/scripts/process_sample_data.sh <resourceGroupName> <cosmosDbAccountName> <storageAccount> <storageContainerName> <keyvaultName> <sqlServerName> <sqlDatabaseName> <webAppUserManagedIdentityClientId> <webAppUserManagedIdentityDisplayName> <aiFoundryResourceName> <aiSearchResourceName>
249-
```
241+
### 1. Import Sample Data
242+
243+
**Choose the appropriate command based on your deployment method:**
244+
245+
**If you deployed using `azd up` command:**
246+
```bash
247+
bash ./infra/scripts/process_sample_data.sh
248+
```
249+
> **Note**: The script will automatically take required values from your `azd` environment.
250+
251+
**If you deployed using custom templates, ARM/Bicep deployments, or `az deployment group` commands:**
252+
```bash
253+
bash ./infra/scripts/process_sample_data.sh <your-resource-group-name>
254+
```
255+
> **Note**: Replace `<your-resource-group-name>` with the actual name of the resource group containing your deployed Azure resources.
256+
257+
> **💡 Tip**: If the deployment metadata does not exist in Azure or has been deleted, the script will prompt you to manually enter the required configuration values.
258+
259+
> **💡 Tip**: Since this guide is for azd deployment, you'll most likely use the first command without resource group name.
260+
261+
### 2. Configure Authentication
262+
263+
Follow the steps in [App Authentication](./AppAuthentication.md) to configure authentication in App Service.
250264

251-
2. **Add Authentication Provider**
252-
- Follow steps in [App Authentication](./AppAuthentication.md) to configure authentication in app service. Note that Authentication changes can take up to 10 minutes.
265+
> **Note**: Authentication changes can take up to 10 minutes to propagate.
253266

254-
3. **Deleting Resources After a Failed Deployment**
267+
### 3. Troubleshooting: Cleaning Up After a Failed Deployment
255268

256-
- Follow steps in [Delete Resource Group](DeleteResourceGroup.md) if your deployment fails and/or you need to clean up the resources.
269+
If your deployment fails and you need to clean up resources, follow the steps in [Delete Resource Group](./DeleteResourceGroup.md).
257270

258271
## Environment configuration for local development & debugging
259272
> Set APP_ENV in your .env file to control Azure authentication. Set the environment variable to dev to use Azure CLI credentials, or to prod to use Managed Identity for production. **Ensure you're logged in via az login when using dev in local**.

0 commit comments

Comments
 (0)