From 7f900e80b879df42bad0266ccce26b1784cb2844 Mon Sep 17 00:00:00 2001 From: Steven <87738005+stemaMSFT@users.noreply.github.com> Date: Wed, 6 May 2026 15:25:41 -0700 Subject: [PATCH 1/5] Standardize AzAPI sample folder naming convention MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename folders to use provider suffix instead of prefix: - 101-azapi-lab-services → 101-lab-services-azapi - 101-azapi-eventhub-network-rules → 101-eventhub-network-rules-azapi This aligns with the convention used by dual-provider samples (e.g., 101-resource-group-azapi) where -azapi suffix indicates the AzAPI variant of an existing sample. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../TestRecord.md | 0 .../main-generic.tf | 0 .../main.tf | 0 .../providers.tf | 0 .../TestRecord.md | 0 .../{101-azapi-lab-services => 101-lab-services-azapi}/main.tf | 0 .../{101-azapi-lab-services => 101-lab-services-azapi}/outputs.tf | 0 .../providers.tf | 0 .../variables.tf | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename quickstart/{101-azapi-eventhub-network-rules => 101-eventhub-network-rules-azapi}/TestRecord.md (100%) rename quickstart/{101-azapi-eventhub-network-rules => 101-eventhub-network-rules-azapi}/main-generic.tf (100%) rename quickstart/{101-azapi-eventhub-network-rules => 101-eventhub-network-rules-azapi}/main.tf (100%) rename quickstart/{101-azapi-eventhub-network-rules => 101-eventhub-network-rules-azapi}/providers.tf (100%) rename quickstart/{101-azapi-lab-services => 101-lab-services-azapi}/TestRecord.md (100%) rename quickstart/{101-azapi-lab-services => 101-lab-services-azapi}/main.tf (100%) rename quickstart/{101-azapi-lab-services => 101-lab-services-azapi}/outputs.tf (100%) rename quickstart/{101-azapi-lab-services => 101-lab-services-azapi}/providers.tf (100%) rename quickstart/{101-azapi-lab-services => 101-lab-services-azapi}/variables.tf (100%) diff --git a/quickstart/101-azapi-eventhub-network-rules/TestRecord.md b/quickstart/101-eventhub-network-rules-azapi/TestRecord.md similarity index 100% rename from quickstart/101-azapi-eventhub-network-rules/TestRecord.md rename to quickstart/101-eventhub-network-rules-azapi/TestRecord.md diff --git a/quickstart/101-azapi-eventhub-network-rules/main-generic.tf b/quickstart/101-eventhub-network-rules-azapi/main-generic.tf similarity index 100% rename from quickstart/101-azapi-eventhub-network-rules/main-generic.tf rename to quickstart/101-eventhub-network-rules-azapi/main-generic.tf diff --git a/quickstart/101-azapi-eventhub-network-rules/main.tf b/quickstart/101-eventhub-network-rules-azapi/main.tf similarity index 100% rename from quickstart/101-azapi-eventhub-network-rules/main.tf rename to quickstart/101-eventhub-network-rules-azapi/main.tf diff --git a/quickstart/101-azapi-eventhub-network-rules/providers.tf b/quickstart/101-eventhub-network-rules-azapi/providers.tf similarity index 100% rename from quickstart/101-azapi-eventhub-network-rules/providers.tf rename to quickstart/101-eventhub-network-rules-azapi/providers.tf diff --git a/quickstart/101-azapi-lab-services/TestRecord.md b/quickstart/101-lab-services-azapi/TestRecord.md similarity index 100% rename from quickstart/101-azapi-lab-services/TestRecord.md rename to quickstart/101-lab-services-azapi/TestRecord.md diff --git a/quickstart/101-azapi-lab-services/main.tf b/quickstart/101-lab-services-azapi/main.tf similarity index 100% rename from quickstart/101-azapi-lab-services/main.tf rename to quickstart/101-lab-services-azapi/main.tf diff --git a/quickstart/101-azapi-lab-services/outputs.tf b/quickstart/101-lab-services-azapi/outputs.tf similarity index 100% rename from quickstart/101-azapi-lab-services/outputs.tf rename to quickstart/101-lab-services-azapi/outputs.tf diff --git a/quickstart/101-azapi-lab-services/providers.tf b/quickstart/101-lab-services-azapi/providers.tf similarity index 100% rename from quickstart/101-azapi-lab-services/providers.tf rename to quickstart/101-lab-services-azapi/providers.tf diff --git a/quickstart/101-azapi-lab-services/variables.tf b/quickstart/101-lab-services-azapi/variables.tf similarity index 100% rename from quickstart/101-azapi-lab-services/variables.tf rename to quickstart/101-lab-services-azapi/variables.tf From e31d9a02519c939f228da64caa45aa885ed356e9 Mon Sep 17 00:00:00 2001 From: Steven <87738005+stemaMSFT@users.noreply.github.com> Date: Wed, 6 May 2026 16:27:23 -0700 Subject: [PATCH 2/5] Fix CI: modernize eventhub-network-rules-azapi sample - Upgrade azapi provider from =0.1.0 to ~>2.0 - Upgrade azurerm provider from =3.0.2 to ~>3.0 - Replace jsonencode() body with native HCL (AzAPI v2.0+ pattern) - Randomize resource group name to avoid parallel CI conflicts - Remove stale .terraform.lock.hcl Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- quickstart/101-eventhub-network-rules-azapi/main-generic.tf | 6 +++--- quickstart/101-eventhub-network-rules-azapi/main.tf | 6 +++++- quickstart/101-eventhub-network-rules-azapi/providers.tf | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/quickstart/101-eventhub-network-rules-azapi/main-generic.tf b/quickstart/101-eventhub-network-rules-azapi/main-generic.tf index a8abfec49..7eb4baca3 100644 --- a/quickstart/101-eventhub-network-rules-azapi/main-generic.tf +++ b/quickstart/101-eventhub-network-rules-azapi/main-generic.tf @@ -4,7 +4,7 @@ resource "azapi_update_resource" "qs101" { name = "default" parent_id = azurerm_eventhub_namespace.qs101.id - body = jsonencode({ + body = { properties = { defaultAction = "Deny" publicNetworkAccess = "Enabled" @@ -12,7 +12,7 @@ resource "azapi_update_resource" "qs101" { { ignoreMissingVnetServiceEndpoint = false subnet = { - # API bug, returned id replaced `resourceGroups` with `resourcegroups` + # API bug: returned id replaces `resourceGroups` with `resourcegroups` id = replace(azurerm_subnet.qs101.id, "resourceGroups", "resourcegroups") } } @@ -24,5 +24,5 @@ resource "azapi_update_resource" "qs101" { } ] } - }) + } } diff --git a/quickstart/101-eventhub-network-rules-azapi/main.tf b/quickstart/101-eventhub-network-rules-azapi/main.tf index 7c89bfddd..e05f36c67 100644 --- a/quickstart/101-eventhub-network-rules-azapi/main.tf +++ b/quickstart/101-eventhub-network-rules-azapi/main.tf @@ -1,5 +1,9 @@ +resource "random_pet" "rg_name" { + prefix = "rg-qs101-eh-rules" +} + resource "azurerm_resource_group" "qs101" { - name = "rg-qs101-eh-rules" + name = random_pet.rg_name.id location = "westus2" } diff --git a/quickstart/101-eventhub-network-rules-azapi/providers.tf b/quickstart/101-eventhub-network-rules-azapi/providers.tf index 90d294348..58dca6da1 100644 --- a/quickstart/101-eventhub-network-rules-azapi/providers.tf +++ b/quickstart/101-eventhub-network-rules-azapi/providers.tf @@ -2,17 +2,17 @@ terraform { required_providers { azapi = { source = "azure/azapi" - version = "=0.1.0" + version = "~>2.0" } azurerm = { source = "hashicorp/azurerm" - version = "=3.0.2" + version = "~>3.0" } random = { source = "hashicorp/random" - version = "=3.1.2" + version = "~>3.0" } } } From 898f1e03e684ae0da2a6a70476f04f070e8d7f08 Mon Sep 17 00:00:00 2001 From: Steven <87738005+stemaMSFT@users.noreply.github.com> Date: Wed, 6 May 2026 16:52:31 -0700 Subject: [PATCH 3/5] Fix idempotent check: ignore body changes on update resource The Terratest CI runs an idempotent plan after apply. azapi_update_resource sends a PATCH and the API response includes additional normalized properties not in the original request, causing plan drift. lifecycle ignore_changes on body is the standard pattern for update resources. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- quickstart/101-eventhub-network-rules-azapi/main-generic.tf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/quickstart/101-eventhub-network-rules-azapi/main-generic.tf b/quickstart/101-eventhub-network-rules-azapi/main-generic.tf index 7eb4baca3..a6b5b5dce 100644 --- a/quickstart/101-eventhub-network-rules-azapi/main-generic.tf +++ b/quickstart/101-eventhub-network-rules-azapi/main-generic.tf @@ -25,4 +25,10 @@ resource "azapi_update_resource" "qs101" { ] } } + + # The API response includes additional normalized properties not in the request, + # which causes plan drift on the idempotent check. Safe to ignore for update resources. + lifecycle { + ignore_changes = [body] + } } From 57e0761cea3776318cac7a9e8ec9fb34e8f5bfb6 Mon Sep 17 00:00:00 2001 From: Steven Ma <13874900+stevenjma@users.noreply.github.com> Date: Wed, 11 Nov 2026 13:51:24 -0800 Subject: [PATCH 4/5] Format renamed Lab Services quickstart Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- quickstart/101-lab-services-azapi/providers.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstart/101-lab-services-azapi/providers.tf b/quickstart/101-lab-services-azapi/providers.tf index fd35b9c13..92a6e843c 100644 --- a/quickstart/101-lab-services-azapi/providers.tf +++ b/quickstart/101-lab-services-azapi/providers.tf @@ -1,7 +1,7 @@ terraform { required_providers { azapi = { - source = "Azure/azapi" + source = "Azure/azapi" version = "~>2.0" } azurerm = { From e366d256edfb2d347e4e66e72f7da21e56ec29ab Mon Sep 17 00:00:00 2001 From: Steven Ma <13874900+stevenjma@users.noreply.github.com> Date: Wed, 11 Nov 2026 14:27:29 -0800 Subject: [PATCH 5/5] Validate renamed AzAPI quickstarts Update the Event Hub sample for subscription policies and record successful live deployment evidence for both renamed quickstarts. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- quickstart/101-eventhub-network-rules-azapi/main.tf | 11 +++++++---- .../101-eventhub-network-rules-azapi/metadata.json | 8 ++++++++ quickstart/101-lab-services-azapi/metadata.json | 8 ++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 quickstart/101-eventhub-network-rules-azapi/metadata.json create mode 100644 quickstart/101-lab-services-azapi/metadata.json diff --git a/quickstart/101-eventhub-network-rules-azapi/main.tf b/quickstart/101-eventhub-network-rules-azapi/main.tf index e05f36c67..6c5401641 100644 --- a/quickstart/101-eventhub-network-rules-azapi/main.tf +++ b/quickstart/101-eventhub-network-rules-azapi/main.tf @@ -16,10 +16,11 @@ resource "azurerm_virtual_network" "qs101" { } resource "azurerm_subnet" "qs101" { - name = "default" - resource_group_name = azurerm_resource_group.qs101.name - virtual_network_name = azurerm_virtual_network.qs101.name - address_prefixes = ["172.17.0.0/24"] + name = "default" + resource_group_name = azurerm_resource_group.qs101.name + virtual_network_name = azurerm_virtual_network.qs101.name + address_prefixes = ["172.17.0.0/24"] + default_outbound_access_enabled = false service_endpoints = ["Microsoft.EventHub"] } @@ -35,4 +36,6 @@ resource "azurerm_eventhub_namespace" "qs101" { resource_group_name = azurerm_resource_group.qs101.name sku = "Standard" capacity = 2 + + local_authentication_enabled = false } diff --git a/quickstart/101-eventhub-network-rules-azapi/metadata.json b/quickstart/101-eventhub-network-rules-azapi/metadata.json new file mode 100644 index 000000000..64e255476 --- /dev/null +++ b/quickstart/101-eventhub-network-rules-azapi/metadata.json @@ -0,0 +1,8 @@ +{ + "$schema": "../../.github/schemas/quickstart-metadata.schema.json", + "testResult": { + "correlationId": "3f219f90-9df9-4e55-a8ec-5a82c43f5c51", + "timestamp": "2026-11-11T22:20:29Z", + "terraformVersion": "1.17.1" + } +} diff --git a/quickstart/101-lab-services-azapi/metadata.json b/quickstart/101-lab-services-azapi/metadata.json new file mode 100644 index 000000000..843f8a529 --- /dev/null +++ b/quickstart/101-lab-services-azapi/metadata.json @@ -0,0 +1,8 @@ +{ + "$schema": "../../.github/schemas/quickstart-metadata.schema.json", + "testResult": { + "correlationId": "642f7752-96d9-4053-8ba2-9140504d088f", + "timestamp": "2026-11-11T22:24:12Z", + "terraformVersion": "1.17.1" + } +}