fix(azure): use azure.mgmt.network.SubResource for IPConfiguration subnet (was compute.SubResource) — unbreaks VM creation#9973
Open
murraju wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates sky/provision/azure/instance.py to use network.SubResource instead of compute.SubResource when defining the subnet for both private and public IP configurations. I have no feedback to provide as there are no review comments to evaluate.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
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.
Problem
sky launch --cloud azurefails at VM creation withObject of type SubResource is not JSON serializablewhen resolved against current/new-generationazure-mgmt-network/azure-mgmt-compute. This blocks every Azure launch end-to-end.Root cause
sky/provision/azure/instance.py::_create_network_interfacebuilds a networkIPConfigurationwhosesubnetis acompute.SubResource(a model from the azure-mgmt-compute package):The network SDK serializes the
NetworkInterfacebody. With new-genazure-mgmt-network(>=~25.x; reproducible with31.0.0b1) serialization goes through stdlibjson, which has no encoder for acompute.SubResourcenested in a network model →TypeError. It was latent under the older msrest-era SDKs.azure-mgmt-compute==33.0.0+azure-mgmt-network==31.0.0b1(what a freshpip install skypilot[azure]resolves today) expose it.azure-cliversion is irrelevant (confirmed: pinningazure-cli<2.70→ 2.69.0 does not fix it).Fix
Use the network SDK's own
SubResource— same package asIPConfiguration, serializes natively.networkis already bound in the function, so this is a 2-line, drop-in change (both the internal-IP and public-IP branches).network.SubResourceexists in everyazure-mgmt-networkrelease sky supports, is constructed identically (id=...), and round-trips through the serializer (as_dict()→{\id\: \...\}).Reproduction
Reproduces across every Azure region. Fails pre-VM-creation (no compute spend). After the patch, the VM is created and the cluster comes UP.
Verification
Live: with the patch applied,
sky launch --cloud azure --gpus T4:1provisions aStandard_NC4as_T4_v3; the NIC (the exact object that failed) is created; cluster reaches UP. (Azure eastus, 2026-06-28.)Notes
mastercarries the samecompute.SubResourceusage (unfixed as of 2026-06-28).azure-cli;skypilot[azure]pullsazure-mgmt-*with floors but no ceilings, so a fresh resolve gets the new-gen SDKs that expose this.