[MulticloudConnector] Target HybridConnectivity 2027-01-01 GA and add GCP support - #10267
Conversation
… GCP support * Bump the api-version of every generated AAZ command from 2024-12-01 to 2027-01-01 * Add `az arc-multicloud generate-gcp-template` * Add `--gcp-cloud-profile` to public-cloud-connector create/update and GCP to --host-type * Surface the read-only `kind` property and solution-type `hostTypes` * `awsCloudProfile` is no longer required by the service, matching the 2027-01-01 spec Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Hi alexmahonic (@alexmahonic), |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
This PR updates the multicloud-connector Azure CLI extension to target the 2027-01-01 GA Microsoft.HybridConnectivity API version and introduces GCP support alongside the existing AWS functionality.
Changes:
- Bump all generated AAZ commands (and test recordings) from
api-version=2024-12-01to2027-01-01. - Add GCP support to
public-cloud-connector create/updateand introduce a newarc-multicloud generate-gcp-templatecommand (with an--output-directorycustomization similar to AWS). - Update extension versioning/docs and add a live-only scenario test for GCP.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/multicloud-connector/setup.py | Bumps extension version to 1.1.0. |
| src/multicloud-connector/README.md | Adds GCP usage examples for create and template generation. |
| src/multicloud-connector/HISTORY.rst | Adds 1.1.0 changelog entry describing API bump + GCP features. |
| src/multicloud-connector/azext_multicloud_connector/tests/latest/test_multicloud_connector.py | Adds a live-only GCP scenario test exercising create/update/template/delete. |
| src/multicloud-connector/azext_multicloud_connector/tests/latest/recordings/test_solution_types.yaml | Updates recorded URIs/defaultApiVersion to 2027-01-01. |
| src/multicloud-connector/azext_multicloud_connector/tests/latest/recordings/test_solution_configuration.yaml | Updates recorded URIs/defaultApiVersion to 2027-01-01. |
| src/multicloud-connector/azext_multicloud_connector/tests/latest/recordings/test_public_cloud_connector.yaml | Updates recorded URIs/asyncoperation URLs to 2027-01-01. |
| src/multicloud-connector/azext_multicloud_connector/custom.py | Adds CustomizedGenerateGcpTemplate which writes the template output to disk. |
| src/multicloud-connector/azext_multicloud_connector/commands.py | Registers the new arc-multicloud generate-gcp-template command. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/solution_type/_show.py | Bumps API version; surfaces hostTypes on solution types. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/solution_type/_list.py | Bumps API version; surfaces hostTypes on solution types. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/solution_configuration/_create.py | Bumps API version to 2027-01-01. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/solution_configuration/_delete.py | Bumps API version to 2027-01-01. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/solution_configuration/_list.py | Bumps API version to 2027-01-01. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/solution_configuration/_show.py | Bumps API version to 2027-01-01. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/solution_configuration/_sync_now.py | Bumps API version to 2027-01-01. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/solution_configuration/_update.py | Bumps API version to 2027-01-01. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/public_cloud_connector/_create.py | Adds GCP args/schema + bumps API version; removes AWS profile requiredness. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/public_cloud_connector/_update.py | Adds --gcp-cloud-profile (org exclusion lists) + bumps API version. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/public_cloud_connector/_show.py | Bumps API version; surfaces read-only kind and gcpCloudProfile. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/public_cloud_connector/_list.py | Bumps API version; surfaces read-only kind and gcpCloudProfile. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/public_cloud_connector/_wait.py | Bumps API version; surfaces read-only kind and gcpCloudProfile. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/public_cloud_connector/_delete.py | Bumps API version to 2027-01-01. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/public_cloud_connector/_test_permission.py | Bumps API version to 2027-01-01. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/_generate_aws_template.py | Bumps API version to 2027-01-01. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/_generate_gcp_template.py | Adds new generated AAZ command for generate-gcp-template. |
| src/multicloud-connector/azext_multicloud_connector/aaz/latest/arc_multicloud/init.py | Exports the new generated generate-gcp-template command module. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
MulticloudConnector |
- generate-gcp-template test: use a fully-qualified connector ID (leading '/').
connectorId travels in the request body here, unlike the scope-style ID that
solution-configuration interpolates into the request path.
- generate-aws/gcp-template: stop swallowing failures in _output(). Returning
{"status": "error"} made the command exit 0 on failure; the helpers already
raise ValidationError, so let it propagate.
- tests: pin the Microsoft.Resources api-version used by the RP-registration
pre-check on replay. That version is owned by azure-cli-core, not this
extension, and core moving to 2024-11-01 broke every recorded test here
(reproduced on unmodified main).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Pushed ebf9738 addressing both review comments (replied inline). Heads-up on the red Every command in this extension calls I reproduced it on unmodified
The fix in this PR is a replay-only |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
public-cloud-connector create already showed both the nested brace form and the
flat key=value form for --aws-cloud-profile, but only the nested form for
--gcp-cloud-profile. Added the matching flat example, verified against the real
CLI (project-properties={...} and the dotted project-properties.project-id=...
form both parse to the expected request body).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
Master's convention is to show each object argument twice: once in the
nested "{...}" brace form and once in the flat key=value form. The GCP
examples added for 2027-01-01 only followed this partially, and the
update command had no GCP example at all.
- public-cloud-connector create: the GCP "flat" example still nested
braces one level down. Replace it with a fully dotted, brace-free form.
- public-cloud-connector update: add the missing AWS flat example and
both GCP examples (nested and flat).
- generate-gcp-template: add the flat companion to the nested example.
Every example string was executed against the CLI and its serialized
request body compared against the nested form to confirm they produce
identical payloads.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Commenter does not have sufficient privileges for PR 10267 in repo Azure/azure-cli-extensions |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
🤖 PR Validation —⚠️ Review suggested
Related command
az arc-multicloud generate-gcp-template(new)az arc-multicloud public-cloud-connector create/updateaz arc-multicloud solution-type show/listDescription
Targets the
2027-01-01GA version of theMicrosoft.HybridConnectivityAPI (previously2024-12-01) and adds GCP support to themulticloud-connectorextension. The API change is purely additive.Spec:
stable/2027-01-01/hybridconnectivity.jsonAPI version
2024-12-01→2027-01-01in every generated AAZ command file (17 files).New command
az arc-multicloud generate-gcp-template(GenerateGcpTemplate_Post), mirroring the existinggenerate-aws-template:--connector-id(required),--solution-types,--gcp-cloud-profile,--gcp-template-format(terraform|shellscript), plus the--output-directorycustomization that writes the response to disk.Public cloud connector
--host-typenow acceptsGCPin addition toAWS.create: new--gcp-cloud-profilewithproject-properties(project-number,project-id) andorganization-properties(organization-id,management-project-number,management-project-id,excluded-project-numbers,excluded-folder-ids).update: new--gcp-cloud-profilerestricted to the updatable subset —organization-properties.excluded-project-numbersandorganization-properties.excluded-folder-ids(perGcpOrganizationPropertiesUpdate).kindproperty surfaced on connector responses.awsCloudProfileis no longer required. In2027-01-01,PublicCloudConnectorProperties.requiredchanged from["awsCloudProfile", "hostType"]to["hostType"]. The generated code hard-required it, which made a GCP-only connector impossible to create, so the required flag was removed from the request builder and all response schemas.Help examples
main, every object argument is documented twice: once in the nested{...}brace form and once in the equivalent flatkey=valueform (create,update,generate-gcp-template). Each example string was executed and its serialized request body compared against the nested form to confirm the two produce identical payloads.Solution types
hostTypesadded toSolutionTypePropertiesand toSolutionTypeSettingsProperties(required in the new spec) forsolution-type show/list.Packaging / docs / tests
1.0.1→1.1.0with a matchingHISTORY.rstentry and README examples.test_gcp_public_cloud_connectorscenario, marked@live_only()so no recording is fabricated — it can be recorded on a live run.api-version=2024-12-01, so their recorded request URIs were updated to2027-01-01. Only the query-string version was changed; no request or response payloads were altered or invented.Review feedback (ebf9738)
generate-gcp-templatetest used a connector ID without the leading/. Fixed. It was copied from the pre-existingcidkwargs, but those feedsolution-configuration, where the connector ID is interpolated into the request path; here it is a request body property and must be a fully-qualified ARM ID. Added a comment at the call site._output()swallowed failures and returned{"status": "error"}with exit code 0. Fixed by dropping thetry/except—output_response_to_file()already raisesValidationErrorwith a useful message, so it now propagates and the command exits non-zero.generate-aws-templateblock, since the GCP block is a copy of it and two sibling commands with opposite failure semantics seemed worse than a small out-of-scope diff. Only the failure path changes. Happy to split that out if you'd prefer.CI: recorded tests were already failing on
mainThe first
/azp runfailedIntegration Tests, Build Testson Python 3.10–3.14. This is not caused by this PR — it is a pre-existing break in these recordings, and I've included a fix.Every command in this extension calls
register_providers_if_needed(), which talks to Microsoft.Resources viaResourceType.MGMT_RESOURCE_RESOURCES. That api-version is pinned by azure-cli-core, not by this extension. The recordings captured it as2022-09-01; azure-clidevnow pins2024-11-01, so the RP-registration request no longer matches the cassette,_is_resource_provider_registeredswallows the miss, the follow-upregisterPOST also misses, and every test dies with:Reproduced against unmodified
main(a2266a60c), changing nothing but that api-version:MGMT_RESOURCE_RESOURCESmain, untouched2022-09-01(matches recordings)main, untouched2022-09-012022-09-01Fix: a small
RecordingProcessoron the replay path that normalises the api-version on the RP-registration requests only (Microsoft.HybridConnectivity/Microsoft.AwsConnector/Microsoft.HybridCompute, with or without/register). Nothing is recorded, fabricated, or altered in the stored responses — it only makes the incoming request matchable again, and it stops these recordings from breaking every time core bumps a version that has nothing to do with this extension.Testing Guide
Build and install locally:
cd src/multicloud-connector python setup.py bdist_wheel az extension add --source ./dist/multicloud_connector-1.1.0-py3-none-any.whl --upgrade -yCreate a GCP connector and generate its template:
Run the recorded scenarios in playback:
AWS scenarios are unchanged and still pass against the existing recordings. The new GCP scenario is
@live_only()and reports as skipped in playback.This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired) —azdevis installed but not configured on this machine (azdev setuphas not been run), so the equivalent checks were run directly with the repo configs:flake8 src/multicloud-connector(0 issues) andpylint src/multicloud-connector/azext_multicloud_connector --rcfile=./pylintrc(10.00/10).python scripts/ci/test_index.py -qlocally? (pip install azdevrequired) —Ran 9 tests ... OK (skipped=2). Extension tests also re-run in playback: 3 passed, 1 skipped.1.0.1→1.1.0for backward-compatible new arguments and a new command.For new extensions:
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.