Skip to content

Commit d8b0442

Browse files
Merge pull request #482 from microsoft/psl-pk-km-fdp
refactor: Configuration and Deployment Adjustments, Standardization of Azure OpenAI Naming Conventions
2 parents 837cb87 + 3c54f6d commit d8b0442

27 files changed

+180
-149
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
AZURE_AI_SEARCH_API_KEY=""
2-
AZURE_OPENAI_API_KEY=""
32

docs/workshop/docs/workshop/Challenge-3-and-4/Challenge-3.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ One of the easiest and most fun changes you can make to the app is updating the
5757
![Azure Portal Settings > Configuration](../img/portal-app-api-env.png)
5858
5. Locate the following environment variables:
5959
- `AZURE_AI_SEARCH_API_KEY`
60-
- `AZURE_OPENAI_API_KEY`
6160
6. Copy their values and paste them into your local `\workshop\docs\workshop\.env.sample` file:
6261
`AZURE_AI_SEARCH_API_KEY=your-key-from-portal`
63-
`AZURE_OPENAI_API_KEY=your-other-key-from-portal`
6462
7. Rename the .env.sample file to .env
6563
8. Open a terminal or command prompt.
6664
9. Navigate to the project directory where `start.cmd` is located:

docs/workshop/docs/workshop/Challenge-3-and-4/knowledge_mining_api.ipynb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,8 @@
113113
"# Define a chat with data plugin for the conversational data\n",
114114
"class ChatWithDataPlugin:\n",
115115
" def __init__(self):\n",
116-
" self.azure_openai_deployment_model = os.getenv(\"AZURE_OPEN_AI_DEPLOYMENT_MODEL\")\n",
117-
" self.azure_openai_endpoint = os.getenv(\"AZURE_OPEN_AI_ENDPOINT\")\n",
118-
" self.azure_openai_api_key = os.getenv(\"AZURE_OPENAI_API_KEY\")\n",
116+
" self.azure_openai_deployment_model = os.getenv(\"AZURE_OPENAI_DEPLOYMENT_MODEL\")\n",
117+
" self.azure_openai_endpoint = os.getenv(\"AZURE_OPENAI_ENDPOINT\")\n",
119118
" self.azure_openai_api_version = os.getenv(\"AZURE_OPENAI_API_VERSION\")\n",
120119
" self.azure_ai_search_endpoint = os.getenv(\"AZURE_AI_SEARCH_ENDPOINT\")\n",
121120
" self.azure_ai_search_api_key = os.getenv(\"AZURE_AI_SEARCH_API_KEY\")\n",

docs/workshop/docs/workshop/Challenge-6/Content_safety_evaluation.ipynb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,8 @@
209209
"outputs": [],
210210
"source": [
211211
"model_config = {\n",
212-
" \"azure_endpoint\": os.environ.get(\"AZURE_OPEN_AI_ENDPOINT\"),\n",
213-
" \"api_key\": os.environ.get(\"AZURE_OPENAI_API_KEY\"),\n",
214-
" \"azure_deployment\": os.environ.get(\"AZURE_OPEN_AI_DEPLOYMENT_MODEL\"),\n",
212+
" \"azure_endpoint\": os.environ.get(\"AZURE_OPENAI_ENDPOINT\"),\n",
213+
" \"azure_deployment\": os.environ.get(\"AZURE_OPENAI_DEPLOYMENT_MODEL\"),\n",
215214
" \"api_version\": os.environ.get(\"AZURE_OPENAI_API_VERSION\"),\n",
216215
"}"
217216
]

