Skip to content

Commit

Permalink
Add the hint to suggest users use the standard public IP when creatin…
Browse files Browse the repository at this point in the history
…g VM
  • Loading branch information
zhoxing-ms committed Jun 28, 2021
1 parent 7623de3 commit 7ca6bb2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/azure-cli/azure/cli/command_modules/vm/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,19 @@ def create_vm(cmd, vm_name, resource_group_name, image=None, size='Standard_DS1_
build_vm_windows_log_analytics_workspace_agent)
from azure.cli.command_modules.vm._vm_utils import ArmTemplateBuilder20190401
from msrestazure.tools import resource_id, is_valid_resource_id, parse_resource_id
from azure.cli.core.profiles import AZURE_API_PROFILES

# In the latest profile and the profiles that use the same api-version as latest profile,
# the default public IP used for VM creation will be expected to be changed from Basic to Standard.
# In order to avoid breaking change which has a big impact on users,
# we use the hint to guide users to use Standard public IP to create VM in the first stage.
api_version_for_latest_profile = AZURE_API_PROFILES['latest'][ResourceType.MGMT_COMPUTE].default_api_version
if public_ip_sku is None and cmd.supported_api_version(ResourceType.MGMT_COMPUTE,
min_api=api_version_for_latest_profile):
logger.warning(
'It is recommended to use parameter "--public-ip-sku Standard" to create new VM with Standard public IP. '
'Please note that the default public IP used for VM creation will be changed from Basic to Standard '
'in the future.')

subscription_id = get_subscription_id(cmd.cli_ctx)

Expand Down

0 comments on commit 7ca6bb2

Please sign in to comment.