Skip to content

Commit afd5bc7

Browse files
committed
Add --https-only param for slot creation command
1 parent 26cf88c commit afd5bc7

File tree

6 files changed

+5175
-2
lines changed

6 files changed

+5175
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,7 @@ def load_arguments(self, _):
10011001
c.argument('registry_password', options_list=['--registry-password', '-d', c.deprecate(target='--docker-registry-server-password', redirect='--registry-password')],
10021002
help='The container registry server password')
10031003
c.argument('registry_username', options_list=['--registry-username', '-u', c.deprecate(target='--docker-registry-server-user', redirect='--registry-username')], help='the container registry server username')
1004+
c.argument('https_only', help="Redirect all traffic made to an app using HTTP to HTTPS.", arg_type=get_three_state_flag())
10041005
with self.argument_context('functionapp deployment slot swap') as c:
10051006
c.argument('action',
10061007
help="swap types. use 'preview' to apply target slot's settings on the source slot first; use 'swap' to complete it; use 'reset' to reset the swap",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2532,7 +2532,7 @@ def create_webapp_slot(cmd, resource_group_name, webapp, slot, configuration_sou
25322532

25332533
def create_functionapp_slot(cmd, resource_group_name, name, slot, configuration_source=None,
25342534
image=None, registry_password=None,
2535-
registry_username=None):
2535+
registry_username=None, https_only=True):
25362536
container_args = image or registry_password or registry_username
25372537
if container_args and not configuration_source:
25382538
raise ArgumentUsageError("Cannot use image, password and username arguments without "
@@ -2546,7 +2546,7 @@ def create_functionapp_slot(cmd, resource_group_name, name, slot, configuration_
25462546
if not site:
25472547
raise ResourceNotFoundError("'{}' function app doesn't exist".format(name))
25482548
location = site.location
2549-
slot_def = Site(server_farm_id=site.server_farm_id, location=location)
2549+
slot_def = Site(server_farm_id=site.server_farm_id, location=location, https_only=https_only)
25502550

25512551
poller = client.web_apps.begin_create_or_update_slot(resource_group_name, name, site_envelope=slot_def, slot=slot)
25522552
result = LongRunningOperation(cmd.cli_ctx)(poller)

0 commit comments

Comments
 (0)