Skip to content

Commit 62d46b1

Browse files
committed
updating basic setup
1 parent c33f520 commit 62d46b1

File tree

4 files changed

+91
-111
lines changed

4 files changed

+91
-111
lines changed

use-cases/agents/setup/basic-setup/README.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,18 @@
11
# Azure AI Agent Service: Basic Setup 1RP
22

33
## Basic Agent Setup
4-
5-
> **NOTE:** This template required the following workarounds to be performed after it is deployed:
6-
>
7-
> 1. Assign the project system managed identity (SMI) the following role ‘Azure AI Developer’ on its parent AI Services resource
8-
>
4+
95

106
This bicep template provisions required resources for a basic project setup. A new Cognitive Services Account is created, a gpt-4o model is deployed, and a new project is created.
117

128
All agents created in this project will automatically use Microsoft managed, multitenant search and storage resources.
139

1410
### Prerequisites
15-
1. Use only allowlisted subscriptions for 1RP. Two known allowlisted subscriptions are:
16-
* Azure OpenAI - Agents - Experiments - Microsoft Azure
17-
* AzureAI-Agents-ERA-Corp - Microsoft Azure
18-
19-
1. Westus2 is the only region currently enabled for end-to-end testing. Ensure both Cognitive Services Account and Project are created in this region.
20-
2111
1. To deploy the template, you must have the following roles:
2212
* Cognitive Services Contributor or Contributor
2313
* [This is needed for the workarounds] Owner or Role Based Access Administrator (because we are assigning project SMI the AI Developer Role, won’t be needed once we fix this)
24-
<<<<<<< HEAD:use-cases/agents/setup/basic-setup/README.md
2514
* Permission for: Microsoft.Authorization/roleAssignments/write
2615
1. To create your first agent you must have the permissions: Azure AI Developer and Cognitive Services User
27-
=======
28-
* Permission for: Microsoft.Authorization/roleAssignments/write
29-
1. To create an agent you must have the following roles:
30-
* Azure AI Developer
31-
* Cognitive Services User
32-
33-
>>>>>>> 76d5e96d980cfe782e45278f992cf3a848b51300:scenarios/agents/setup/basic-setup/README.md
3416

3517
### Steps
3618

@@ -40,7 +22,7 @@ All agents created in this project will automatically use Microsoft managed, mul
4022
* Create new (or use existing) resource group:
4123

4224
```bash
43-
az group create --name <new-rg-name> --location westus2
25+
az group create --name <new-rg-name> --location eastus
4426
```
4527

4628
* Deploy the template
Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
param account_name string = 'aiServices${substring(uniqueString(utcNow()), 0,4)}'
2-
param project_name string = 'project'
1+
param accountName string = 'basicaccount${substring(uniqueString(utcNow()), 0,4)}'
2+
param projectName string = 'project'
33
param projectDescription string = 'some description'
44
param projectDisplayName string = 'project_display_name'
5-
param location string = 'westus2'
5+
param location string = resourceGroup().location
66

77
param modelName string = 'gpt-4o'
88
param modelFormat string = 'OpenAI'
99
param modelVersion string = '2024-11-20'
1010
param modelSkuName string = 'GlobalStandard'
1111
param modelCapacity int = 30
1212

13+
1314
#disable-next-line BCP081
14-
resource account_name_resource 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' = {
15-
name: account_name
15+
resource account 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' = {
16+
name: accountName
1617
location: location
1718
sku: {
1819
name: 'S0'
@@ -23,14 +24,14 @@ resource account_name_resource 'Microsoft.CognitiveServices/accounts@2025-04-01-
2324
}
2425
properties: {
2526
allowProjectManagement: true
26-
customSubDomainName: account_name
27+
customSubDomainName: toLower(accountName)
2728
networkAcls: {
2829
defaultAction: 'Allow'
2930
virtualNetworkRules: []
3031
ipRules: []
3132
}
3233
publicNetworkAccess: 'Enabled'
33-
disableLocalAuth: false
34+
disableLocalAuth: true
3435
}
3536
}
3637

