Skip to content

Commit c95e797

Browse files
authored
support ssl-certificate-name argument (#18861)
1 parent 27c2f8d commit c95e797

5 files changed

Lines changed: 1717 additions & 4 deletions

File tree

src/azure-cli/azure/cli/command_modules/network/_params.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ def load_arguments(self, _):
193193
c.argument('http_settings_port', help='The HTTP settings port.')
194194
c.argument('servers', ag_servers_type)
195195
c.argument('key_vault_secret_id', help="Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in Azure KeyVault. You need enable soft delete for keyvault to use this feature.", is_preview=True)
196+
c.argument('ssl_cert_name', options_list='--ssl-certificate-name', help="The certificate name. Default will be `<application-gateway-name>SslCert`.")
196197

197198
with self.argument_context('network application-gateway update', arg_group=None) as c:
198199
c.argument('sku', default=None)

src/azure-cli/azure/cli/command_modules/network/_template_builder.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ def build_application_gateway_resource(cmd, name, location, tags, sku_name, sku_
7474
private_link_subnet_id=None,
7575
trusted_client_certificates=None,
7676
ssl_profile=None,
77-
ssl_profile_id=None):
77+
ssl_profile_id=None,
78+
ssl_cert_name=None):
7879

7980
# set the default names
8081
frontend_public_ip_name = 'appGatewayFrontendIP'
@@ -84,7 +85,9 @@ def build_application_gateway_resource(cmd, name, location, tags, sku_name, sku_
8485
http_listener_name = 'appGatewayHttpListener'
8586
http_settings_name = 'appGatewayBackendHttpSettings'
8687
routing_rule_name = 'rule1'
87-
ssl_cert_name = '{}SslCert'.format(name)
88+
89+
if not ssl_cert_name:
90+
ssl_cert_name = '{}SslCert'.format(name)
8891

8992
ssl_cert = None
9093

src/azure-cli/azure/cli/command_modules/network/custom.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ def create_application_gateway(cmd, application_gateway_name, resource_group_nam
154154
private_link_primary=None,
155155
trusted_client_cert=None,
156156
ssl_profile=None,
157-
ssl_profile_id=None):
157+
ssl_profile_id=None,
158+
ssl_cert_name=None):
158159
from azure.cli.core.util import random_string
159160
from azure.cli.core.commands.arm import ArmTemplateBuilder
160161
from azure.cli.command_modules.network._template_builder import (
@@ -226,7 +227,7 @@ def create_application_gateway(cmd, application_gateway_name, resource_group_nam
226227
firewall_policy, max_capacity, user_assigned_identity,
227228
enable_private_link, private_link_name,
228229
private_link_ip_address, private_link_ip_allocation_method, private_link_primary,
229-
private_link_subnet_id, trusted_client_cert, ssl_profile, ssl_profile_id)
230+
private_link_subnet_id, trusted_client_cert, ssl_profile, ssl_profile_id, ssl_cert_name)
230231

231232
app_gateway_resource['dependsOn'] = ag_dependencies
232233
master_template.add_variable(

0 commit comments

Comments
 (0)