Skip to content

Commit 1ad3c82

Browse files
Merge branch 'main' into mcs/ianjensenisme/13-end-to-end-test
2 parents 486b368 + 7454e7f commit 1ad3c82

15 files changed

+97
-60
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ This architecture ensures that sensitive enterprise data never traverses public
7878
- [**Copilot in Power Apps**](https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/ai-overview?WT.mc_id=ppac_inproduct_settings): Enable this setting to allow AI-powered assistance within Power Apps development
7979
- [**Publish Copilots with AI features**](https://learn.microsoft.com/en-us/microsoft-copilot-studio/security-and-governance): Allow Copilot authors to publish from Copilot Studio when AI features are enabled
8080
- **Power Platform licenses**. The designated user must have the following Power Platform licenses assigned:
81-
- **Microsoft Power Apps**
82-
- **Power Automate**
83-
- **Copilot Studio**
81+
- **Microsoft Power Apps**
82+
- **Power Automate**
83+
- **Copilot Studio**
8484

8585
To simplify license management, you can use an Azure subscription with a Billing Policy instead of assigning licenses directly. Configure this by using the following flag:
8686

@@ -328,9 +328,8 @@ telemetry, simply remove `partner_id`. When enabled, the `partner_id` is appende
328328

329329
## Responsible AI
330330

331-
Microsoft encourages customers to review its Responsible AI Standard when developing AI-enabled
332-
systems to ensure ethical, safe, and inclusive AI practices. Learn more at
333-
https://www.microsoft.com/en-us/ai/responsible-ai.
331+
Microsoft encourages customers to review its Responsible AI Standard when developing AI-enabled
332+
systems to ensure ethical, safe, and inclusive AI practices. Learn more at <https://www.microsoft.com/en-us/ai/responsible-ai>.
334333

335334
## Getting help
336335

docs/app_registration_setup.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ will be created:
2323
- *Contributor*: Grants permission to create and manage Azure resources.
2424
- *Role Based Access Control Administrator*: Grants permission to assign RBAC roles, which is
2525
required when using managed identities.
26+
- *User Access Administrator*: Grants the ability to manage user access to resources, including assigning and revoking permissions.
27+
28+
**Note**: You can specify those permissions on a resource group level to limit their scope. See [providing your own resource group documentation](./custom_resource_group.md) for more details.
2629

2730
1. Grant **admin consent** for all delegated permissions assigned to the app. This can be done in the [Azure portal](portal.azure.com) under **App registrations** > **API permissions** > **Grant admin consent**.
2831

docs/custom_resource_group.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Custom Resource Group Name
2+
3+
This template creates a resource group with a randomly generated name by default. You can override this behavior by specifying pre-created resource group during deployment.
4+
5+
## Required Variables
6+
7+
To use your own resource group, set the following environment variable:
8+
9+
```shell
10+
azd env set RESOURCE_GROUP_NAME "<your-resource-group-name>"
11+
```

infra/main.ai.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module "azure_open_ai" {
77
kind = "OpenAI"
88
location = var.location
99
name = "aoai${random_string.name.id}"
10-
resource_group_name = azurerm_resource_group.this.name
10+
resource_group_name = local.resource_group_name
1111
enable_telemetry = true
1212
sku_name = "S0"
1313
local_auth_enabled = true
@@ -45,7 +45,7 @@ module "azure_open_ai" {
4545
# Private DNS zone for Azure OpenAI private endpoint resolution
4646
resource "azurerm_private_dns_zone" "aoai_dns" {
4747
name = "privatelink.openai.azure.com"
48-
resource_group_name = azurerm_resource_group.this.name
48+
resource_group_name = local.resource_group_name
4949
tags = var.tags
5050
}
5151

@@ -58,7 +58,7 @@ resource "azurerm_private_dns_zone_virtual_network_link" "aoai_dns_links" {
5858

5959
name = "aoai-${each.key}-link"
6060
private_dns_zone_name = azurerm_private_dns_zone.aoai_dns.name
61-
resource_group_name = azurerm_resource_group.this.name
61+
resource_group_name = local.resource_group_name
6262
virtual_network_id = each.value
6363
tags = var.tags
6464
}
@@ -68,7 +68,7 @@ resource "azurerm_private_dns_zone_virtual_network_link" "aoai_dns_links" {
6868
resource "azurerm_private_dns_a_record" "aoai_dns_record" {
6969
name = module.azure_open_ai.resource.name
7070
zone_name = azurerm_private_dns_zone.aoai_dns.name
71-
resource_group_name = azurerm_resource_group.this.name
71+
resource_group_name = local.resource_group_name
7272
ttl = 10
7373
records = [module.azure_open_ai.private_endpoints["pe_endpoint"].private_service_connection[0].private_ip_address]
7474
tags = var.tags

infra/main.app_insights.tf

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ resource "azurerm_application_insights" "insights" {
44
count = var.include_app_insights ? 1 : 0
55

66
application_type = "web"
7-
location = azurerm_resource_group.this.location
7+
location = local.resource_group_location
88
name = "${var.resource_prefix}-appinsights-${var.resource_suffix}"
9-
resource_group_name = azurerm_resource_group.this.name
9+
resource_group_name = local.resource_group_name
1010
}
1111

1212
resource "azurerm_application_insights_workbook" "workbook" {
@@ -35,7 +35,7 @@ resource "azurerm_application_insights_workbook" "workbook" {
3535
"queryType" : 0,
3636
"resourceType" : "microsoft.insights/components",
3737
"crossComponentResources" : [
38-
"/subscriptions/${data.azurerm_client_config.current.subscription_id}/resourceGroups/${azurerm_resource_group.this.name}/providers/Microsoft.Insights/components/${azurerm_application_insights.insights[0].name}"
38+
"/subscriptions/${data.azurerm_client_config.current.subscription_id}/resourceGroups/${local.resource_group_name}/providers/Microsoft.Insights/components/${azurerm_application_insights.insights[0].name}"
3939
],
4040
"visualization" : var.app_insights_sections["section_1"].chart
4141
},
@@ -53,7 +53,7 @@ resource "azurerm_application_insights_workbook" "workbook" {
5353
"queryType" : 0,
5454
"resourceType" : "microsoft.insights/components",
5555
"crossComponentResources" : [
56-
"/subscriptions/${data.azurerm_client_config.current.subscription_id}/resourceGroups/${azurerm_resource_group.this.name}/providers/Microsoft.Insights/components/${azurerm_application_insights.insights[0].name}"
56+
"/subscriptions/${data.azurerm_client_config.current.subscription_id}/resourceGroups/${local.resource_group_name}/providers/Microsoft.Insights/components/${azurerm_application_insights.insights[0].name}"
5757
],
5858
"visualization" : var.app_insights_sections["section_2"].chart
5959
},
@@ -71,7 +71,7 @@ resource "azurerm_application_insights_workbook" "workbook" {
7171
"queryType" : 0,
7272
"resourceType" : "microsoft.insights/components",
7373
"crossComponentResources" : [
74-
"/subscriptions/${data.azurerm_client_config.current.subscription_id}/resourceGroups/${azurerm_resource_group.this.name}/providers/Microsoft.Insights/components/${azurerm_application_insights.insights[0].name}"
74+
"/subscriptions/${data.azurerm_client_config.current.subscription_id}/resourceGroups/${local.resource_group_name}/providers/Microsoft.Insights/components/${azurerm_application_insights.insights[0].name}"
7575
],
7676
"visualization" : var.app_insights_sections["section_3"].chart
7777
},
@@ -89,7 +89,7 @@ resource "azurerm_application_insights_workbook" "workbook" {
8989
"queryType" : 0,
9090
"resourceType" : "microsoft.insights/components",
9191
"crossComponentResources" : [
92-
"/subscriptions/${data.azurerm_client_config.current.subscription_id}/resourceGroups/${azurerm_resource_group.this.name}/providers/Microsoft.Insights/components/${azurerm_application_insights.insights[0].name}"
92+
"/subscriptions/${data.azurerm_client_config.current.subscription_id}/resourceGroups/${local.resource_group_name}/providers/Microsoft.Insights/components/${azurerm_application_insights.insights[0].name}"
9393
],
9494
"visualization" : var.app_insights_sections["section_4"].chart
9595
},
@@ -107,7 +107,7 @@ resource "azurerm_application_insights_workbook" "workbook" {
107107
"queryType" : 0,
108108
"resourceType" : "microsoft.insights/components",
109109
"crossComponentResources" : [
110-
"/subscriptions/${data.azurerm_client_config.current.subscription_id}/resourceGroups/${azurerm_resource_group.this.name}/providers/Microsoft.Insights/components/${azurerm_application_insights.insights[0].name}"
110+
"/subscriptions/${data.azurerm_client_config.current.subscription_id}/resourceGroups/${local.resource_group_name}/providers/Microsoft.Insights/components/${azurerm_application_insights.insights[0].name}"
111111
],
112112
"visualization" : var.app_insights_sections["section_5"].chart
113113
},
@@ -125,7 +125,7 @@ resource "azurerm_application_insights_workbook" "workbook" {
125125
"queryType" : 0,
126126
"resourceType" : "microsoft.insights/components",
127127
"crossComponentResources" : [
128-
"/subscriptions/${data.azurerm_client_config.current.subscription_id}/resourceGroups/${azurerm_resource_group.this.name}/providers/Microsoft.Insights/components/${azurerm_application_insights.insights[0].name}"
128+
"/subscriptions/${data.azurerm_client_config.current.subscription_id}/resourceGroups/${local.resource_group_name}/providers/Microsoft.Insights/components/${azurerm_application_insights.insights[0].name}"
129129
],
130130
"visualization" : var.app_insights_sections["section_6"].chart
131131
},
@@ -138,7 +138,7 @@ resource "azurerm_application_insights_workbook" "workbook" {
138138
"$schema" : "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json"
139139
})
140140
display_name = "Azure Monitor Workbook"
141-
location = azurerm_resource_group.this.location
141+
location = local.resource_group_location
142142
name = random_uuid.uid.result
143-
resource_group_name = azurerm_resource_group.this.name
143+
resource_group_name = local.resource_group_name
144144
}

infra/main.github_runners.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module "github_runner_aca_primary" {
77
environment_name = var.azd_environment_name
88
unique_id = random_string.name.id
99
location = var.primary_location
10-
resource_group_name = azurerm_resource_group.this.name
10+
resource_group_name = local.resource_group_name
1111
infrastructure_subnet_id = azurerm_subnet.github_runner_primary_subnet[0].id
1212
private_endpoint_subnet_id = local.pe_primary_subnet_id
1313
virtual_network_id = local.primary_virtual_network_id
@@ -48,7 +48,7 @@ module "github_runner_aca_failover" {
4848
environment_name = "${var.azd_environment_name}-failover"
4949
unique_id = "${random_string.name.id}-fo"
5050
location = var.failover_location
51-
resource_group_name = azurerm_resource_group.this.name
51+
resource_group_name = local.resource_group_name
5252
infrastructure_subnet_id = azurerm_subnet.github_runner_failover_subnet[0].id
5353
private_endpoint_subnet_id = local.pe_failover_subnet_id
5454
virtual_network_id = local.failover_virtual_network_id

infra/main.network.tf

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ locals {
33
primary_virtual_network_id = coalesce(var.networking.primary_virtual_network.id, local.create_network_infrastructure ? null : azurerm_virtual_network.primary_virtual_network[0].id)
44
primary_virtual_network_resource_group = coalesce(
55
length(local.primary_vnet_matches) > 0 ? local.primary_vnet_matches[0].resource_group_name : null,
6-
local.create_network_infrastructure ? null : azurerm_resource_group.this.name
6+
local.create_network_infrastructure ? null : local.resource_group_name
77
)
88

99
# Get matching primary VNets from data source
@@ -58,7 +58,7 @@ resource "azurerm_virtual_network" "primary_virtual_network" {
5858
count = local.create_network_infrastructure ? 0 : 1
5959

6060
name = "power-platform-primary-vnet-${random_string.name.id}"
61-
resource_group_name = azurerm_resource_group.this.name
61+
resource_group_name = local.resource_group_name
6262
location = var.primary_location
6363
address_space = var.primary_vnet_address_spaces
6464
tags = var.tags
@@ -68,7 +68,7 @@ resource "azurerm_virtual_network" "failover_virtual_network" {
6868
count = local.create_network_infrastructure ? 0 : 1
6969

7070
name = "power-platform-failover-vnet-${random_string.name.id}"
71-
resource_group_name = azurerm_resource_group.this.name
71+
resource_group_name = local.resource_group_name
7272
location = var.failover_location
7373
address_space = var.failover_vnet_address_spaces
7474
tags = var.tags
@@ -80,7 +80,7 @@ resource "azurerm_subnet" "primary_subnet" {
8080
count = local.create_network_infrastructure ? 0 : 1
8181

8282
name = var.primary_subnet_name
83-
resource_group_name = azurerm_resource_group.this.name
83+
resource_group_name = local.resource_group_name
8484
virtual_network_name = azurerm_virtual_network.primary_virtual_network[0].name
8585
address_prefixes = var.primary_subnet_address_spaces
8686
service_endpoints = ["Microsoft.Storage", "Microsoft.CognitiveServices"]
@@ -107,7 +107,7 @@ resource "azurerm_subnet" "failover_subnet" {
107107
count = local.create_network_infrastructure ? 0 : 1
108108

109109
name = var.failover_subnet_name
110-
resource_group_name = azurerm_resource_group.this.name
110+
resource_group_name = local.resource_group_name
111111
virtual_network_name = azurerm_virtual_network.failover_virtual_network[0].name
112112
address_prefixes = var.failover_subnet_address_spaces
113113
service_endpoints = ["Microsoft.Storage", "Microsoft.CognitiveServices"]
@@ -134,7 +134,7 @@ resource "azurerm_subnet" "pe_primary_subnet" {
134134

135135
# checkov:skip=CKV2_AZURE_31:"Ensure VNET subnet is configured with a Network Security Group (NSG)
136136
name = "pe-primary-subnet"
137-
resource_group_name = azurerm_resource_group.this.name
137+
resource_group_name = local.resource_group_name
138138
virtual_network_name = azurerm_virtual_network.primary_virtual_network[0].name
139139
address_prefixes = var.primary_pe_subnet_address_spaces
140140
service_endpoints = ["Microsoft.CognitiveServices", "Microsoft.Storage"]
@@ -148,7 +148,7 @@ resource "azurerm_subnet" "pe_failover_subnet" {
148148
count = local.create_network_infrastructure ? 0 : 1
149149

150150
name = "pe-failover-subnet"
151-
resource_group_name = azurerm_resource_group.this.name
151+
resource_group_name = local.resource_group_name
152152
virtual_network_name = azurerm_virtual_network.failover_virtual_network[0].name
153153
address_prefixes = var.failover_pe_subnet_address_spaces
154154
service_endpoints = ["Microsoft.CognitiveServices"]
@@ -164,7 +164,7 @@ resource "azurerm_subnet" "github_runner_primary_subnet" {
164164
count = var.deploy_github_runner && local.create_network_infrastructure == false ? 1 : 0
165165

166166
name = "github-runner-primary-subnet"
167-
resource_group_name = azurerm_resource_group.this.name
167+
resource_group_name = local.resource_group_name
168168
virtual_network_name = azurerm_virtual_network.primary_virtual_network[0].name
169169
address_prefixes = var.primary_gh_runner_subnet_address_spaces
170170
service_endpoints = ["Microsoft.Storage"]
@@ -191,7 +191,7 @@ resource "azurerm_subnet" "github_runner_failover_subnet" {
191191
count = var.deploy_github_runner && local.create_network_infrastructure == false ? 1 : 0
192192

193193
name = "github-runner-failover-subnet"
194-
resource_group_name = azurerm_resource_group.this.name
194+
resource_group_name = local.resource_group_name
195195
virtual_network_name = azurerm_virtual_network.failover_virtual_network[0].name
196196
address_prefixes = var.failover_gh_runner_subnet_address_spaces
197197
service_endpoints = ["Microsoft.Storage"]
@@ -222,7 +222,7 @@ resource "azurerm_public_ip" "nat_gateway_ips" {
222222

223223
name = "${each.key}-nat-gateway-ip"
224224
location = each.value
225-
resource_group_name = azurerm_resource_group.this.name
225+
resource_group_name = local.resource_group_name
226226
allocation_method = "Static"
227227
sku = "Standard"
228228
tags = var.tags
@@ -236,7 +236,7 @@ resource "azurerm_nat_gateway" "nat_gateways" {
236236

237237
location = each.value
238238
name = "${each.key}-nat-gateway"
239-
resource_group_name = azurerm_resource_group.this.name
239+
resource_group_name = local.resource_group_name
240240
sku_name = "Standard"
241241
tags = var.tags
242242

@@ -259,7 +259,7 @@ resource "azurerm_subnet" "deployment_script_container_subnet" {
259259
count = local.create_network_infrastructure ? 0 : 1
260260

261261
name = "deploymentscript-subnet"
262-
resource_group_name = azurerm_resource_group.this.name
262+
resource_group_name = local.resource_group_name
263263
virtual_network_name = azurerm_virtual_network.primary_virtual_network[0].name
264264
address_prefixes = var.deployment_script_subnet_address_spaces
265265
service_endpoints = ["Microsoft.Storage", "Microsoft.CognitiveServices"]
@@ -291,7 +291,7 @@ resource "azurerm_network_security_group" "power_platform_primary_nsg" {
291291

292292
name = "power-platform-primary-nsg-${random_string.name.id}"
293293
location = var.primary_location
294-
resource_group_name = azurerm_resource_group.this.name
294+
resource_group_name = local.resource_group_name
295295
tags = var.tags
296296

297297
# Allow outbound HTTPS for Power Platform services
@@ -353,7 +353,7 @@ resource "azurerm_network_security_group" "power_platform_failover_nsg" {
353353

354354
name = "power-platform-failover-nsg-${random_string.name.id}"
355355
location = var.failover_location
356-
resource_group_name = azurerm_resource_group.this.name
356+
resource_group_name = local.resource_group_name
357357
tags = var.tags
358358

359359
# Allow outbound HTTPS for Power Platform services
@@ -415,7 +415,7 @@ resource "azurerm_network_security_group" "private_endpoint_primary_nsg" {
415415

416416
name = "private-endpoint-primary-nsg-${random_string.name.id}"
417417
location = var.primary_location
418-
resource_group_name = azurerm_resource_group.this.name
418+
resource_group_name = local.resource_group_name
419419
tags = var.tags
420420

421421
# Allow inbound traffic from VNet to private endpoints
@@ -451,7 +451,7 @@ resource "azurerm_network_security_group" "private_endpoint_failover_nsg" {
451451

452452
name = "private-endpoint-failover-nsg-${random_string.name.id}"
453453
location = var.failover_location
454-
resource_group_name = azurerm_resource_group.this.name
454+
resource_group_name = local.resource_group_name
455455
tags = var.tags
456456

457457
# Allow inbound traffic from VNet to private endpoints
@@ -486,7 +486,7 @@ resource "azurerm_network_security_group" "github_runner_nsg" {
486486
count = var.deploy_github_runner && local.create_network_infrastructure == false ? 1 : 0
487487
name = "github-runner-nsg-${random_string.name.id}"
488488
location = var.primary_location
489-
resource_group_name = azurerm_resource_group.this.name
489+
resource_group_name = local.resource_group_name
490490
tags = var.tags
491491

492492
# Allow outbound HTTPS for GitHub and container registry access
@@ -560,7 +560,7 @@ resource "azurerm_network_security_group" "deployment_script_nsg" {
560560

561561
name = "deployment-script-nsg-${random_string.name.id}"
562562
location = var.primary_location
563-
resource_group_name = azurerm_resource_group.this.name
563+
resource_group_name = local.resource_group_name
564564
tags = var.tags
565565

566566
# Allow outbound HTTPS for Azure services and package downloads

0 commit comments

Comments
 (0)