@@ -40,31 +41,16 @@ resource account_name_resource 'Microsoft.CognitiveServices/accounts@2025-04-01-
4041
- Agents will use the build-in model deployments
4142
*/
4243

43-
#disable-next-line BCP081
44-
resource modelDeployment 'Microsoft.CognitiveServices/accounts/deployments@2024-10-01'= {
45-
parent: account_name_resource
46-
name: modelName
47-
sku : {
48-
capacity: modelCapacity
49-
name: modelSkuName
50-
}
51-
properties: {
52-
model:{
53-
name: modelName
54-
format: modelFormat
55-
version: modelVersion
56-
}
57-
}
58-
}
44+
5945

6046
/*
6147
Step 3: Create a Cognitive Services Project
6248
6349
*/
6450
#disable-next-line BCP081
65-
resource account_name_project_name 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' = {
66-
parent: account_name_resource
67-
name: '${project_name}'
51+
resource project 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' = {
52+
parent: account
53+
name: projectName
6854
location: location
6955
identity: {
7056
type: 'SystemAssigned'
@@ -75,6 +61,22 @@ resource account_name_project_name 'Microsoft.CognitiveServices/accounts/project
7561
}
7662
}
7763

78-
output ENDPOINT string = account_name_resource.properties.endpoint
79-
output project_name string = account_name_project_name.name
80-
output account_name string = account_name_resource.name
64+
#disable-next-line BCP081
65+
resource modelDeployment 'Microsoft.CognitiveServices/accounts/deployments@2024-10-01'= {
66+
parent: account
67+
name: modelName
68+
sku : {
69+
capacity: modelCapacity
70+
name: modelSkuName
71+
}
72+
properties: {
73+
model:{
74+
name: modelName
75+
format: modelFormat
76+
version: modelVersion
77+
}
78+
}
79+
}
80+
81+
output account_name string = account.name
82+
output project_name string = project.name

