Skip to content

Commit 73fa423

Browse files
fix for agent_id issue (#27)
update biceps to add AZURE_AI_AGENT_ID as an env variable
1 parent f4431fb commit 73fa423

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

azure.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ pipeline:
4343
- USE_APPLICATION_INSIGHTS
4444
- USE_SEARCH_SERVICE
4545
- AZURE_AI_AGENT_NAME
46+
- AZURE_AI_AGENT_ID
4647
- AZURE_AI_AGENT_DEPLOYMENT_NAME
4748
- AZURE_AI_AGENT_DEPLOYMENT_SKU
4849
- AZURE_AI_AGENT_DEPLOYMENT_CAPACITY

infra/api.bicep

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ param exists bool
1010
param projectConnectionString string
1111
param agentDeploymentName string
1212
param agentName string
13+
param agentID string
1314

1415
resource apiIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
1516
name: identityName
@@ -29,6 +30,10 @@ var env = [
2930
name: 'AZURE_AI_AGENT_NAME'
3031
value: agentName
3132
}
33+
{
34+
name: 'AZURE_AI_AGENT_ID'
35+
value: agentID
36+
}
3237
{
3338
name: 'AZURE_AI_AGENT_DEPLOYMENT_NAME'
3439
value: agentDeploymentName

infra/main.bicep

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ param principalId string = ''
7575
param agentModelFormat string
7676
@description('Name of agent to deploy')
7777
param agentName string
78+
@description('ID of agent to deploy')
79+
param aiAgentID string = ''
7880
@description('Name of the chat model to deploy')
7981
param agentModelName string
8082
@description('Name of the model deployment')
@@ -126,6 +128,8 @@ var resourceToken = toLower(uniqueString(subscription().id, environmentName, loc
126128
var projectName = !empty(aiProjectName) ? aiProjectName : 'ai-project-${resourceToken}'
127129
var tags = { 'azd-env-name': environmentName }
128130

131+
var agentID = !empty(aiAgentID) ? aiAgentID : ''
132+
129133
var aiDeployments = [
130134
{
131135
name: agentDeploymentName
@@ -331,6 +335,7 @@ module api 'api.bicep' = {
331335
projectConnectionString: projectConnectionString
332336
agentDeploymentName: agentDeploymentName
333337
agentName: agentName
338+
agentID: agentID
334339
exists: apiAppExists
335340
}
336341
}
@@ -342,6 +347,7 @@ output AZURE_TENANT_ID string = tenant().tenantId
342347
output AZURE_AIPROJECT_CONNECTION_STRING string = projectConnectionString
343348
output AZURE_AI_AGENT_DEPLOYMENT_NAME string = agentDeploymentName
344349
output AZURE_AI_AGENT_NAME string = agentName
350+
output AZURE_AI_AGENT_ID string = agentID
345351

346352
// Outputs required by azd for ACA
347353
output AZURE_CONTAINER_ENVIRONMENT_NAME string = containerApps.outputs.environmentName

infra/main.parameters.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@
5353
"agentName": {
5454
"value": "${AZURE_AI_AGENT_NAME=agent-template-assistant}"
5555
},
56+
"aiAgentID": {
57+
"value": "${AZURE_AI_AGENT_ID}"
58+
},
5659
"agentDeploymentName": {
5760
"value": "${AZURE_AI_AGENT_MODEL_NAME=gpt-4o-mini}"
5861
},

0 commit comments

Comments
 (0)