Skip to content

test: correct PremiumV2 test subnet delegation - #7608

Merged
Andy Jordan (andyleejordan) merged 1 commit into
mainfrom
andyleejordan/api-management-v2-test-subnet
Nov 24, 2026
Merged

Andy Jordan (andyleejordan) merged 1 commit into
mainfrom
andyleejordan/api-management-v2-test-subnet

Conversation

@andyleejordan

@andyleejordan Andy Jordan (andyleejordan) commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 50d0cdb2e357099a608feb560d0050fe1fe80fc8

Dimension Assessment Rationale
Change confidence 9/10 Both compiled subnet checks fail before and pass after locally; cross-family review found no issues. The original PR-linked E2E run passed all 11 jobs with Avm.Authoring 0.44.0, including all seven deployments. Refreshing the initial title and static runs also passed; the live PR rollup now has 30 successful and three skipped checks, with none failing or pending. No post-deployment assertion tests were found, hosted unitFiles=0 does not establish execution of the authored regression, and PremiumV2 cleanup remains incomplete despite its successful job.
Diagnosis confidence 9.5/10 The PremiumV2 fixture delegates to App Service; Microsoft Learn requires Microsoft.ApiManagement/service for Premium v2 integration. The corrected fixture deployed successfully in both hosted attempts.
Evidence fit 9.5/10 The reported VirtualNetworkSubnetHasIncorrectDelegation error names this fixture's subnet and requests the corrected service. Hosted deployment now succeeds; that does not establish assertion or complete cleanup coverage.

Description

Fixes #7605.

The v2max fixture deploys PremiumV2 with external virtual network integration, but both regional subnets were delegated to Microsoft.Web/serverFarms. The reported deployment failure rejects that delegation and requests Microsoft.ApiManagement/service.

I corrected the delegation name and properties.serviceName in both regional definitions. This is deliberately specific to Premium v2: Microsoft Learn still requires Microsoft.Web/serverFarms for Standard v2. The new Pester regression compiles the actual dependency fixture and checks each region's default subnet, so fixing only one region cannot pass.

Production module behavior, resource names, network rules, and deployment scenarios are unchanged. This does not address #7472's separate portal delegation validation-key failure or #7449's naming work. No module version, generated documentation, or changelog changes are needed for this fixture-only correction.

Pipeline Reference

Pipeline
Original PR-linked E2E run, attempt 2: SUCCESS, all 11 jobs, at the unchanged assessed revision with Gallery Avm.Authoring 0.44.0. Finished November 12 at 3:40 PM Pacific.
Initial module checks, attempt 2: SUCCESS with Gallery Avm.Authoring 0.44.0. Refreshed both formerly failing static checks; E2E discovery and deployment were skipped.
Initial title check, attempt 2: SUCCESS, validating the current corrected PR title.
Hosted run 43082659112, attempt 1: completed with failure at the assessed revision. Historical outcomes below come from all seven terminal logs and the six available cleanup journals, not green step conclusions.
Initial module checks, attempt 1: avm.bicep.json-stale on eight unchanged production templates. Hosted E2E attempt 1 repeats this with Avm.Authoring 0.42.0. The comparator defect is tracked in Azure/azure-verified-modules-tools#353, with fix Azure/azure-verified-modules-tools#354. Both original suites now pass on attempt 2.
Static-only recheck 43226848474: succeeded at the unchanged assessed revision with Gallery Avm.Authoring 0.43.0, which includes the comparator fix. deploymentValidation=false; both E2E jobs skipped. No json-stale findings remain in either static job.

Current PR-linked verification: attempt 2

The full E2E rerun refreshed initialization and loaded Gallery Avm.Authoring 0.44.0 rather than reusing the old prepared runtime. PR-check and unit jobs passed with no json-stale errors. Unit artifact 13977753289 reports status=pass, 12,515 passed cases and 62 warning-only compliance findings (61 near expiry, one outdated). Its archive digest was verified. unitFiles=0 means this is not evidence that hosted CI executed the authored regression; the fail-before/pass-after evidence below is local.

All seven deployments succeeded, all seven cleanup artifacts uploaded successfully, and all seven archive digests were verified. WAF succeeded after the existing in-place retry handled an Azure InternalServerError; no additional workflow rerun was needed. Every scenario reported No post-deployment tests found, so deployment success is not independent post-deployment assertion coverage.

Scenario Deployment Actual cleanup Cleanup-state upload
consumptionSku, defaults, developerSku, v2min Succeeded Each journal Complete, 2/2 removed flags true All succeeded
max Succeeded Journal Complete, 72/72 removed flags true Succeeded; artifact 13994183202
waf-aligned Succeeded after built-in retry Journal Complete, 31/31 removed flags true Succeeded; artifact 13990940781
v2max Succeeded Journal CleanupPending, 37 removed flags true and 4 false: resource group, VNet, NSG and route table retained because of provider-side network references Succeeded; artifact 13983958009