use-cases/agents/setup/basic-setup/basic-setup.json

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
"_generator": {
66
"name": "bicep",
77
"version": "0.34.44.8038",
8-
"templateHash": "7003199052869733265"
8+
"templateHash": "1714052608002840600"
99
}
1010
},
1111
"parameters": {
12-
"account_name": {
12+
"accountName": {
1313
"type": "string",
14-
"defaultValue": "[format('aiServices{0}', substring(uniqueString(utcNow()), 0, 4))]"
14+
"defaultValue": "[format('basicaccount{0}', substring(uniqueString(utcNow()), 0, 4))]"
1515
},
16-
"project_name": {
16+
"projectName": {
1717
"type": "string",
1818
"defaultValue": "project"
1919
},
@@ -27,7 +27,7 @@
2727
},
2828
"location": {
2929
"type": "string",
30-
"defaultValue": "westus2"
30+
"defaultValue": "[resourceGroup().location]"
3131
},
3232
"modelName": {
3333
"type": "string",
@@ -54,7 +54,7 @@
5454
{
5555
"type": "Microsoft.CognitiveServices/accounts",
5656
"apiVersion": "2025-04-01-preview",
57-
"name": "[parameters('account_name')]",
57+
"name": "[parameters('accountName')]",
5858
"location": "[parameters('location')]",
5959
"sku": {
6060
"name": "S0"
@@ -65,20 +65,36 @@
6565
},
6666
"properties": {
6767
"allowProjectManagement": true,
68-
"customSubDomainName": "[parameters('account_name')]",
68+
"customSubDomainName": "[toLower(parameters('accountName'))]",
6969
"networkAcls": {
7070
"defaultAction": "Allow",
7171
"virtualNetworkRules": [],
7272
"ipRules": []
7373
},
7474
"publicNetworkAccess": "Enabled",
75-
"disableLocalAuth": false
75+
"disableLocalAuth": true
7676
}
7777
},
78+
{
79+
"type": "Microsoft.CognitiveServices/accounts/projects",
80+
"apiVersion": "2025-04-01-preview",
81+
"name": "[format('{0}/{1}', parameters('accountName'), parameters('projectName'))]",
82+
"location": "[parameters('location')]",
83+
"identity": {
84+
"type": "SystemAssigned"
85+
},
86+
"properties": {
87+
"description": "[parameters('projectDescription')]",
88+
"displayName": "[parameters('projectDisplayName')]"
89+
},
90+
"dependsOn": [
91+
"[resourceId('Microsoft.CognitiveServices/accounts', parameters('accountName'))]"
92+
]
93+
},
7894
{
7995
"type": "Microsoft.CognitiveServices/accounts/deployments",
8096
"apiVersion": "2024-10-01",
81-
"name": "[format('{0}/{1}', parameters('account_name'), parameters('modelName'))]",
97+
"name": "[format('{0}/{1}', parameters('accountName'), parameters('modelName'))]",
8298
"sku": {
8399
"capacity": "[parameters('modelCapacity')]",
84100
"name": "[parameters('modelSkuName')]"
@@ -91,38 +107,18 @@
91107
}
92108
},
93109
"dependsOn": [
94-
"[resourceId('Microsoft.CognitiveServices/accounts', parameters('account_name'))]"
95-
]
96-
},
97-
{
98-
"type": "Microsoft.CognitiveServices/accounts/projects",
99-
"apiVersion": "2025-04-01-preview",
100-
"name": "[format('{0}/{1}', parameters('account_name'), format('{0}', parameters('project_name')))]",
101-
"location": "[parameters('location')]",
102-
"identity": {
103-
"type": "SystemAssigned"
104-
},
105-
"properties": {
106-
"description": "[parameters('projectDescription')]",
107-
"displayName": "[parameters('projectDisplayName')]"
108-
},
109-
"dependsOn": [
110-
"[resourceId('Microsoft.CognitiveServices/accounts', parameters('account_name'))]"
110+
"[resourceId('Microsoft.CognitiveServices/accounts', parameters('accountName'))]"
111111
]
112112
}
113113
],
114114
"outputs": {
115-
"ENDPOINT": {
115+
"account_name": {
116116
"type": "string",
117-
"value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('account_name')), '2025-04-01-preview').endpoint]"
117+
"value": "[parameters('accountName')]"
118118
},
119119
"project_name": {
120120
"type": "string",
121-
"value": "[format('{0}', parameters('project_name'))]"
122-
},
123-
"account_name": {
124-
"type": "string",
125-
"value": "[parameters('account_name')]"
121+
"value": "[parameters('projectName')]"
126122
}
127123
}
128124
}
Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
{
2-
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
3-
"contentVersion": "1.0.0.0",
4-
"parameters": {
5-
"location": {
6-
"value": "westus2"
7-
},
8-
"account_name": {
9-
"value": ""
10-
},
11-
"project_name": {
12-
"value": ""
13-
},
14-
"modelName": {
15-
"value": "gpt-4o"
16-
},
17-
"modelFormat": {
18-
"value": "OpenAI"
19-
},
20-
"modelVersion": {
21-
"value": "2024-11-20"
22-
},
23-
"modelSkuName": {
24-
"value": "GlobalStandard"
25-
},
26-
"modelCapacity": {
27-
"value": 30
28-
}
29-
}
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"location": {
6+
"value": "eastus"
7+
},
8+
"ai_services": {
9+
"value": "aiServices"
10+
},
11+
"project_name": {
12+
"value": "project"
13+
},
14+
"modelName": {
15+
"value": "gpt-4o"
16+
},
17+
"modelFormat": {
18+
"value": "OpenAI"
19+
},
20+
"modelVersion": {
21+
"value": "2024-11-20"
22+
},
23+
"modelSkuName": {
24+
"value": "GlobalStandard"
25+
},
26+
"modelCapacity": {
27+
"value": 1
28+
}
29+
}
3030
}

0 commit comments

Comments
 (0)