Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[App Service] az webapp up/create/update: Add new parameter --basic-auth to allow users to enable and disable basic auth #28237

Merged
merged 10 commits into from
Feb 18, 2024

Conversation

shnjefff
Copy link
Member

Related command

az webapp up -g --name --basic-auth enabled/disabled
az webapp update -g --name --basic-auth enabled/disabled
az webapp create -g -p --name --basic-auth enabled/disabled

Description

This pr add --basic-auth parameter to webapp create/up/update so that customers can toggle basic auth settings. The default value for --basic-auth is "" (empty string), which will not change existing settings. Customers only allow to input two values: "enabled" and "disabled" case insensitively. Any other values will raise exception.

Testing Guide

create a webapp and use related command to change the basic auth setting
If enabled, you should see basic auth publishing as on. Otherwise off
image

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature


This checklist is used to make sure that common guidelines for a pull request are followed.

Copy link

azure-client-tools-bot-prd bot commented Jan 23, 2024

️✔️AzureCLI-FullTest
️✔️acr
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️acs
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.11
️✔️3.9
️✔️ams
️✔️latest
️✔️3.11
️✔️3.9
️✔️apim
️✔️latest
️✔️3.11
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.11
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.11
️✔️3.9
️✔️aro
️✔️latest
️✔️3.11
️✔️3.9
️✔️backup
️✔️latest
️✔️3.11
️✔️3.9
️✔️batch
️✔️latest
️✔️3.11
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.11
️✔️3.9
️✔️billing
️✔️latest
️✔️3.11
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.11
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.11
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.11
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.11
️✔️3.9
️✔️config
️✔️latest
️✔️3.11
️✔️3.9
️✔️configure
️✔️latest
️✔️3.11
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.11
️✔️3.9
️✔️container
️✔️latest
️✔️3.11
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.11
️✔️3.9
️✔️core
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.11
️✔️3.9
️✔️databoxedge
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️dla
️✔️latest
️✔️3.11
️✔️3.9
️✔️dls
️✔️latest
️✔️3.11
️✔️3.9
️✔️dms
️✔️latest
️✔️3.11
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.11
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.11
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.11
️✔️3.9
️✔️find
️✔️latest
️✔️3.11
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.11
️✔️3.9
️✔️identity
️✔️latest
️✔️3.11
️✔️3.9
️✔️iot
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️keyvault
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️kusto
️✔️latest
️✔️3.11
️✔️3.9
️✔️lab
️✔️latest
️✔️3.11
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.11
️✔️3.9
️✔️maps
️✔️latest
️✔️3.11
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.11
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.11
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.11
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.11
️✔️3.9
️✔️network
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.11
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.11
️✔️3.9
️✔️profile
️✔️latest
️✔️3.11
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.11
️✔️3.9
️✔️redis
️✔️latest
️✔️3.11
️✔️3.9
️✔️relay
️✔️latest
️✔️3.11
️✔️3.9
️✔️resource
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️role
️✔️latest
️✔️3.11
️✔️3.9
️✔️search
️✔️latest
️✔️3.11
️✔️3.9
️✔️security
️✔️latest
️✔️3.11
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.11
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.11
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.11
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.11
️✔️3.9
️✔️sql
️✔️latest
️✔️3.11
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.11
️✔️3.9
️✔️storage
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.11
️✔️3.9
️✔️telemetry
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️util
️✔️latest
️✔️3.11
️✔️3.9
️✔️vm
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9

Copy link

Hi @shnjefff,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

Copy link

azure-client-tools-bot-prd bot commented Jan 23, 2024

⚠️AzureCLI-BreakingChangeTest
⚠️appservice
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd webapp create cmd webapp create added parameter basic_auth
⚠️ 1006 - ParaAdd webapp up cmd webapp up added parameter basic_auth
⚠️ 1006 - ParaAdd webapp update cmd webapp update added parameter basic_auth

@yonzhan
Copy link
Collaborator

yonzhan commented Jan 23, 2024

App Service

