Skip to content

Commit 6d0149d

Browse files
Merge pull request #215 from microsoft/PSL-deployment-update
fix: updated deployment files
2 parents f578683 + eda8055 commit 6d0149d

File tree

7 files changed

+86
-26
lines changed

7 files changed

+86
-26
lines changed

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,67 @@ Once you've opened the project in [Codespaces](#github-codespaces), in [Dev Cont
159159
160160
You can view the permissions for your account and subscription by going to Azure portal, clicking 'Subscriptions' under 'Navigation' and then choosing your subscription from the list. If you try to search for your subscription and it does not come up, make sure no filters are selected. After selecting your subscription, select 'Access control (IAM)' and you can see the roles that are assigned to your account for this subscription. If you want to see more information about the roles, you can go to the 'Role assignments' tab and search by your account name and then click the role you want to view more information about.
161161
162+
## Customizing resource names
163+
164+
By default this template will use a default naming convention to prevent naming collisions within Azure.
165+
To override default naming conventions the following can be set.
166+
167+
* `AZURE_ENV_CU_LOCATION` - The name of the Content Understanding Location
168+
* `AZURE_ENV_SECONDARY_LOCATION` - The name of the Secondary Location
169+
* `AZURE_ENV_MODEL_DEPLOYMENT_TYPE` - The name of the Model Deployment Type
170+
* `AZURE_ENV_MODEL_NAME` - The name of the Model Name
171+
* `AZURE_ENV_MODEL_CAPACITY` - The name of the Model Capacity
172+
* `AZURE_ENV_EMBEDDING_MODEL_NAME` - The name of the Embedding Model
173+
* `AZURE_ENV_EMBEDDING_MODEL_CAPACITY` - The name of the Embedding Deployment Capacity
174+
175+
To override any of those resource names, run `azd env set <key> <value>` before running `azd up`.
176+
177+
## Customizing deployments
178+
179+
To customize the deployments, you can set the following environment variables:
180+
181+
Change the Content Understanding Location:
182+
183+
```shell
184+
azd env set AZURE_ENV_CU_LOCATION 'West US'
185+
```
186+
187+
Change the Secondary Location:
188+
189+
```shell
190+
azd env set AZURE_ENV_SECONDARY_LOCATION eastus2
191+
```
192+
193+
Change the Model Deployment Type:
194+
195+
```shell
196+
azd env set AZURE_ENV_MODEL_DEPLOYMENT_TYPE GlobalStandard
197+
```
198+
199+
Set the Model Name:
200+
201+
```shell
202+
azd env set AZURE_ENV_MODEL_NAME gpt-4o-mini
203+
```
204+
205+
Change the Model Capacity:
206+
207+
```shell
208+
azd env set AZURE_ENV_MODEL_CAPACITY 100
209+
```
210+
211+
Change the Embedding Model:
212+
213+
```shell
214+
azd env set AZURE_ENV_EMBEDDING_MODEL_NAME text-embedding-ada-002
215+
```
216+
217+
Change the Embedding Deployment Capacity:
218+
219+
```shell
220+
azd env set AZURE_ENV_EMBEDDING_MODEL_CAPACITY 80
221+
```
222+
162223
### Deploying with azd
163224
164225
1. Login to Azure:

infra/deploy_app_service.bicep

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ targetScope = 'resourceGroup'
66
@description('Solution Name')
77
param solutionName string
88

9-
@description('Solution Location')
10-
param solutionLocation string
9+
// @description('Solution Location')
10+
// param solutionLocation string
1111

12-
param identity string
12+
// param identity string
1313

1414
@description('Name of App Service plan')
1515
param HostingPlanName string = '${ solutionName }-app-service-plan'
@@ -50,9 +50,9 @@ param USE_CHAT_HISTORY_ENABLED string = ''
5050
@description('Azure Cosmos DB Account')
5151
param AZURE_COSMOSDB_ACCOUNT string = ''
5252

53-
@description('Azure Cosmos DB Account Key')
54-
@secure()
55-
param AZURE_COSMOSDB_ACCOUNT_KEY string = ''
53+
// @description('Azure Cosmos DB Account Key')
54+
// @secure()
55+
// param AZURE_COSMOSDB_ACCOUNT_KEY string = ''
5656

5757
@description('Azure Cosmos DB Conversations Container')
5858
param AZURE_COSMOSDB_CONVERSATIONS_CONTAINER string = ''

infra/deploy_azure_function_charts.bicep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ param sqlDbName string
66
param sqlDbUser string
77
@secure()
88
param sqlDbPwd string
9-
param managedIdentityObjectId string
9+
// param managedIdentityObjectId string
1010
param imageTag string
1111
var functionAppName = '${solutionName}-charts-fn'
12-
var storageaccountname = '${solutionName}chartsfnacc'
12+
var storageaccountname = '${solutionName}chartfnacc'
1313
var dockerImage = 'DOCKER|kmcontainerreg.azurecr.io/km-charts-function:${imageTag}'
1414
var environmentName = '${solutionName}-charts-fn-env'
1515

infra/deploy_azure_function_urls.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@description('Specifies the location for resources.')
22
param solutionName string
3-
param identity string
3+
// param identity string
44

55
var chartsfunctionAppName = '${solutionName}-charts-fn'
66
var chartsfunctionName = 'get_metrics'

infra/deploy_storage_account.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ param solutionName string
1010
param solutionLocation string
1111

1212
@description('Name')
13-
param saName string = '${ solutionName }storageaccount'
13+
param saName string = '${ solutionName }storage'
1414

