Skip to content

Commit 5f052e4

Browse files
committed
Fix deploy to azure
1 parent 01504e3 commit 5f052e4

File tree

3 files changed

+168
-169
lines changed

3 files changed

+168
-169
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ The app code runs in Azure Container apps to process the user input and generate
2525

2626
### Quick Deploy
2727

28-
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/Azure-Samples/get-started-with-ai-agents) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/Azure-Samples/get-started-with-ai-agents) |
29-
|---|---|
28+
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/Azure-Samples/get-started-with-ai-agents) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/Azure-Samples/get-started-with-ai-agents) | [![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure-Samples%2Fget-started-with-ai-agents%2Frefs%2Fheads%2Fmain%2Finfra%2Fmain.json) |
29+
|---|---|---|
3030

3131
Github Codespaces and Dev Containers both allow you to download and deploy the code for development. You can also continue with local development. Once you have selected your environment, follow the instructions below to customize and deploy your solution.
3232

infra/main.bicep

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -53,60 +53,58 @@ param aiSearchIndexName string = ''
5353
param storageAccountName string = ''
5454
@description('The log analytics workspace name. If ommited will be generated')
5555
param logAnalyticsWorkspaceName string = ''
56-
@description('Id of the user or app to assign application roles')
57-
param principalId string = ''
5856

5957
// Chat completion model
6058
@description('Format of the chat model to deploy')
6159
@allowed(['Microsoft', 'OpenAI'])
62-
param agentModelFormat string
60+
param agentModelFormat string = 'OpenAI'
6361
@description('Name of agent to deploy')
64-
param agentName string
62+
param agentName string = 'agent-template-assistant'
6563
@description('ID of agent to deploy')
6664
param aiAgentID string = ''
6765
@description('Name of the chat model to deploy')
68-
param agentModelName string
66+
param agentModelName string = 'gpt-4o-mini'
6967
@description('Name of the model deployment')
70-
param agentDeploymentName string
68+
param agentDeploymentName string = 'gpt-4o-mini'
7169

7270
@description('Version of the chat model to deploy')
7371
// See version availability in this table:
7472
// https://learn.microsoft.com/azure/ai-services/openai/concepts/models#global-standard-model-availability
75-
param agentModelVersion string
73+
param agentModelVersion string = '2024-07-18'
7674

7775
@description('Sku of the chat deployment')
78-
param agentDeploymentSku string
76+
param agentDeploymentSku string = 'GlobalStandard'
7977

8078
@description('Capacity of the chat deployment')
8179
// You can increase this, but capacity is limited per model/region, so you will get errors if you go over
8280
// https://learn.microsoft.com/en-us/azure/ai-services/openai/quotas-limits
83-
param agentDeploymentCapacity int
81+
param agentDeploymentCapacity int = 30
8482

8583
// Embedding model
8684
@description('Format of the embedding model to deploy')
8785
@allowed(['Microsoft', 'OpenAI'])
88-
param embedModelFormat string
86+
param embedModelFormat string = 'OpenAI'
8987

9088
@description('Name of the embedding model to deploy')
91-
param embedModelName string
89+
param embedModelName string = 'text-embedding-3-small'
9290
@description('Name of the embedding model deployment')
93-
param embeddingDeploymentName string
91+
param embeddingDeploymentName string = 'text-embedding-3-small'
9492
@description('Embedding model dimensionality')
95-
param embeddingDeploymentDimensions string
93+
param embeddingDeploymentDimensions string = '100'
9694

9795
@description('Version of the embedding model to deploy')
9896
// See version availability in this table:
9997
// https://learn.microsoft.com/azure/ai-services/openai/concepts/models#embeddings-models
10098
@secure()
101-
param embedModelVersion string
99+
param embedModelVersion string = '1'
102100

103101
@description('Sku of the embeddings model deployment')
104-
param embedDeploymentSku string
102+
param embedDeploymentSku string = 'Standard'
105103

106104
@description('Capacity of the embedding deployment')
107105
// You can increase this, but capacity is limited per model/region, so you will get errors if you go over
108106
// https://learn.microsoft.com/azure/ai-services/openai/quotas-limits
109-
param embedDeploymentCapacity int
107+
param embedDeploymentCapacity int = 30
110108

111109
param useContainerRegistry bool = true
112110
param useApplicationInsights bool = true
@@ -249,7 +247,7 @@ module userRoleAzureAIDeveloperBackendExistingProjectRG 'core/security/role.bice
249247
scope: existingProjectRG
250248
params: {
251249
principalId: api.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID
252-
roleDefinitionId: '64702f94-c441-49e6-a78b-ef80e0188fee'
250+
roleDefinitionId: '64702f94-c441-49e6-a78b-ef80e0188fee'
253251
}
254252
}
255253