@shnjefff shnjefff changed the title [App Service] az webapp up/create/update --basic-auth [App Service] az webapp up/create/update --basic-auth: allow user to enable and disable basic auth Jan 23, 2024
@shnjefff shnjefff changed the title [App Service] az webapp up/create/update --basic-auth: allow user to enable and disable basic auth [App Service] 'az webapp up/create/update --basic-auth': allow user to enable and disable basic auth Jan 23, 2024
@shnjefff shnjefff changed the title [App Service] 'az webapp up/create/update --basic-auth': allow user to enable and disable basic auth [App Service] az webapp up/create/update --basic-auth: allow user to enable and disable basic auth Jan 23, 2024
@@ -160,6 +160,7 @@ def load_arguments(self, _):
c.argument('subnet', help="Name or resource ID of the pre-existing subnet to have the webapp join. The --vnet is argument also needed if specifying subnet by name.")
c.argument('public_network_access', help="Enable or disable public access to the web app", arg_type=get_enum_type(PUBLIC_NETWORK_ACCESS_MODES))
c.argument('acr_use_identity', action='store_true', help="Enable or disable pull image from acr use managed identity")
c.argument('basic_auth', options_list=['--basic-auth'], help='Enable or disable basic auth.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
c.argument('basic_auth', options_list=['--basic-auth'], help='Enable or disable basic auth.')
c.argument('basic_auth', action='store_true', help='Enable or disable basic auth.')

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options_list=['--basic-auth']

There is no need to explicitly declare the default option name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

action='store_true'

Please select the appropriate type for the Bool variable

@shnjefff shnjefff changed the title [App Service] az webapp up/create/update --basic-auth: allow user to enable and disable basic auth [App Service] az webapp up/create/update --basic-auth`: allow user to enable and disable basic auth Jan 23, 2024
@shnjefff shnjefff changed the title [App Service] az webapp up/create/update --basic-auth`: allow user to enable and disable basic auth [App Service] az webapp up/create/update --basic-auth: allow user to enable and disable basic auth Jan 23, 2024
@shnjefff shnjefff changed the title [App Service] az webapp up/create/update --basic-auth: allow user to enable and disable basic auth [App Service] az webapp up/create/update --basic-auth: Allow user to enable and disable basic auth Jan 23, 2024
@shnjefff shnjefff changed the title [App Service] az webapp up/create/update --basic-auth: Allow user to enable and disable basic auth [App Service] az webapp up/create/update --basic-auth`: Allow user to enable and disable basic auth Jan 23, 2024
@shnjefff shnjefff changed the title [App Service] az webapp up/create/update --basic-auth`: Allow user to enable and disable basic auth [App Service] az webapp up/create/update --basic-auth``: Allow user to enable and disable basic auth Jan 23, 2024
@zhoxing-ms zhoxing-ms changed the title [App Service] az webapp up/create/update --basic-auth``: Allow user to enable and disable basic auth [App Service] az webapp up/create/update: Add new parameter --basic-auth to allow users to enable and disable basic auth Jan 24, 2024
@zhoxing-ms
Copy link
Contributor

Please add some scenario tests for this new feature

@@ -160,6 +160,7 @@ def load_arguments(self, _):
c.argument('subnet', help="Name or resource ID of the pre-existing subnet to have the webapp join. The --vnet is argument also needed if specifying subnet by name.")
c.argument('public_network_access', help="Enable or disable public access to the web app", arg_type=get_enum_type(PUBLIC_NETWORK_ACCESS_MODES))
c.argument('acr_use_identity', action='store_true', help="Enable or disable pull image from acr use managed identity")
c.argument('basic_auth', type=str, help='Enable or disable basic auth.')
Copy link
Contributor

@zhoxing-ms zhoxing-ms Feb 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refer to public_network_access parameter and define it as arg_type=get_enum_type()

@zhoxing-ms zhoxing-ms merged commit 3b43198 into Azure:dev Feb 18, 2024
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Web Apps az webapp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants