Skip to content

Commit

Permalink
[App Service] Fix #26647: az webapp show: Remove duplicate IPs from o…
Browse files Browse the repository at this point in the history
…utbound addresses (#26738)
  • Loading branch information
madsd committed Jun 25, 2023
1 parent 5b1781e commit 9741617
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/azure-cli/azure/cli/command_modules/appservice/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
_normalize_location,
get_pool_manager, use_additional_properties, get_app_service_plan_from_webapp,
get_resource_if_exists, repo_url_to_name, get_token,
app_service_plan_exists, is_centauri_functionapp)
app_service_plan_exists, is_centauri_functionapp, _remove_list_duplicates)
from ._create_util import (zip_contents_from_dir, get_runtime_version_details, create_resource_group, get_app_details,
check_resource_group_exists, set_location, get_site_availability, get_profile_username,
get_plan_to_use, get_lang_from_content, get_rg_to_use, get_sku_to_use,
Expand Down Expand Up @@ -993,6 +993,7 @@ def show_app(cmd, resource_group_name, name, slot=None):
if not is_centauri_functionapp(cmd, resource_group_name, name):
_rename_server_farm_props(app)
_fill_ftp_publishing_url(cmd, app, resource_group_name, name, slot)
_remove_list_duplicates(app)
return app


Expand Down
9 changes: 9 additions & 0 deletions src/azure-cli/azure/cli/command_modules/appservice/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,15 @@ def _normalize_location(cmd, location):
return location


def _remove_list_duplicates(webapp):
outbound_ips = webapp.possible_outbound_ip_addresses.split(',')
outbound_ips_list = list(dict.fromkeys(outbound_ips))
outbound_ips_list.sort()
outbound_ips = ','.join(outbound_ips_list)
del webapp.possible_outbound_ip_addresses
setattr(webapp, 'possible_outbound_ip_addresses', outbound_ips)


def get_pool_manager(url):
proxies = urllib.request.getproxies()
bypass_proxy = urllib.request.proxy_bypass(urllib.parse.urlparse(url).hostname)
Expand Down

0 comments on commit 9741617

Please sign in to comment.