Skip to content

Commit 137ca2f

Browse files
Merge pull request #621 from microsoft/dev
fix: Dev to main
2 parents f427ed0 + 8aa38d3 commit 137ca2f

File tree

9 files changed

+419
-448
lines changed

9 files changed

+419
-448
lines changed

.github/workflows/deploy-KMGeneric.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
az deployment group create \
125125
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
126126
--template-file infra/main.bicep \
127-
--parameters solutionName=${{env.SOLUTION_PREFIX}} contentUnderstandingLocation="swedencentral" secondaryLocation="${{ env.AZURE_LOCATION }}" imageTag=${{ steps.determine_tag.outputs.tagname }} gptDeploymentCapacity=150 azureAiServiceLocation="${{ env.AZURE_LOCATION }}" createdBy="Pipeline" tags="{'SecurityControl':'Ignore','Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}"
127+
--parameters solutionName=${{env.SOLUTION_PREFIX}} location="${{ env.AZURE_LOCATION }}" contentUnderstandingLocation="swedencentral" secondaryLocation="${{ env.AZURE_LOCATION }}" gptDeploymentCapacity=150 aiServiceLocation="${{ env.AZURE_LOCATION }}" createdBy="Pipeline" tags="{'SecurityControl':'Ignore','Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}"
128128
129129
130130

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# AVM Post Deployment Guide
2+
3+
> **📋 Note**: This guide is specifically for post-deployment steps after using the AVM template. For complete deployment instructions, see the main [Deployment Guide](./DeploymentGuide.md).
4+
5+
---
6+
7+
This document provides guidance on post-deployment steps after deploying the Conversation Knowledge Mining solution accelerator from the [AVM (Azure Verified Modules) repository](https://github.com/Azure/bicep-registry-modules/tree/main/avm/ptn/sa/conversation-knowledge-mining).
8+
9+
## Prerequisites
10+
11+
- **Deployed Infrastructure** - A successful Conversation Knowledge Mining solution accelerator deployment from the [AVM repository](https://github.com/Azure/bicep-registry-modules/tree/main/avm/ptn/sa/conversation-knowledge-mining)
12+
13+
## Post Deployment Steps
14+
15+
### 1. Access the Application
16+
17+
1. Navigate to the [Azure Portal](https://portal.azure.com)
18+
2. Open the resource group created during deployment
19+
3. Locate the App Service with name starting with `app-`
20+
4. Copy the **URL** from the Overview page
21+
5. Open the URL in your browser to access the application
22+
23+
### 2. Configure Authentication (Optional)
24+
25+
If you want to enable authentication, configure it by following the [App Authentication Guide](./AppAuthentication.md).
26+
27+
### 3. Verify Data Processing
28+
29+
- Check that sample data has been uploaded to the storage account
30+
- Verify that the AI Search index has been created and populated
31+
- Confirm that the application loads without errors
32+
33+
## Getting Started
34+
35+
### Sample Questions
36+
37+
Try these questions in the application to explore the solution capabilities:
38+
39+
- "Total number of calls by date for the last 7 days"
40+
- "Show average handling time by topics in minutes"
41+
- "What are the top 7 challenges users reported?"
42+
- "Give a summary of billing issues"
43+
- "When customers call in about unexpected charges, what types of charges are they seeing?"

documents/CustomizeData.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ If you would like to update the solution to leverage your own data please follow
1010

1111
1. Navigate to the storage account in the resource group you are using for this solution.
1212
2. Open the `data` container
13+
14+
> **Note for WAF-aligned deployments:** If your deployment uses private networking, you'll need to log into a VM within the virtual network to upload files. See [VM login instructions](#how-to-login-to-vm-using-azure-bastion) below.
15+
1316
3. If you have audio files, upload them to `custom_audiodata` folder. If you have call transcript files, upload them to `custom_transcripts` folder.
1417
4. Navigate to the terminal and run the `run_process_data_scripts.sh` to process the new data into the solution with the following commands.
1518
```shell
@@ -21,17 +24,14 @@ If you would like to update the solution to leverage your own data please follow
2124
```
2225
a. resourcegroupname_param - the name of the resource group.
2326

24-
> Note (WAF‑aligned deployments): If you deployed the solution with the WAF / private networking option enabled, you must run the data processing script **from inside the deployed VM (jumpbox / processing VM)** so it can reach the private endpoints. Follow these steps:
25-
>
26-
> 1. Connect to the VM (Azure Bastion, SSH, or RDP depending on OS).
27-
> 2. Ensure the repo (or the `infra/scripts` folder) is present. If not, clone or pull it.
28-
> 3. Open a Bash-compatible shell (Git Bash on Windows, or native bash on Linux).
29-
> 4. Run `az login` (add `--tenant <tenantId>` if required by your org policy).
30-
> 5. Navigate to `infra/scripts` and execute:
31-
> ```bash
32-
> bash run_process_data_scripts.sh <resource-group-name>
33-
> ```
34-
> 6. Replace `<resource-group-name>` with the name of the resource group you deployed (same value used for `resourcegroupname_param`).
35-
>
36-
> Tip: If Azure CLI is not installed on the VM, install it first (see official docs) before running the script.
27+
## How to Login to VM Using Azure Bastion
28+
29+
For WAF-aligned deployments with private networking:
30+
31+
1. Navigate to your VM in the Azure portal
32+
2. Click **Connect****Bastion**
33+
3. Enter your VM credentials (username and password) and click **Connect**
34+
4. Wait for the Bastion connection to establish - this may take a few moments
35+
5. Once connected, you'll have access to the VM desktop/terminal interface
36+
3737

infra/process_data_scripts.bicep

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,33 @@ param solutionLocation string
22
param keyVaultName string
33
param managedIdentityResourceId string
44
param managedIdentityClientId string
5+
param storageAccount string
6+
param enablePrivateNetworking bool = false
7+
param subnetId string = ''
58

69
var baseUrl = 'https://raw.githubusercontent.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/main/'
710

8-
resource process_data_scripts 'Microsoft.Resources/deploymentScripts@2020-10-01' = {
9-
kind:'AzureCLI'
10-
name: 'process_data_scripts'
11-
location: solutionLocation // Replace with your desired location
12-
identity: {
13-
type: 'UserAssigned'
14-
userAssignedIdentities: {
15-
'${managedIdentityResourceId}' : {}
16-
}
17-
}
18-
properties: {
11+
module uploadFiles 'br/public:avm/res/resources/deployment-script:0.5.1' = {
12+
name: take('avm.res.resources.deployment-script.uploadFiles', 64)
13+
params: {
14+
kind: 'AzureCLI'
15+
name: 'process_data_scripts'
1916
azCliVersion: '2.52.0'
20-
primaryScriptUri: '${baseUrl}infra/scripts/process_data_scripts.sh'
21-
arguments: '${baseUrl} ${keyVaultName} ${managedIdentityClientId}' // Specify any arguments for the script
22-
timeout: 'PT1H' // Specify the desired timeout duration
23-
retentionInterval: 'PT1H' // Specify the desired retention interval
24-
cleanupPreference:'OnSuccess'
17+
cleanupPreference: 'Always'
18+
location: solutionLocation
19+
managedIdentities: {
20+
userAssignedResourceIds: [
21+
managedIdentityResourceId
22+
]
23+
}
24+
retentionInterval: 'P1D'
25+
runOnce: true
26+
primaryScriptUri: '${baseUrl}infra/scripts/process_data_scripts.sh'
27+
arguments: '${baseUrl} ${keyVaultName} ${managedIdentityClientId}'
28+
storageAccountResourceId: storageAccount
29+
subnetResourceIds: (enablePrivateNetworking && !empty(subnetId)) ? [
30+
subnetId
31+
] : null
32+
timeout: 'PT1H'
2533
}
2634
}

infra/scripts/checkquota_ckmv2.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ for REGION in "${REGIONS[@]}"; do
5454

5555
if [ -z "$MODEL_INFO" ]; then
5656
echo "⚠️ WARNING: No quota information found for model: $MODEL in $REGION. Skipping."
57+
INSUFFICIENT_QUOTA=true
5758
continue
5859
fi
5960

infra/scripts/checkquota_km.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ for REGION in "${REGIONS[@]}"; do
5656

5757
if [ -z "$MODEL_INFO" ]; then
5858
echo "⚠️ WARNING: No quota information found for model: $MODEL in $REGION. Skipping."
59+
INSUFFICIENT_QUOTA=true
5960
continue
6061
fi
6162

infra/scripts/run_process_data_scripts.sh

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,92 @@ sqlServerLocation=$(az sql server list --resource-group "$resourceGroupName" --q
3636
# === Retrieve the principal ID of the first user-assigned identity with name starting with 'id-' ===
3737
managedIdentityClientId=$(az identity list --resource-group "$resourceGroupName" --query "[?starts_with(name, 'id-') && !starts_with(name, 'id-sql-')].clientId | [0]" -o tsv)
3838

39+
# === Check for VNet deployment ===
40+
echo "Checking for VNet deployment in resource group: $resourceGroupName"
41+
vnetResourceId=$(az network vnet list --resource-group "$resourceGroupName" --query "[0].id" -o tsv)
42+
43+
# === Get resource group location ===
44+
rgLocation=$(az group show --name "$resourceGroupName" --query "location" -o tsv)
45+
46+
# === Find storage account (always needed) ===
47+
echo "Looking for storage account in resource group..."
48+
storageAccountResourceId=$(az storage account list --resource-group "$resourceGroupName" --query "[0].id" -o tsv)
49+
50+
if [ -z "$storageAccountResourceId" ]; then
51+
echo "ERROR: No storage account found in resource group $resourceGroupName"
52+
exit 1
53+
else
54+
echo "Using storage account: $storageAccountResourceId"
55+
fi
56+
57+
if [ -z "$vnetResourceId" ]; then
58+
echo "No VNet found in resource group. Private networking is disabled."
59+
enablePrivateNetworking="false"
60+
subnetId=""
61+
solutionLocation="$sqlServerLocation"
62+
echo "Using SQL Server location for solution: $solutionLocation"
63+
else
64+
echo "VNet found: $vnetResourceId"
65+
echo "VNet detected - enabling private networking."
66+
enablePrivateNetworking="true"
67+
solutionLocation="$rgLocation"
68+
echo "Using Resource Group location for solution: $solutionLocation"
69+
70+
# === Find the deployment script subnet ===
71+
echo "Looking for deployment-scripts subnet..."
72+
subnetId=$(az network vnet subnet list --resource-group "$resourceGroupName" --vnet-name $(basename "$vnetResourceId") --query "[?name=='deployment-scripts'].id | [0]" -o tsv)
73+
74+
if [ -z "$subnetId" ]; then
75+
echo "Warning: deployment-scripts subnet not found. Checking for alternative subnet names..."
76+
# Try alternative names
77+
subnetId=$(az network vnet subnet list --resource-group "$resourceGroupName" --vnet-name $(basename "$vnetResourceId") --query "[?contains(name, 'deployment') || contains(name, 'script')].id | [0]" -o tsv)
78+
fi
79+
80+
if [ -z "$subnetId" ]; then
81+
echo "Warning: No deployment script subnet found. Private networking will be disabled for deployment script."
82+
enablePrivateNetworking="false"
83+
subnetId=""
84+
else
85+
echo "Using deployment script subnet: $subnetId"
86+
fi
87+
fi
88+
3989
# === Validate that all required resources were found ===
40-
if [[ -z "$keyVaultName" || -z "$sqlServerLocation" || -z "$managedIdentityResourceId" || ! "$managedIdentityResourceId" =~ ^/subscriptions/ ]]; then
90+
if [[ -z "$keyVaultName" || -z "$solutionLocation" || -z "$managedIdentityResourceId" || ! "$managedIdentityResourceId" =~ ^/subscriptions/ ]]; then
4191
echo "ERROR: Could not find required resources in resource group $resourceGroupName or managedIdentityResourceId is invalid"
4292
exit 1
4393
fi
4494

45-
echo "Using SQL Server Location: $sqlServerLocation"
95+
echo "Using Solution Location: $solutionLocation"
4696
echo "Using Key Vault: $keyVaultName"
4797
echo "Using Managed Identity Resource Id: $managedIdentityResourceId"
4898
echo "Using Managed Identity ClientId Id: $managedIdentityClientId"
99+
echo "Enable Private Networking: $enablePrivateNetworking"
100+
echo "Subnet ID: $subnetId"
101+
echo "Storage Account Resource ID: $storageAccountResourceId"
49102

50103
# === Deploy resources using the specified Bicep template ===
51104
echo "Deploying Bicep template..."
52105

106+
# Build base parameters
107+
deploymentParams="solutionLocation=$solutionLocation keyVaultName=$keyVaultName managedIdentityResourceId=$managedIdentityResourceId managedIdentityClientId=$managedIdentityClientId storageAccount=$storageAccountResourceId"
108+
109+
# Add networking parameters if VNet is deployed
110+
if [ "$enablePrivateNetworking" = "true" ]; then
111+
deploymentParams="$deploymentParams enablePrivateNetworking=true"
112+
if [ -n "$subnetId" ]; then
113+
deploymentParams="$deploymentParams subnetId=$subnetId"
114+
fi
115+
else
116+
deploymentParams="$deploymentParams enablePrivateNetworking=false"
117+
fi
118+
119+
echo "Deployment parameters: $deploymentParams"
120+
53121
# MSYS_NO_PATHCONV disables path conversion in Git Bash for Windows
54122
MSYS_NO_PATHCONV=1 az deployment group create \
55123
--resource-group "$resourceGroupName" \
56124
--template-file "$bicepFile" \
57-
--parameters solutionLocation="$sqlServerLocation" keyVaultName="$keyVaultName" managedIdentityResourceId="$managedIdentityResourceId" managedIdentityClientId="$managedIdentityClientId"
125+
--parameters $deploymentParams
58126

59127
echo "Deployment completed."

0 commit comments

Comments
 (0)