documents/CustomizingAzdParameters.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ By default this template will use the environment name as the prefix to prevent
1313
| `AZURE_ENV_NAME` | string | `env_name` | Sets the environment name prefix for all Azure resources. |
1414
| `AZURE_CONTENT_UNDERSTANDING_LOCATION` | string | `swedencentral` | Specifies the region for content understanding resources. |
1515
| `AZURE_SECONDARY_LOCATION` | string | `eastus2` | Specifies a secondary Azure region. |
16-
| `AZURE_OPEN_AI_MODEL_DEPLOYMENT_TYPE` | string | `GlobalStandard` | Defines the model deployment type (allowed: `Standard`, `GlobalStandard`). |
17-
| `AZURE_OPEN_AI_DEPLOYMENT_MODEL` | string | `gpt-4o-mini` | Specifies the GPT model name (e.g., `gpt-4`, `gpt-4o-mini`). |
16+
| `AZURE_OPENAI_MODEL_DEPLOYMENT_TYPE` | string | `GlobalStandard` | Defines the model deployment type (allowed: `Standard`, `GlobalStandard`). |
17+
| `AZURE_OPENAI_DEPLOYMENT_MODEL` | string | `gpt-4o-mini` | Specifies the GPT model name (e.g., `gpt-4`, `gpt-4o-mini`). |
1818
| `AZURE_ENV_MODEL_VERSION` | string | `2024-07-18` | Sets the Azure model version (allowed: `2024-08-06`, etc.). |
1919
| `AZURE_OPENAI_API_VERSION` | string | `2025-01-01-preview` | Specifies the API version for Azure OpenAI. |
20-
| `AZURE_OPEN_AI_DEPLOYMENT_MODEL_CAPACITY` | integer | `30` | Sets the GPT model capacity. |
20+
| `AZURE_OPENAI_DEPLOYMENT_MODEL_CAPACITY` | integer | `30` | Sets the GPT model capacity. |
2121
| `AZURE_OPENAI_EMBEDDING_MODEL` | string | `text-embedding-ada-002` | Sets the name of the embedding model to use. |
2222
| `AZURE_ENV_IMAGETAG` | string | `latest` | Sets the image tag (`latest`, `dev`, `hotfix`, etc.). |
2323
| `AZURE_OPENAI_EMBEDDING_MODEL_CAPACITY` | integer | `80` | Sets the capacity for the embedding model deployment. |

documents/DeploymentGuide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ When you start the deployment, most parameters will have **default values**, but
118118
| **GPT Model Deployment Capacity** | Configure capacity for **GPT models** (in thousands). | 30k |
119119
| **Embedding Model** | Default: **text-embedding-ada-002**. | text-embedding-ada-002 |
120120
| **Embedding Model Capacity** | Set the capacity for **embedding models** (in thousands). | 80k |
121-
| **Image Tag** | Docker image tag to deploy. Common values: `latest`, `dev`, `hotfix`. | latest\_migrated |
121+
| **Image Tag** | Docker image tag to deploy. Common values: `latest`, `dev`, `hotfix`. | latest |
122122
| **Existing Log Analytics Workspace** | To reuse an existing Log Analytics Workspace ID. | *(empty)* |
123123

124124

infra/deploy_ai_foundry.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ resource azureOpenAIApiKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-pr
409409

410410
resource azureOpenAIDeploymentModel 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
411411
parent: keyVault
412-
name: 'AZURE-OPEN-AI-DEPLOYMENT-MODEL'
412+
name: 'AZURE-OPENAI-DEPLOYMENT-MODEL'
413413
properties: {
414414
value: gptModelName
415415
}

