Standardize AzAPI sample folder naming convention#484
Open
stemaMSFT wants to merge 3 commits into
Open
Conversation
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>
There was a problem hiding this comment.
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>-azapisuffix 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 tobodywill not be applied. Consider narrowingignore_changesto 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Standardize AzAPI sample folder naming to use provider suffix instead of prefix.
Renames
quickstart/101-azapi-lab-servicesquickstart/101-lab-services-azapiquickstart/101-azapi-eventhub-network-rulesquickstart/101-eventhub-network-rules-azapiConvention
All AzAPI sample folders use the suffix pattern:
<number>-<service>-azapiThis makes it clear which azurerm sample the azapi version corresponds to (same base name +
-azapisuffix), and aligns with existing folders like101-resource-group-azapiand201-aks-clusters-fleet-manager-azapi.Validation
terraform validatepasses in both renamed foldersLinked PR