-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Conversation
️✔️AzureCLI-FullTest
|
Hi @shnjefff, |
|
rule | cmd_name | rule_message | suggest_message |
---|---|---|---|
webapp create | cmd webapp create added parameter basic_auth |
||
webapp up | cmd webapp up added parameter basic_auth |
||
webapp update | cmd webapp update added parameter basic_auth |
App Service |
az webapp up/create/update --basic-auth
: allow user to enable and disable basic auth
@@ -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.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.') |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
az webapp up/create/update --basic-auth
: allow user to enable and disable basic authaz webapp up/create/update
--basic-auth`: allow user to enable and disable basic auth
az webapp up/create/update
--basic-auth`: allow user to enable and disable basic authaz webapp up/create/update
--basic-auth
: allow user to enable and disable basic auth
az webapp up/create/update
--basic-auth
: allow user to enable and disable basic authaz webapp up/create/update
--basic-auth
: Allow user to enable and disable basic auth
az webapp up/create/update
--basic-auth
: Allow user to enable and disable basic authaz webapp up/create/update
--basic-auth`: Allow user to enable and disable basic auth
az webapp up/create/update
--basic-auth`: Allow user to enable and disable basic authaz webapp up/create/update
--basic-auth``: Allow user to enable and disable basic auth
az webapp up/create/update
--basic-auth``: Allow user to enable and disable basic authaz webapp up/create/update
: Add new parameter --basic-auth
to allow users to enable and disable basic auth
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.') |
There was a problem hiding this comment.
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()
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
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 featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.