Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ param openAiUrl string = '' // Set in main.parameters.json
param openAiApiVersion string // Set in main.parameters.json

param principalId string // Set in main.parameters.json
@description('Flag to decide where to create OpenAI role for current user')
param createRoleForUser bool = true

var finalOpenAiUrl = empty(openAiUrl) ? 'https://${openAi.outputs.name}.openai.azure.com' : openAiUrl
var abbrs = loadJsonContent('abbreviations.json')
Expand Down Expand Up @@ -148,7 +150,7 @@ module openAi 'core/ai/cognitiveservices.bicep' = if (empty(openAiUrl)) {
// Roles

// User roles
module openAiRoleUser 'core/security/role.bicep' = {
module openAiRoleUser 'core/security/role.bicep' = if (createRoleForUser) {
scope: resourceGroup
name: 'openai-role-user'
params: {
Expand Down
3 changes: 3 additions & 0 deletions infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"principalId": {
"value": "${AZURE_PRINCIPAL_ID}"
},
"createRoleForUser": {
"value": "${CREATE_ROLE_FOR_USER=true}"
},
"openAiLocation": {
"value": "${AZURE_OPENAI_LOCATION=swedencentral}"
},
Expand Down