@@ -297,47 +295,47 @@ module api 'api.bicep' = {
297295
}
298296
}
299297

300-
module userAcrRolePush 'core/security/role.bicep' = if (!empty(principalId)) {
298+
module userAcrRolePush 'core/security/role.bicep' = {
301299
name: 'user-role-acr-push'
302300
scope: rg
303301
params: {
304-
principalId: principalId
302+
principalId: api.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID
305303
roleDefinitionId: '8311e382-0749-4cb8-b61a-304f252e45ec'
306304
}
307305
}
308306

309-
module userAcrRolePull 'core/security/role.bicep' = if (!empty(principalId)) {
307+
module userAcrRolePull 'core/security/role.bicep' = {
310308
name: 'user-role-acr-pull'
311309
scope: rg
312310
params: {
313-
principalId: principalId
311+
principalId: api.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID
314312
roleDefinitionId: '7f951dda-4ed3-4680-a7ca-43fe172d538d'
315313
}
316314
}
317315

318-
module userRoleDataScientist 'core/security/role.bicep' = if (!empty(principalId)) {
316+
module userRoleDataScientist 'core/security/role.bicep' = {
319317
name: 'user-role-data-scientist'
320318
scope: rg
321319
params: {
322-
principalId: principalId
320+
principalId: api.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID
323321
roleDefinitionId: 'f6c7c914-8db3-469d-8ca1-694a8f32e121'
324322
}
325323
}
326324

327-
module userRoleSecretsReader 'core/security/role.bicep' = if (!empty(principalId)) {
325+
module userRoleSecretsReader 'core/security/role.bicep' = {
328326
name: 'user-role-secrets-reader'
329327
scope: rg
330328
params: {
331-
principalId: principalId
329+
principalId: api.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID
332330
roleDefinitionId: 'ea01e6af-a1c1-4350-9563-ad00f8c72ec5'
333331
}
334332
}
335333

336-
module userRoleAzureAIDeveloper 'core/security/role.bicep' = if (!empty(principalId)) {
334+
module userRoleAzureAIDeveloper 'core/security/role.bicep' = {
337335
name: 'user-role-azureai-developer'
338336
scope: rg
339337
params: {
340-
principalId: principalId
338+
principalId: api.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID
341339
roleDefinitionId: '64702f94-c441-49e6-a78b-ef80e0188fee'
342340
}
343341
}
@@ -369,29 +367,29 @@ module backendRoleSearchServiceContributorRG 'core/security/role.bicep' = if (us
369367
}
370368
}
371369

372-
module userRoleSearchIndexDataContributorRG 'core/security/role.bicep' = if (useSearchService && !empty(principalId)) {
370+
module userRoleSearchIndexDataContributorRG 'core/security/role.bicep' = if (useSearchService) {
373371
name: 'user-role-azure-index-data-contributor-rg'
374372
scope: rg
375373
params: {
376-
principalId: principalId
374+
principalId: api.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID
377375
roleDefinitionId: '8ebe5a00-799e-43f5-93ac-243d3dce84a7'
378376
}
379377
}
380378

381-
module userRoleSearchIndexDataReaderRG 'core/security/role.bicep' = if (useSearchService && !empty(principalId)) {
379+
module userRoleSearchIndexDataReaderRG 'core/security/role.bicep' = if (useSearchService) {
382380
name: 'user-role-azure-index-data-reader-rg'
383381
scope: rg
384382
params: {
385-
principalId: principalId
383+
principalId: api.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID
386384
roleDefinitionId: '1407120a-92aa-4202-b7e9-c0e197c71c8f'
387385
}
388386
}
389387

390-
module userRoleSearchServiceContributorRG 'core/security/role.bicep' = if (useSearchService && !empty(principalId)) {
388+
module userRoleSearchServiceContributorRG 'core/security/role.bicep' = if (useSearchService) {
391389
name: 'user-role-azure-search-service-contributor-rg'
392390
scope: rg
393391
params: {
394-
principalId: principalId
392+
principalId: api.outputs.SERVICE_API_IDENTITY_PRINCIPAL_ID
395393
roleDefinitionId: '7ca78c08-252a-4471-8644-bb5ff32d4ba0'
396394
}
397395
}

0 commit comments

Comments
 (0)