Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion src/azure-cli/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ Release History

**Network**

* az network list-service-aliases: support list service aliases which can be used for Service Endpoint Policies
* az application-gateway probe: Support --port option to specify a port for probing backend servers when create and update
* az network list-service-aliases: Support list service aliases which can be used for Service Endpoint Policies


**Packaging**

Expand Down
5 changes: 5 additions & 0 deletions src/azure-cli/azure/cli/command_modules/network/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ def load_arguments(self, _):
c.argument('interval', help='The time interval in seconds between consecutive probes.')
c.argument('threshold', help='The number of failed probes after which the back end server is marked down.')
c.argument('timeout', help='The probe timeout in seconds.')
c.argument('port', type=int, min_api='2019-04-01',
help='Custom port which will be used for probing the backend servers. '
'The valid value ranges from 1 to 65535. '
'In case not set, port from http settings will be used. '
'This property is valid for Standard_v2 and WAF_v2 only.')

with self.argument_context('network application-gateway rule') as c:
c.argument('address_pool', help='The name or ID of the backend address pool.', completer=get_ag_subresource_completion_list('backend_address_pools'))
Expand Down
8 changes: 6 additions & 2 deletions src/azure-cli/azure/cli/command_modules/network/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ def delete_ag_rewrite_rule_condition(cmd, resource_group_name, application_gatew

def create_ag_probe(cmd, resource_group_name, application_gateway_name, item_name, protocol, host,
path, interval=30, timeout=120, threshold=8, no_wait=False, host_name_from_http_settings=None,
min_servers=None, match_body=None, match_status_codes=None):
min_servers=None, match_body=None, match_status_codes=None, port=None):
ApplicationGatewayProbe, ProbeMatchCriteria = cmd.get_models(
'ApplicationGatewayProbe', 'ApplicationGatewayProbeHealthResponseMatch')
ncf = network_client_factory(cmd.cli_ctx)
Expand All @@ -682,6 +682,8 @@ def create_ag_probe(cmd, resource_group_name, application_gateway_name, item_nam
new_probe.pick_host_name_from_backend_http_settings = host_name_from_http_settings
new_probe.min_servers = min_servers
new_probe.match = ProbeMatchCriteria(body=match_body, status_codes=match_status_codes)
if cmd.supported_api_version(min_api='2019-04-01'):
new_probe.port = port

upsert_to_collection(ag, 'probes', new_probe, 'name')
return sdk_no_wait(no_wait, ncf.application_gateways.create_or_update,
Expand All @@ -690,7 +692,7 @@ def create_ag_probe(cmd, resource_group_name, application_gateway_name, item_nam

def update_ag_probe(cmd, instance, parent, item_name, protocol=None, host=None, path=None,
interval=None, timeout=None, threshold=None, host_name_from_http_settings=None,
min_servers=None, match_body=None, match_status_codes=None):
min_servers=None, match_body=None, match_status_codes=None, port=None):
if protocol is not None:
instance.protocol = protocol
if host is not None:
Expand All @@ -715,6 +717,8 @@ def update_ag_probe(cmd, instance, parent, item_name, protocol=None, host=None,
instance.match.body = match_body
if match_status_codes is not None:
instance.match.status_codes = match_status_codes
if port is not None:
instance.port = port
return parent


Expand Down
Loading