1515
param keyVaultName string
1616
param managedIdentityObjectId string

infra/main.bicep

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ targetScope = 'resourceGroup'
66
@description('A unique prefix for all resources in this deployment. This should be 3-10 characters long:')
77
param environmentName string
88

9-
var solutionPrefix = environmentName
10-
119
@minLength(1)
1210
@description('Location for the Content Understanding service deployment:')
1311
@allowed(['West US'
@@ -68,8 +66,10 @@ param embeddingDeploymentCapacity int = 80
6866

6967
param imageTag string = 'latest'
7068

69+
var uniqueId = toLower(uniqueString(subscription().id, environmentName, resourceGroup().location))
70+
var solutionPrefix = 'km${padLeft(take(uniqueId, 12), 12, '0')}'
7171
var resourceGroupLocation = resourceGroup().location
72-
var resourceGroupName = resourceGroup().name
72+
// var resourceGroupName = resourceGroup().name
7373

7474
var solutionLocation = resourceGroupLocation
7575
var baseUrl = 'https://raw.githubusercontent.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/main/'
@@ -191,7 +191,7 @@ module azureFunctionsCharts 'deploy_azure_function_charts.bicep' = {
191191
sqlDbName: sqlDBModule.outputs.sqlDbName
192192
sqlDbUser: sqlDBModule.outputs.sqlDbUser
193193
sqlDbPwd:keyVault.getSecret('SQLDB-PASSWORD')
194-
managedIdentityObjectId:managedIdentityModule.outputs.managedIdentityOutput.objectId
194+
// managedIdentityObjectId:managedIdentityModule.outputs.managedIdentityOutput.objectId
195195
}
196196
dependsOn:[keyVault]
197197
}
@@ -225,7 +225,7 @@ module azureFunctionURL 'deploy_azure_function_urls.bicep' = {
225225
name : 'deploy_azure_function_urls'
226226
params:{
227227
solutionName: solutionPrefix
228-
identity:managedIdentityModule.outputs.managedIdentityOutput.id
228+
// identity:managedIdentityModule.outputs.managedIdentityOutput.id
229229
}
230230
dependsOn:[azureFunctionsCharts,azureragFunctionsRag]
231231
}
@@ -235,9 +235,9 @@ module appserviceModule 'deploy_app_service.bicep' = {
235235
name: 'deploy_app_service'
236236
params: {
237237
imageTag: imageTag
238-
identity:managedIdentityModule.outputs.managedIdentityOutput.id
238+
// identity:managedIdentityModule.outputs.managedIdentityOutput.id
239239
solutionName: solutionPrefix
240-
solutionLocation: solutionLocation
240+
// solutionLocation: solutionLocation
241241
AzureOpenAIEndpoint:aifoundry.outputs.aiServicesTarget
242242
AzureOpenAIModel: gptModelName //'gpt-4o-mini'
243243
AzureOpenAIKey:keyVault.getSecret('AZURE-OPENAI-KEY')
@@ -250,7 +250,7 @@ module appserviceModule 'deploy_app_service.bicep' = {
250250
GRAPHRAG_URL:azureFunctionURL.outputs.functionURLsOutput.graphrag_function_url
251251
RAG_URL:azureFunctionURL.outputs.functionURLsOutput.rag_function_url
252252
AZURE_COSMOSDB_ACCOUNT: cosmosDBModule.outputs.cosmosAccountName
253-
AZURE_COSMOSDB_ACCOUNT_KEY: keyVault.getSecret('AZURE-COSMOSDB-ACCOUNT-KEY')
253+
// AZURE_COSMOSDB_ACCOUNT_KEY: keyVault.getSecret('AZURE-COSMOSDB-ACCOUNT-KEY')
254254
AZURE_COSMOSDB_CONVERSATIONS_CONTAINER: cosmosDBModule.outputs.cosmosContainerName
255255
AZURE_COSMOSDB_DATABASE: cosmosDBModule.outputs.cosmosDatabaseName
256256
AZURE_COSMOSDB_ENABLE_FEEDBACK:'True'

infra/main.bicepparam

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
using './main.bicep'
22

33
param environmentName = readEnvironmentVariable('AZURE_ENV_NAME', 'env_name')
4-
param contentUnderstandingLocation = 'West US'
5-
param secondaryLocation = 'eastus2'
6-
param deploymentType = 'GlobalStandard'
7-
param gptModelName = 'gpt-4o-mini'
8-
param gptDeploymentCapacity = 100
9-
param embeddingModel = 'text-embedding-ada-002'
10-
param embeddingDeploymentCapacity = 80
11-
4+
param contentUnderstandingLocation = readEnvironmentVariable('AZURE_ENV_CU_LOCATION', 'West US')
5+
param secondaryLocation = readEnvironmentVariable('AZURE_ENV_SECONDARY_LOCATION', 'eastus2')
6+
param deploymentType = readEnvironmentVariable('AZURE_ENV_MODEL_DEPLOYMENT_TYPE', 'GlobalStandard')
7+
param gptModelName = readEnvironmentVariable('AZURE_ENV_MODEL_NAME', 'gpt-4o-mini')
8+
param gptDeploymentCapacity = int(readEnvironmentVariable('AZURE_ENV_MODEL_CAPACITY', '100'))
9+
param embeddingModel = readEnvironmentVariable('AZURE_ENV_EMBEDDING_MODEL_NAME', 'text-embedding-ada-002')
10+
param embeddingDeploymentCapacity = int(readEnvironmentVariable('AZURE_ENV_EMBEDDING_MODEL_CAPACITY', '80'))

0 commit comments

Comments
 (0)