Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit 4319144

Browse files
authored
Simplify networking architecture (#123)
1 parent c211508 commit 4319144

40 files changed

+986
-1226
lines changed

docs/DEPLOYMENT-GUIDE.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ The setup/deployment process has been mostly automated with a shell script and B
2121

2222

2323
#### RBAC Permissions
24-
You will need the following <a href="https://learn.microsoft.com/en-us/azure/role-based-access-control/overview">Azure Role Based Access </a>permissions at the Subscription level to deploy the GraphRAG solution accelerator. By default, Azure resources will be deployed with <a href="https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview">Azure Managed Identities </a>in place, keeping with security best practices. Due to this enhanced security configuration, higher level permissions are required in order to deploy the necessary Azure resources:
24+
You will need the following <a href="https://learn.microsoft.com/en-us/azure/role-based-access-control/overview">Azure Role Based Access </a>permissions to deploy the GraphRAG solution accelerator. By default, Azure resources will be deployed with <a href="https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview">Azure Managed Identities </a>in place, keeping with security best practices. Due to this enhanced security configuration, higher level permissions are required in order to deploy the necessary Azure resources:
2525
| Permission | Scope |
2626
| :--- | ---: |
27-
Contributor | Subscription
27+
Contributor | Subscription
2828
Role Based Access Control (RBAC) Administrator | Subscription
29+
Owner | Resource Group
2930

3031
#### Resource Providers
3132
The Azure subscription that you deploy this solution accelerator in will require both the `Microsoft.OperationsManagement` and `Microsoft.AlertsManagement` resource providers to be registered.
@@ -79,8 +80,8 @@ In the `deploy.parameters.json` file, provide values for the following required
7980
| :--- | :--- | --- | ---: |
8081
`RESOURCE_GROUP` | <my_resource_group> | Yes | The resource group that GraphRAG will be deployed in. Will get created automatically if the resource group does not exist.
8182
`LOCATION` | <my_location> | Yes | The azure cloud region to deploy GraphRAG resources in.
82-
`CONTAINER_REGISTRY_SERVER` | <my_container_registry>.azurecr.io | No | Name of an existing Azure Container Registry where the `graphrag` backend docker image is hosted. Will get created automatically if not provided.
83-
`GRAPHRAG_IMAGE` | graphrag:backend | No | The name and tag of the graphrag docker image in the container registry. Will default to `graphrag:backend`.
83+
`CONTAINER_REGISTRY_NAME` | <my_container_registry_name> | No | Name of an Azure Container Registry where the `graphrag` backend docker image will be hosted. Leave off `.azurecr.io` from the name. If not provided, a unique name will be generated (recommended).
84+
`GRAPHRAG_IMAGE` | graphrag:backend | No | The name and tag of the graphrag docker image in the container registry. Will default to `graphrag:backend` and be hosted at `my_container_registry_name>.azurecr.io/graphrag:backend`.
8485
`GRAPHRAG_API_BASE` | https://<my_openai_name>.openai.azure.com | Yes | Azure OpenAI service endpoint.
8586
`GRAPHRAG_API_VERSION` | 2023-03-15-preview | Yes | Azure OpenAI API version.
8687
`GRAPHRAG_LLM_MODEL` | gpt-4 | Yes | Name of the gpt-4 turbo model.
@@ -89,10 +90,11 @@ In the `deploy.parameters.json` file, provide values for the following required
8990
`GRAPHRAG_EMBEDDING_DEPLOYMENT_NAME` | | Yes | Deployment name of the Azure OpenAI embedding model.
9091
`GRAPHRAG_COGNITIVE_SERVICES_ENDPOINT` | | No | Endpoint for cognitive services identity authorization. Will default to `https://cognitiveservices.azure.com/.default` for Azure Commercial cloud but should be defined for deployments in other Azure clouds.
9192
`APIM_NAME` | | No | Hostname of the API. Must be a globally unique name. The API will be accessible at `https://<APIM_NAME>.azure-api.net`. If not provided a unique name will be generated.
93+
`APIM_TIER` | | No | The [APIM tier](https://azure.microsoft.com/en-us/pricing/details/api-management) to use. Must be either `Developer` or `StandardV2`. Will default to `Developer` for cost savings.
9294
`RESOURCE_BASE_NAME` | | No | Suffix to apply to all azure resource names. If not provided a unique suffix will be generated.
9395
`AISEARCH_ENDPOINT_SUFFIX` | | No | Suffix to apply to AI search endpoint. Will default to `search.windows.net` for Azure Commercial cloud but should be overridden for deployments in other Azure clouds.
9496
`AISEARCH_AUDIENCE` | | No | Audience for AAD for AI Search. Will default to `https://search.azure.com/` for Azure Commercial cloud but should be overridden for deployments in other Azure clouds.
95-
`REPORTERS` | blob,console,app_insights | No | The type of logging to enable. A comma separated string containing at least one of the following `[blob,console,file,app_insights]`. Default value = `blob,console,app_insights`
97+
`REPORTERS` | blob,console,app_insights | No | The type of logging to enable. A comma separated string containing any of the following values: `[blob,console,file,app_insights]`. Will default to `"blob,console,app_insights"`.
9698

9799
### 5. Deploy solution accelerator to the resource group
98100
```shell

infra/core/acr/acr.bicep

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
@description('The name of the Container Registry resource. Will be automatically generated if not provided.')
2-
param name string = ''
2+
param registryName string
33

44
@description('The location of the Container Registry resource.')
55
param location string = resourceGroup().location
66

7-
var resourceBaseNameFinal = !empty(name) ? name : toLower(uniqueString('${subscription().id}/resourceGroups/${resourceGroup().name}'))
8-
var abbrs = loadJsonContent('../../abbreviations.json')
7+
@description('Array of objects with fields principalId, principalType, roleDefinitionId')
8+
param roleAssignments array = []
99

1010
resource registry 'Microsoft.ContainerRegistry/registries@2023-11-01-preview' = {
11-
name: !empty(name) ? name : '${abbrs.containerRegistryRegistries}${resourceBaseNameFinal}'
11+
name: registryName
1212
location: location
1313
sku: {
1414
name: 'Standard'
@@ -27,5 +27,14 @@ resource registry 'Microsoft.ContainerRegistry/registries@2023-11-01-preview' =
2727
}
2828
}
2929

30+
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = [
31+
for role in roleAssignments: {
32+
name: guid('${role.principalId}-${role.principalType}-${role.roleDefinitionId}')
33+
scope: registry
34+
properties: role
35+
}
36+
]
37+
3038
output name string = registry.name
39+
output id string = registry.id
3140
output loginServer string = registry.properties.loginServer

infra/core/ai-search/ai-search.bicep

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ resource aiSearch 'Microsoft.Search/searchServices@2024-03-01-preview' = {
2929
}
3030

3131
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = [
32-
for roleAssignment in roleAssignments: {
33-
name: guid('${roleAssignment.principalId}-${roleAssignment.principalType}-${roleAssignment.roleDefinitionId}')
32+
for role in roleAssignments: {
33+
name: guid('${role.principalId}-${role.principalType}-${role.roleDefinitionId}')
3434
scope: aiSearch
35-
properties: roleAssignment
35+
properties: role
3636
}
3737
]
3838

39-
output id string = aiSearch.id
4039
output name string = aiSearch.name
40+
output id string = aiSearch.id

infra/core/aks/aks.bicep

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,22 @@ param sshRSAPublicKey string
4949
@description('Enable encryption at host')
5050
param enableEncryptionAtHost bool = false
5151

52-
@description('Resource ID of subnet to use for all node pools.')
53-
param vnetSubnetId string = ''
54-
var vnetSubnetIdVar = !empty(vnetSubnetId) ? vnetSubnetId : null
52+
param subnetId string
5553

56-
resource aks 'Microsoft.ContainerService/managedClusters@2023-10-01' = {
54+
param privateDnsZoneName string
55+
56+
@description('Array of objects with fields principalType, roleDefinitionId')
57+
param ingressRoleAssignments array = []
58+
59+
@description('Array of objects with fields principalType, roleDefinitionId')
60+
param systemRoleAssignments array = []
61+
62+
63+
resource privateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' existing = {
64+
name: privateDnsZoneName
65+
}
66+
67+
resource aks 'Microsoft.ContainerService/managedClusters@2024-02-01' = {
5768
name: clusterName
5869
location: location
5970
identity: {
@@ -85,13 +96,21 @@ resource aks 'Microsoft.ContainerService/managedClusters@2023-10-01' = {
8596
osType: 'Linux'
8697
mode: 'System'
8798
enableEncryptionAtHost: enableEncryptionAtHost
88-
vnetSubnetID: vnetSubnetIdVar
99+
vnetSubnetID: subnetId
89100
type: 'VirtualMachineScaleSets'
90101
}
91102
]
92103
autoScalerProfile: {
93104
expander: 'least-waste'
94105
}
106+
ingressProfile: {
107+
webAppRouting: {
108+
enabled: true
109+
dnsZoneResourceIds: [
110+
privateDnsZone.id
111+
]
112+
}
113+
}
95114
linuxProfile: {
96115
adminUsername: linuxAdminUsername
97116
ssh: {
@@ -132,7 +151,7 @@ resource aks 'Microsoft.ContainerService/managedClusters@2023-10-01' = {
132151
osType: 'Linux'
133152
mode: 'User'
134153
enableEncryptionAtHost: enableEncryptionAtHost
135-
vnetSubnetID: vnetSubnetIdVar
154+
vnetSubnetID: subnetId
136155
nodeLabels: {
137156
workload: 'graphrag'
138157
}
@@ -152,7 +171,7 @@ resource aksManagedAutoUpgradeSchedule 'Microsoft.ContainerService/managedCluste
152171
schedule: {
153172
weekly: {
154173
intervalWeeks: 1
155-
dayOfWeek: 'Sunday'
174+
dayOfWeek: 'Monday'
156175
}
157176
}
158177
durationHours: 4
@@ -180,9 +199,35 @@ resource aksManagedNodeOSUpgradeSchedule 'Microsoft.ContainerService/managedClus
180199
}
181200
}
182201

202+
// role assignment to ingress identity
203+
resource webAppRoutingPrivateDnsContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = [
204+
for role in ingressRoleAssignments: {
205+
name: guid('${role.roleDefinitionId}-${privateDnsZone.id}')
206+
scope: privateDnsZone
207+
properties: {
208+
principalId: aks.properties.ingressProfile.webAppRouting.identity.objectId
209+
principalType: role.principalType
210+
roleDefinitionId: role.roleDefinitionId
211+
}
212+
}
213+
]
214+
215+
// role assignment to AKS system identity
216+
resource systemRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = [
217+
for role in systemRoleAssignments: {
218+
name: guid('${role.roleDefinitionId}-${aks.id}')
219+
scope: resourceGroup()
220+
properties: {
221+
principalId: aks.identity.principalId
222+
principalType: role.principalType
223+
roleDefinitionId: role.roleDefinitionId
224+
}
225+
}
226+
]
227+
183228
output name string = aks.name
229+
output id string = aks.id
184230
output managedResourceGroup string = aks.properties.nodeResourceGroup
185-
output controlPlaneFQDN string = aks.properties.fqdn
186-
output principalId string = aks.identity.principalId
231+
output controlPlaneFqdn string = aks.properties.fqdn
187232
output kubeletPrincipalId string = aks.properties.identityProfile.kubeletidentity.objectId
188233
output issuer string = aks.properties.oidcIssuerProfile.issuerURL

0 commit comments

Comments
 (0)