Skip to content

Commit

Permalink
Merge pull request #980 from solliancenet/mg-t17605
Browse files Browse the repository at this point in the history
Assigning roles to Gateway API
  • Loading branch information
ciprianjichici authored May 17, 2024
2 parents 07de708 + 60da1f6 commit aa6cf41
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
12 changes: 12 additions & 0 deletions deploy/quick-start/infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,18 @@ module cosmosRoles './shared/sqlRoleAssignments.bicep' = [
}
]

module openAiRoles './shared/roleAssignments.bicep' = {
scope: rg
name: 'gateway-api-openai-roles'
params: {
principalId: acaServices[indexOf(serviceNames, 'gateway-api')].outputs.miPrincipalId
roleDefinitionNames: [
'Cognitive Services OpenAI User'
'Reader'
]
}
}

output AZURE_APP_CONFIG_NAME string = appConfig.outputs.name
output AZURE_AUTHORIZATION_STORAGE_ACCOUNT_NAME string = authStore.outputs.name
output AZURE_COGNITIVE_SEARCH_ENDPOINT string = cogSearch.outputs.endpoint
Expand Down
1 change: 1 addition & 0 deletions deploy/quick-start/infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"data-source-hub-api": "${SERVICE_DATASOURCEHUBAPI_RESOURCE_EXISTS=false}",
"gatekeeper-api": "${SERVICE_GATEKEEPERAPI_RESOURCE_EXISTS=false}",
"gatekeeper-integration-api": "${SERVICE_GATEKEEPERINTEGRATIONAPI_RESOURCE_EXISTS=false}",
"gateway-api": "${SERVICE_GATEWAYAPI_RESOURCE_EXISTS=false}",
"langchain-api": "${SERVICE_LANGCHAINAPI_RESOURCE_EXISTS=false}",
"management-api": "${SERVICE_MANAGEMENTAPI_RESOURCE_EXISTS=false}",
"management-ui": "${SERVICE_MANAGEMENTUI_RESOURCE_EXISTS=false}",
Expand Down
14 changes: 8 additions & 6 deletions deploy/quick-start/infra/shared/roleAssignments.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ param roleDefinitionNames array = []
var roleDefinitionsToCreate = union(selectedRoleDefinitions, items(roleDefinitionIds))
var selectedRoleDefinitions = filter(items(roleDefinitions), (item) => contains(roleDefinitionNames, item.key))
var roleDefinitions = {
'App Configuration Data Reader': '516239f1-63e1-4d78-a4de-a74fb236a071'
'EventGrid Contributor': '1e241071-0855-49ea-94dc-649edcd759de'
'Key Vault Secrets User': '4633458b-17de-408a-b874-0445c86b69e6'
'Key Vault Secrets Officer': 'b86a8fe4-44ce-4948-aee5-eccb2c155cd7'
'Storage Blob Data Contributor': 'ba92f5b4-2d11-453d-a403-e96b0029c9fe'
'App Configuration Data Reader': '516239f1-63e1-4d78-a4de-a74fb236a071'
'Cognitive Services OpenAI User': '5e0bd9bd-7b93-4f28-af87-19fc36ad61bd'
'Contributor': 'b24988ac-6180-42a0-ab88-20f7382dd24c'
'EventGrid Contributor': '1e241071-0855-49ea-94dc-649edcd759de'
'Key Vault Secrets User': '4633458b-17de-408a-b874-0445c86b69e6'
'Key Vault Secrets Officer': 'b86a8fe4-44ce-4948-aee5-eccb2c155cd7'
'Reader': 'acdd72a7-3385-48ef-bd42-f606fba81ae7'
'Storage Blob Data Contributor': 'ba92f5b4-2d11-453d-a403-e96b0029c9fe'
'Storage Queue Data Contributor': '974c5e8b-45b9-4653-ba55-5f855dd0fb88'
Contributor: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
}

var roleAssignmentsToCreate = [
Expand Down

0 comments on commit aa6cf41

Please sign in to comment.