[appnet-preview] Enable Managed Gateway API addon in test AKS clusters#9851
[appnet-preview] Enable Managed Gateway API addon in test AKS clusters#9851deveshdama wants to merge 7 commits intoAzure:mainfrom
Conversation
The AKS RP now requires the Managed Gateway API addon (Standard or InferenceExtension) to be enabled on a managed cluster before it can join an AppLink-managed mesh. Mesh membership PUT returns 400 BadRequest otherwise. Update create_aks_cluster() in the test helper to install aks-preview and pass --enable-gateway-api so the appnet member join tests succeed. See https://aka.ms/managed-gateway-api
The aks-preview install added in the prior commit triggers a download of the CLI extension index, which exceeds the testsdk default 1MB response limit. Decorate test_appnet_member_join_fully_managed with @AllowLargeResponse(size_kb=99999) and re-record the cassette against the updated AKS create command.
️✔️Azure CLI Extensions Breaking Change Test
|
|
Hi @deveshdama, |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
There was a problem hiding this comment.
Pull request overview
Updates the appnet-preview scenario test infrastructure so AKS clusters created during recordings/tests satisfy the new AKS RP prerequisite for managed mesh membership creation (Managed Gateway API addon enabled).
Changes:
- Install/upgrade
aks-previewin the AKS test cluster helper soaz aks create --enable-gateway-apiis available. - Enable Managed Gateway API during AKS cluster creation (
--enable-gateway-api) to unblockaz appnet member joinprovisioning. - Increase the ScenarioTest HTTP recording response limit for the fully-managed member-join scenario via
@AllowLargeResponse.
The new member-join/member-list cassettes were recorded against the Canary endpoint (eastus2euap.management.azure.com) where the AppLink preview RP is exposed. CI playback uses the public ARM host, so the VCR host matcher failed. Replace the regional prefix to match the existing appnet cassettes.
Extension index lookup hits aka.ms / azcliextensionsync which doesn't match the recorded blob URL. Gate on self.is_live.
Using self.cmd records the extension index lookup into the cassette; gating on is_live skips it during playback, but then 'aks create' resolves to a different api-version than what was recorded. Run the install in a subprocess so VCR doesn't see it, but the extension is still present during both record and replay.
Tests that create real AKS clusters with --enable-gateway-api depend on the aks-preview SDK's api-version, which drifts with every aks-preview release. The in-process testsdk caches the command table at startup, so installing aks-preview mid-test (subprocess or otherwise) doesn't change the api-version sent. This caused cassette playback to fail with an api-version mismatch (2026-02-01 vs 2026-02-02-preview). Match the convention used by connectedk8s, k8s-runtime, vme, and containerapp: mark tests that create AKS clusters with @live_only(). Drop the now-unused cassettes.
| super(AppnetMemberPreviewScenario, self).__init__(*args, **kwargs) | ||
|
|
||
| @live_only() | ||
| @AllowLargeResponse(size_kb=99999) |
There was a problem hiding this comment.
Let's put this as a constant to understand who is the responsible of making this large response
Related command
az appnet member join/az appnet member updateDescription
The mesh membership API rejects AKS clusters that don't have the Managed Gateway API addon enabled (see https://aka.ms/managed-gateway-api). Tests that exercise the join path (
test_appnet_member_join_fully_managed,test_appnet_member_list) need to create AKS clusters with--enable-gateway-api, which is only available via theaks-previewCLI extension.We can't use cassette playback for these tests: the
aks-previewextension ships its own command override foraks createthat targets a preview api-version (currently2026-02-02-preview), and that api-version drifts with everyaks-previewrelease. The in-process testsdk caches the command table at process startup, so installingaks-previewmid-test doesn't change which module handlesaks create. This caused the recorded cassette (2026-02-02-preview) to mismatch the replay request (2026-02-01from publicacs).Following the convention used by
connectedk8s,k8s-runtime,vme, andcontainerapp, the two AKS-creating tests are now marked@live_only()so they only run during recording / live test runs and are skipped in playback CI. The stale cassettes have been removed.Testing
test_appnet_member_join_fully_managedandtest_appnet_member_listrun live against a real subscription withaks-previewinstalled.test_appnet_*) continue to use cassette playback unchanged.General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.