Files
wehub-resource-sync b957a53def
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 13:21:23 +08:00

21 lines
739 B
Bicep

targetScope = 'resourceGroup'
param openAIName string
param userAssignedIdentityPrincipalId string
resource openAI 'Microsoft.CognitiveServices/accounts@2022-03-01' existing = {
name: openAIName
}
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
name: guid(openAI.id, userAssignedIdentityPrincipalId, 'Cognitive Services OpenAI User')
scope: openAI
properties: {
roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd') // Role definition ID for Cognitive Services OpenAI User
principalId: userAssignedIdentityPrincipalId
principalType: 'ServicePrincipal'
}
}
output openAIEndpoint string = openAI.properties.endpoint