Skip to content

Commit 813bd85

Browse files
committed
fix: add static version
1 parent 4f8ec32 commit 813bd85

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/azure-cli/azure/cli/command_modules/vm/_validators.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,14 @@ def _check_subnet(s):
824824
subnet_exists = \
825825
check_existence(cmd.cli_ctx, subnet, rg, 'Microsoft.Network', 'subnets', vnet, 'virtualNetworks')
826826

827+
if not subnet_exists:
828+
from azure.cli.command_modules.network.aaz.latest.network.vnet import Show as VNetShow
829+
cli_api_version = VNetShow._aaz_info["version"]
830+
831+
subnet_exists = \
832+
check_existence(cmd.cli_ctx, subnet, rg, 'Microsoft.Network', 'subnets', vnet, 'virtualNetworks',
833+
api_version=cli_api_version)
834+
827835
if subnet_is_id and not subnet_exists:
828836
raise CLIError("Subnet '{}' does not exist.".format(subnet))
829837
if subnet_exists:

0 commit comments

Comments
 (0)