infra/main.bicep

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ module backend_docker 'deploy_backend_docker.bicep' = {
204204
keyVaultName: kvault.outputs.keyvaultName
205205
aiServicesName: aifoundry.outputs.aiServicesName
206206
appSettings: {
207-
AZURE_OPEN_AI_DEPLOYMENT_MODEL: gptModelName
208-
AZURE_OPEN_AI_ENDPOINT: aifoundry.outputs.aiServicesTarget
207+
AZURE_OPENAI_DEPLOYMENT_MODEL: gptModelName
208+
AZURE_OPENAI_ENDPOINT: aifoundry.outputs.aiServicesTarget
209209
AZURE_OPENAI_API_VERSION: azureOpenAIApiVersion
210210
AZURE_OPENAI_RESOURCE: aifoundry.outputs.aiServicesName
211211
AZURE_AI_AGENT_ENDPOINT: aifoundry.outputs.projectEndpoint
@@ -220,7 +220,6 @@ module backend_docker 'deploy_backend_docker.bicep' = {
220220
SQLDB_USERNAME: sqlDBModule.outputs.sqlDbUser
221221
SQLDB_USER_MID: managedIdentityModule.outputs.managedIdentityBackendAppOutput.clientId
222222

223-
OPENAI_API_VERSION: azureOpenAIApiVersion
224223
AZURE_AI_SEARCH_ENDPOINT: aifoundry.outputs.aiSearchTarget
225224
AZURE_AI_SEARCH_API_KEY: '@Microsoft.KeyVault(SecretUri=${kvault.outputs.keyvaultUri}secrets/AZURE-SEARCH-KEY/)'
226225
AZURE_AI_SEARCH_INDEX: 'call_transcripts_index'
@@ -264,15 +263,14 @@ output AZURE_COSMOSDB_ACCOUNT string = cosmosDBModule.outputs.cosmosAccountName
264263
output AZURE_COSMOSDB_CONVERSATIONS_CONTAINER string = 'conversations'
265264
output AZURE_COSMOSDB_DATABASE string = 'db_conversation_history'
266265
output AZURE_COSMOSDB_ENABLE_FEEDBACK string = 'True'
267-
output AZURE_OPEN_AI_DEPLOYMENT_MODEL string = gptModelName
268-
output AZURE_OPEN_AI_DEPLOYMENT_MODEL_CAPACITY int = gptDeploymentCapacity
269-
output AZURE_OPEN_AI_ENDPOINT string = aifoundry.outputs.aiServicesTarget
270-
output AZURE_OPEN_AI_MODEL_DEPLOYMENT_TYPE string = deploymentType
266+
output AZURE_OPENAI_DEPLOYMENT_MODEL string = gptModelName
267+
output AZURE_OPENAI_DEPLOYMENT_MODEL_CAPACITY int = gptDeploymentCapacity
268+
output AZURE_OPENAI_ENDPOINT string = aifoundry.outputs.aiServicesTarget
269+
output AZURE_OPENAI_MODEL_DEPLOYMENT_TYPE string = deploymentType
271270
output AZURE_OPENAI_EMBEDDING_MODEL string = embeddingModel
272271
output AZURE_OPENAI_EMBEDDING_MODEL_CAPACITY int = embeddingDeploymentCapacity
273272
output AZURE_OPENAI_API_VERSION string = azureOpenAIApiVersion
274273
output AZURE_OPENAI_RESOURCE string = aifoundry.outputs.aiServicesName
275-
output OPENAI_API_VERSION string = azureOpenAIApiVersion
276274
output REACT_APP_LAYOUT_CONFIG string = backend_docker.outputs.reactAppLayoutConfig
277275
output SQLDB_DATABASE string = sqlDBModule.outputs.sqlDbName
278276
output SQLDB_SERVER string = sqlDBModule.outputs.sqlServerName

infra/main.bicepparam

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ param AZURE_LOCATION = readEnvironmentVariable('AZURE_LOCATION', '')
44
param environmentName = readEnvironmentVariable('AZURE_ENV_NAME', 'env_name')
55
param contentUnderstandingLocation = readEnvironmentVariable('AZURE_CONTENT_UNDERSTANDING_LOCATION', 'swedencentral')
66
param secondaryLocation = readEnvironmentVariable('AZURE_SECONDARY_LOCATION', 'eastus2')
7-
param deploymentType = readEnvironmentVariable('AZURE_OPEN_AI_MODEL_DEPLOYMENT_TYPE', 'GlobalStandard')
8-
param gptModelName = readEnvironmentVariable('AZURE_OPEN_AI_DEPLOYMENT_MODEL', 'gpt-4o-mini')
7+
param deploymentType = readEnvironmentVariable('AZURE_OPENAI_MODEL_DEPLOYMENT_TYPE', 'GlobalStandard')
8+
param gptModelName = readEnvironmentVariable('AZURE_OPENAI_DEPLOYMENT_MODEL', 'gpt-4o-mini')
99
param gptModelVersion = readEnvironmentVariable('AZURE_ENV_MODEL_VERSION', '2024-07-18')
1010
param azureOpenAIApiVersion = readEnvironmentVariable('AZURE_OPENAI_API_VERSION', '2025-01-01-preview')
11-
param gptDeploymentCapacity = int(readEnvironmentVariable('AZURE_OPEN_AI_DEPLOYMENT_MODEL_CAPACITY', '30'))
11+
param gptDeploymentCapacity = int(readEnvironmentVariable('AZURE_OPENAI_DEPLOYMENT_MODEL_CAPACITY', '30'))
1212
param embeddingModel = readEnvironmentVariable('AZURE_OPENAI_EMBEDDING_MODEL', 'text-embedding-ada-002')
1313
param imageTag = readEnvironmentVariable('AZURE_ENV_IMAGETAG', 'latest')
1414
param embeddingDeploymentCapacity = int(readEnvironmentVariable('AZURE_OPENAI_EMBEDDING_MODEL_CAPACITY', '80'))

infra/main.json

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.36.1.42791",
8-
"templateHash": "2363441728169448979"
8+
"templateHash": "13054052551237865749"
99
}
1010
},
1111
"parameters": {
@@ -629,7 +629,7 @@
629629
"_generator": {
630630
"name": "bicep",
631631
"version": "0.36.1.42791",
632-
"templateHash": "18372336587051722949"
632+
"templateHash": "1417417976966483720"
633633
}
634634
},
635635
"parameters": {
@@ -1325,7 +1325,7 @@
13251325
{
13261326
"type": "Microsoft.KeyVault/vaults/secrets",
13271327
"apiVersion": "2021-11-01-preview",
1328-
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'AZURE-OPEN-AI-DEPLOYMENT-MODEL')]",
1328+
"name": "[format('{0}/{1}', parameters('keyVaultName'), 'AZURE-OPENAI-DEPLOYMENT-MODEL')]",
13291329
"properties": {
13301330
"value": "[parameters('gptModelName')]"
13311331
}
@@ -2493,8 +2493,8 @@
24932493
},
24942494
"appSettings": {
24952495
"value": {
2496-
"AZURE_OPEN_AI_DEPLOYMENT_MODEL": "[parameters('gptModelName')]",
2497-
"AZURE_OPEN_AI_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_ai_foundry'), '2022-09-01').outputs.aiServicesTarget.value]",
2496+
"AZURE_OPENAI_DEPLOYMENT_MODEL": "[parameters('gptModelName')]",
2497+
"AZURE_OPENAI_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_ai_foundry'), '2022-09-01').outputs.aiServicesTarget.value]",
24982498
"AZURE_OPENAI_API_VERSION": "[parameters('azureOpenAIApiVersion')]",
24992499
"AZURE_OPENAI_RESOURCE": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_ai_foundry'), '2022-09-01').outputs.aiServicesName.value]",
25002500
"AZURE_AI_AGENT_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_ai_foundry'), '2022-09-01').outputs.projectEndpoint.value]",
@@ -2508,7 +2508,6 @@
25082508
"SQLDB_SERVER": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_sql_db'), '2022-09-01').outputs.sqlServerName.value]",
25092509
"SQLDB_USERNAME": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_sql_db'), '2022-09-01').outputs.sqlDbUser.value]",
25102510
"SQLDB_USER_MID": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_managed_identity'), '2022-09-01').outputs.managedIdentityBackendAppOutput.value.clientId]",
2511-
"OPENAI_API_VERSION": "[parameters('azureOpenAIApiVersion')]",
25122511
"AZURE_AI_SEARCH_ENDPOINT": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_ai_foundry'), '2022-09-01').outputs.aiSearchTarget.value]",
25132512
"AZURE_AI_SEARCH_API_KEY": "[format('@Microsoft.KeyVault(SecretUri={0}secrets/AZURE-SEARCH-KEY/)', reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_keyvault'), '2022-09-01').outputs.keyvaultUri.value)]",
25142513
"AZURE_AI_SEARCH_INDEX": "call_transcripts_index",
@@ -3217,19 +3216,19 @@
32173216
"type": "string",
32183217
"value": "True"
32193218
},
3220-
"AZURE_OPEN_AI_DEPLOYMENT_MODEL": {
3219+
"AZURE_OPENAI_DEPLOYMENT_MODEL": {
32213220
"type": "string",
32223221
"value": "[parameters('gptModelName')]"
32233222
},
3224-
"AZURE_OPEN_AI_DEPLOYMENT_MODEL_CAPACITY": {
3223+
"AZURE_OPENAI_DEPLOYMENT_MODEL_CAPACITY": {
32253224
"type": "int",
32263225
"value": "[parameters('gptDeploymentCapacity')]"
32273226
},
3228-
"AZURE_OPEN_AI_ENDPOINT": {
3227+
"AZURE_OPENAI_ENDPOINT": {
32293228
"type": "string",
32303229
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_ai_foundry'), '2022-09-01').outputs.aiServicesTarget.value]"
32313230
},
3232-
"AZURE_OPEN_AI_MODEL_DEPLOYMENT_TYPE": {
3231+
"AZURE_OPENAI_MODEL_DEPLOYMENT_TYPE": {
32333232
"type": "string",
32343233
"value": "[parameters('deploymentType')]"
32353234
},
@@ -3249,10 +3248,6 @@
32493248
"type": "string",
32503249
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_ai_foundry'), '2022-09-01').outputs.aiServicesName.value]"
32513250
},
3252-
"OPENAI_API_VERSION": {
3253-
"type": "string",
3254-
"value": "[parameters('azureOpenAIApiVersion')]"
3255-
},
32563251
"REACT_APP_LAYOUT_CONFIG": {
32573252
"type": "string",
32583253
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, resourceGroup().name), 'Microsoft.Resources/deployments', 'deploy_backend_docker'), '2022-09-01').outputs.reactAppLayoutConfig.value]"

0 commit comments

Comments
 (0)