The 152 journal flags total 148 true and four false. PremiumV2's remaining cleanup warning did not fail its CI job; I am not describing it as complete cleanup. Purge requests were accepted, not independently observed to finish. No manual Azure recovery was performed or is proposed as a prerequisite to this fixture fix. Historical residuals are deferred to the BAMI-managed test tenant lifecycle, not claimed deleted.

The live PR rollup now contains 30 successful checks and three intentional skips, with zero failed or pending checks. I refreshed the initial title run 43072072397 and initial static run 43072075256 once each, including initialization, to replace their stale failure results. The static initializer loaded Gallery 0.44.0 and explicitly reported PR_LABELS=[] and DEPLOYMENT=false from its original opened-event payload; both E2E jobs skipped. Its PR-check passed with no json-stale errors, and verified unit artifact 13995049815 reports the same 12,515 passed cases, 62 warning-only findings and unitFiles=0. These two refreshes started no Azure deployment and did not rerun the successful E2E suite. Review approval remains required; no merge was performed.

Historical verification and cleanup caveats

The 0.43.0 static-only recheck passed metadata, format, transform, lint, policy, convention, validate, and docs; Terraform-only sync was skipped. Its unit artifact 13948503274 reports status=pass, with 12,515 passed cases and 62 warning-level API-version compliance failures (61 near expiry, one outdated), and no error issues. It also reports unitFiles=0: that run does not prove the authored regression executed. The downloaded archive SHA-256 matches the upload digest fa53ac28e16ae9ce9d4b28b0f158ea901aa60b34caefd9dc7717783243c142ef. That static-only pass neither fixed nor reverified the historical cleanup failures below; it performed no new deployment or Azure recovery.

Correction: Earlier status reports overstated post-deployment assertion and cleanup success. A green combined completion step can still log Cleanup did not complete. The subnet correction has hosted deployment-success evidence, not post-deployment assertion or complete cleanup-success evidence. The PR was placed in draft during that reconciliation; current attempt-2 CI now passes as recorded above. The cleanup-driven E2E, gate-approval, and triggering-push hold was lifted on November 12. This does not resolve historical cleanup failures. No Azure recovery was performed.

The following table concerns attempt 1 only; its artifacts must not be confused with the current attempt's evidence.

Scenario Deployment Post-deployment assertions Actual cleanup Cleanup-state upload
consumptionSku Succeeded No tests found Journal Complete; 2/2 removed flags true Succeeded; artifact 13885844904
defaults Succeeded No tests found Journal Complete; 2/2 removed flags true Succeeded; artifact 13887794883
developerSku Succeeded No tests found Journal Complete; 2/2 removed flags true Succeeded; artifact 13888347278
v2min Succeeded No tests found Journal Complete; 2/2 removed flags true Succeeded; artifact 13889107940
max Succeeded No tests found (log line 4496) Incomplete (line 4718); journal CleanupPending, 57 removed flags true and 15 false Succeeded; artifact 13903171191
v2max Succeeded (line 4296) No tests found (line 4361) Incomplete (lines 4477–4489); journal unavailable, so no exhaustive residual count is verified Failed after five artifact-service HTML/JSON errors (line 4514); no journal artifact
waf-aligned Failed: private endpoint InternalServerError, then APIM ServiceLocked Not run after deployment failure; no assertion files in the scenario Incomplete, including cleanup retry; journal CleanupPending, 24 removed flags true and 6 false Succeeded; artifact 13891027481

All six attempt-1 downloaded archive SHA-256 digests match GitHub metadata. Every available journal removed flag was checked: 89 true and 21 false. The four Complete journals record resource-group/APIM deletion; their logs show purge accepted with HTTP 202, not observed purge completion. None of the seven scenarios provides evidence of executed passing post-deployment assertions. No live Azure verification was performed.

Attempt-1 max cleanup logs show lock-read HTTP 400, unsupported child-resource DELETE operations, product subscriptions, retained-child guards, and networks still in use. v2max logs show lock-read HTTP 400, a logger still attached to diagnostics, parent guards, and network dependencies still in use. Its missing journal is not replaced with a synthesized state file. WAF's final attempt-1 journal has six retained entries; its private endpoint is not among those final false flags. Exact residual scopes, original logs, journals, and digest evidence are retained privately as historical evidence, not an active manual recovery assignment.

An earlier automatic module run skipped the module matrix and did not resolve static failures. The explicit static-only recheck cleared the comparator blocker without regenerating production templates; both original PR-linked suites now confirm it with 0.44.0. The corrected title, metadata, Prettier, CodeQL, labels, and CLA checks passed.

