From dab86c2245afe8a3621fed79a0d008476dd74987 Mon Sep 17 00:00:00 2001 From: "Tina Ni (Wicresoft)" Date: Fri, 15 Apr 2022 15:59:51 +0800 Subject: [PATCH] Add hint to public-ip create with standard sku --- .../azure/cli/command_modules/network/custom.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/azure-cli/azure/cli/command_modules/network/custom.py b/src/azure-cli/azure/cli/command_modules/network/custom.py index 2e5550487a8..6963a7c7a1c 100644 --- a/src/azure-cli/azure/cli/command_modules/network/custom.py +++ b/src/azure-cli/azure/cli/command_modules/network/custom.py @@ -6352,6 +6352,16 @@ def create_public_ip(cmd, resource_group_name, public_ip_address_name, location= allocation_method=None, dns_name=None, idle_timeout=4, reverse_fqdn=None, version=None, sku=None, tier=None, zone=None, ip_tags=None, public_ip_prefix=None, edge_zone=None, ip_address=None): + + # In the latest profile, the default public IP will be expected to be changed from Basic to Standard. + # In order to avoid breaking change which has a big impact to users, + # we use the hint to guide users to use Standard sku to create public IP. + if sku is None and cmd.cli_ctx.cloud.profile == 'latest': + logger.warning( + 'It is recommended to use parameter "--sku Standard" to create new public IP. ' + 'Please note that the default public IP used for creation will be changed from Basic to Standard ' + 'in the future.') + IPAllocationMethod, PublicIPAddress, PublicIPAddressDnsSettings, SubResource = cmd.get_models( 'IPAllocationMethod', 'PublicIPAddress', 'PublicIPAddressDnsSettings', 'SubResource') client = network_client_factory(cmd.cli_ctx).public_ip_addresses