Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Network] az network lb create: Add warnings for default SKU #22339

Merged
merged 3 commits into from
May 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions src/azure-cli/azure/cli/command_modules/network/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3674,6 +3674,12 @@ def create_load_balancer(cmd, load_balancer_name, resource_group_name, location=
DeploymentProperties = cmd.get_models('DeploymentProperties', resource_type=ResourceType.MGMT_RESOURCE_RESOURCES)
IPAllocationMethod = cmd.get_models('IPAllocationMethod')

if public_ip_address is None:
logger.warning(
"Please note that the default public IP used for creation will be changed from Basic to Standard "
"in the future."
)

tags = tags or {}
public_ip_address = public_ip_address or 'PublicIP{}'.format(load_balancer_name)
backend_pool_name = backend_pool_name or '{}bepool'.format(load_balancer_name)
Expand Down Expand Up @@ -3890,6 +3896,11 @@ def create_lb_frontend_ip_configuration(
ncf = network_client_factory(cmd.cli_ctx)
lb = lb_get(ncf.load_balancers, resource_group_name, load_balancer_name)

if public_ip_address is None:
logger.warning(
"Please note that the default public IP used for LB frontend will be changed from Basic to Standard "
"in the future."
)
if private_ip_address_allocation is None:
private_ip_address_allocation = 'static' if private_ip_address else 'dynamic'

Expand Down Expand Up @@ -6359,15 +6370,11 @@ 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':
if sku is None:
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.')
"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')
Expand Down