Skip to content

Standardize AzAPI sample folder naming convention#484

Open
stemaMSFT wants to merge 3 commits into
masterfrom
azapi/rename-convention
Open

Standardize AzAPI sample folder naming convention#484
stemaMSFT wants to merge 3 commits into
masterfrom
azapi/rename-convention

Conversation

@stemaMSFT
Copy link
Copy Markdown
Member

@stemaMSFT stemaMSFT commented May 6, 2026

Summary

Standardize AzAPI sample folder naming to use provider suffix instead of prefix.

Renames

Before After
quickstart/101-azapi-lab-services quickstart/101-lab-services-azapi
quickstart/101-azapi-eventhub-network-rules quickstart/101-eventhub-network-rules-azapi

Convention

All AzAPI sample folders use the suffix pattern: <number>-<service>-azapi

This makes it clear which azurerm sample the azapi version corresponds to (same base name + -azapi suffix), and aligns with existing folders like 101-resource-group-azapi and 201-aks-clusters-fleet-manager-azapi.

Validation

  • terraform validate passes in both renamed folders

Linked PR

⚠️ Merge order: This PR merges first, then the docs PR updates code reference paths.

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>
- 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>
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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Standardizes AzAPI quickstart sample folder names to use a consistent -azapi suffix pattern, aligning AzAPI variants with their corresponding azurerm samples.

Changes:

  • Renames AzAPI quickstart folders to the <number>-<service>-azapi suffix convention.
  • Updates/introduces Terraform configuration files under the renamed folders (including provider constraints and sample logic tweaks).
  • Adjusts the EventHub sample to reduce idempotency drift (via request/body handling and lifecycle settings) and changes RG naming to a randomized name.

Reviewed changes

Copilot reviewed 3 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
quickstart/101-lab-services-azapi/main.tf Defines resources for the lab-services AzAPI sample (RG/identity/ACR via AzAPI).
quickstart/101-lab-services-azapi/providers.tf Declares required providers and azurerm provider configuration for the sample.
quickstart/101-lab-services-azapi/variables.tf Adds input variables for location, RG naming, and ACR naming.
quickstart/101-lab-services-azapi/outputs.tf Exposes basic outputs from the sample.
quickstart/101-lab-services-azapi/TestRecord.md Carries forward the historical execution/test record for the sample.
quickstart/101-eventhub-network-rules-azapi/providers.tf Updates provider version constraints for the EventHub AzAPI sample.
quickstart/101-eventhub-network-rules-azapi/main.tf Changes RG naming to use a randomized name for uniqueness.
quickstart/101-eventhub-network-rules-azapi/main-generic.tf Switches AzAPI update body handling and adds lifecycle ignore_changes to address drift.
quickstart/101-eventhub-network-rules-azapi/TestRecord.md Carries forward the historical execution/test record for the sample.
Comments suppressed due to low confidence (2)

quickstart/101-eventhub-network-rules-azapi/providers.tf:16

  • The PR description says this change is only about renaming sample folders, but this commit also changes provider version constraints (and other behavior in the sample). Please update the PR description to reflect these functional changes, or split them into a separate PR to keep the rename-only change easy to review/revert.
    quickstart/101-eventhub-network-rules-azapi/main-generic.tf:33
  • lifecycle { ignore_changes = [body] } will also ignore intentional configuration changes to the network rules, so subsequent edits to body will not be applied. Consider narrowing ignore_changes to the specific drifting subfields (or otherwise normalizing the request) so the sample still converges when users change the rules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants