@@ -12,6 +12,9 @@ param envName string
12
12
13
13
param deployments deploymentsType
14
14
15
+ @description('Id of the user or app to assign application roles')
16
+ param principalId string
17
+
15
18
resource aiAccount 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' = {
16
19
name: 'ai-account-${resourceToken}'
17
20
location: location
@@ -46,7 +49,7 @@ resource aiAccount 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' = {
46
49
}
47
50
]
48
51
49
- resource account_name_project_name 'projects@2025-04-01-preview ' = {
52
+ resource project 'projects' = {
50
53
name: envName
51
54
location: location
52
55
identity: {
@@ -62,40 +65,30 @@ resource aiAccount 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' = {
62
65
}
63
66
}
64
67
65
- resource projectAiDeveloperRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
66
- scope: resourceGroup()
67
- name: guid(subscription().id, resourceGroup().id, aiAccount::account_name_project_name.id, 'fd1bd22b-8476-40bc-a0bc-3260815545e9')
68
- properties: {
69
- principalId: aiAccount::account_name_project_name.identity.principalId
70
- principalType: 'ServicePrincipal'
71
- roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', 'fd1bd22b-8476-40bc-a0bc-3260815545e9')
72
- }
73
- }
74
-
75
- resource projectSearchIndexDataContributorAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
68
+ resource localUserAiDeveloperRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
76
69
scope: resourceGroup()
77
- name: guid(subscription().id, resourceGroup().id, aiAccount::account_name_project_name.id , '8ebe5a00-799e-43f5-93ac-243d3dce84a7 ')
70
+ name: guid(subscription().id, resourceGroup().id, 'localUser' , '64702f94-c441-49e6-a78b-ef80e0188fee ')
78
71
properties: {
79
- principalId: aiAccount::account_name_project_name.identity. principalId
80
- principalType: 'ServicePrincipal '
81
- roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', '8ebe5a00-799e-43f5-93ac-243d3dce84a7 ')
72
+ principalId: principalId
73
+ principalType: 'User '
74
+ roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', '64702f94-c441-49e6-a78b-ef80e0188fee ')
82
75
}
83
76
}
84
77
85
- resource projectSearchServiceContributorRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
78
+ resource localUserCognitiveServicesUserRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
86
79
scope: resourceGroup()
87
- name: guid(subscription().id, resourceGroup().id, aiAccount::account_name_project_name.id , '7ca78c08-252a-4471-8644-bb5ff32d4ba0 ')
80
+ name: guid(subscription().id, resourceGroup().id, 'localUser' , 'a97b65f3-24c7-4388-baec-2e87135dc908 ')
88
81
properties: {
89
- principalId: aiAccount::account_name_project_name.identity. principalId
90
- principalType: 'ServicePrincipal '
91
- roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', '7ca78c08-252a-4471-8644-bb5ff32d4ba0 ')
82
+ principalId: principalId
83
+ principalType: 'User '
84
+ roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', 'a97b65f3-24c7-4388-baec-2e87135dc908 ')
92
85
}
93
86
}
94
87
95
- output ENDPOINT string = aiAccount::account_name_project_name .properties.endpoints['AI Foundry API']
96
- output projectId string = aiAccount::account_name_project_name .id
88
+ output ENDPOINT string = aiAccount::project .properties.endpoints['AI Foundry API']
89
+ output projectId string = aiAccount::project .id
97
90
output aiServicesAccountName string = aiAccount.name
98
- output aiServicesProjectName string = aiAccount::account_name_project_name .name
91
+ output aiServicesProjectName string = aiAccount::project .name
99
92
100
93
type deploymentsType = {
101
94
@description('Specify the name of cognitive service account deployment.')
0 commit comments