Local validation:

  • Ran bicep format avm/res/api-management/service/tests/e2e/v2max/dependencies.bicep and PowerShell Invoke-Formatter -Settings CodeFormattingOTBS on the new test file; subsequent formatting checks and git diff --check passed.
  • Both regional regression cases failed with the original Microsoft.Web/serverFarms value, then passed with the correction. I also removed the fix, verified the fixture matched HEAD, reproduced both failures, restored it, and reran successfully.
  • All seven API Management E2E main.test.bicep scenarios compiled with bicep build using Bicep 0.48.1. Existing API-age warnings remain.
  • API Management compliance: 173 passed, 3 skipped, 0 failed. The README-rewriting Set-ModuleReadMe parity test was excluded; no README changes are part of this fix.
  • Full local utility Pester suite: 3,758 passed, 8 failed, 2 skipped. The eight failures reproduced with the fix removed: two historical-baseline checks in BicepWorkflowCaller, one historical approval-list check in BicepWorkflowConfiguration, and five nested-Pester empty-ForEach failures in MetadataWorkflow. They are outside this change and were not modified.
  • PSScriptAnalyzer reports the two Pester-scope unused-variable/parameter warnings also present in the existing fixture tests; no other warnings or errors. Cross-family review returned no findings.

Type of Change

  • Azure Verified Module updates:
    • Bugfix containing backwards-compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in version.json:
    • Feature update backwards compatible feature updates, and I have bumped the MINOR version in version.json.
    • Breaking changes and I have bumped the MAJOR version in version.json.
    • Update to documentation
  • Update to CI Environment or utilities (Non-module affecting changes)

Checklist

  • I'm sure there are no other open Pull Requests for the same update/change
  • I have run Set-AVMModule locally to generate the supporting module files.
  • My corresponding pipelines / checks run clean and green without any errors or warnings
  • I have updated the module's CHANGELOG.md file with an entry for the next version

Set-AVMModule and a changelog entry are not applicable here: no production main.bicep or generated module files changed. The warning-free checkbox remains unchecked despite the successful current CI run: PremiumV2 cleanup and API-compliance warnings remain, alongside historical cleanup caveats and unrelated local baseline failures.

Drafted by Copilot with GPT-6 Astra.

@andyleejordan
Andy Jordan (andyleejordan) requested a review from a team as a code owner November 11, 2026 17:50
@andyleejordan Andy Jordan (andyleejordan) changed the title Correct PremiumV2 test subnet delegation test: correct PremiumV2 test subnet delegation Nov 11, 2026
@azure-verified-modules azure-verified-modules Bot added the Needs: Core Team 🧞 This item needs the AVM Core Team to review it label Nov 11, 2026
@andyleejordan
Andy Jordan (andyleejordan) marked this pull request as draft November 12, 2026 00:17
auto-merge was automatically disabled November 12, 2026 00:17

Pull request was converted to draft

@andyleejordan
Andy Jordan (andyleejordan) marked this pull request as ready for review November 12, 2026 23:43
@AlexanderSehr

Copy link
Copy Markdown
Contributor

Hey Andy Jordan (@andyleejordan), please note that one of the require checks is failing.

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

E2E label requirement satisfied

No E2E label action is needed for this run. This does not mean validation has passed.

View PR-check run

Delegate both regional v2max subnets to API Management rather than
App Service. PremiumV2 outbound integration requires this delegation;
Standard v2 still uses Microsoft.Web/serverFarms.

Add compiled-template checks for each regional subnet. Both assertions
fail on the original fixture and pass with the correction. Production
modules and the existing deployment scenarios are unchanged.

Drafted by Copilot with GPT-6 Astra.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@andyleejordan
Andy Jordan (andyleejordan) force-pushed the andyleejordan/api-management-v2-test-subnet branch from 50d0cdb to 3a43c77 Compare November 23, 2026 17:10
@andyleejordan Andy Jordan (andyleejordan) added the PR: Run Required E2E Tests Run required end-to-end tests for this pull request. label Nov 23, 2026
@andyleejordan
Andy Jordan (andyleejordan) merged commit 50a74cf into main Nov 24, 2026
25 of 26 checks passed
@andyleejordan
Andy Jordan (andyleejordan) deleted the andyleejordan/api-management-v2-test-subnet branch November 24, 2026 00:02
Andy Jordan (andyleejordan) added a commit that referenced this pull request Nov 24, 2026
Incorporate #7608, #7644, and #7527 so the kubernetes-configuration
extension and API Management PremiumV2 E2E fixtures use allowed SKUs,
regions, release trains, and subnet delegations.

Drafted by Copilot with Gemini 4 Carbon.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch was previously deployed

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

Labels

Needs: Core Team 🧞 This item needs the AVM Core Team to review it PR: Run Required E2E Tests Run required end-to-end tests for this pull request. Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AVM Module Issue]: API Management v2 test subnets use the wrong service delegation

4 participants