-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[RDBMS] az postgres flexible-server create: Bug fix, generating password when password auth is disabled. Support adding admin during create if Microsoft Entra is enabled.
#30999
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
Conversation
Add to ignore
This reverts commit ee1192c.
️✔️AzureCLI-FullTest
|
❌AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py
Outdated
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py
Outdated
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py
Outdated
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py
Outdated
Show resolved
Hide resolved
|
@evelyn-ys please retrigger checks |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Please sync with upstream/dev branch, there're acs and storage code changes on PR review |
Thank you for catching that. Sync has been merged and title fixed. Please retrigger. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
…sword when password auth is disabled. Support adding admin during create if Microsoft Entra is enabled. (Azure#30999) * add to ignore * Fix bug when updating cmk geo * Revert "add to ignore" This reverts commit ee1192c. * Updates to not create password if pasword is disabled * Add admin during create * Update text * fixes * fix * PR comments * PR comments * lint fix * Revert "Updates to not create password if pasword is disabled" This reverts commit 3b1d20b. * PR comments * add to ignore * Revert "add to ignore" This reverts commit ee1192c. * Updates to not create password if pasword is disabled * Add admin during create * Update text * fixes * fix * PR comments * PR comments * lint fix * Revert "Updates to not create password if pasword is disabled" This reverts commit 3b1d20b. * PR comments * Lint fixes * merge fix
| db_name = POSTGRES_DB_NAME | ||
|
|
||
| user = server_result.administrator_login | ||
| user = server_result.administrator_login if is_password_auth_enabled else '<user>' |
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.
This lines causes CredScan to fail:
##[error]1. Credential Scanner Error CSCAN-GENERAL0030 - File: src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py:src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py. Line: 193. Column 3.
Signature: 4437f095d08224d8fa3ba459bdf3c04eda1552b093c54217622502e91385ca39
Tool: Credential Scanner: Rule: CSCAN-GENERAL0030 (User Login Credentials). https://aka.ms/credscan
A potential secret was detected in 'flexible_server_custom_postgres.py':(CSCAN-GENERAL0030 User Login Credentials) Validate file contains secrets, remove, roll credential, and use approved store. For additional information on secret remediation see https://aka.ms/credscan.
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.
How would you suggest we update this line to avoid error in future?
Related command
az postgres flexible-server createDescription
Fix when during flexible-server create makes a password when --password-auth Disabled.
Update text that reference active directory auth and change to Microsoft Entra
Add ability to add admin during create if Microsoft Entra is enabled
Testing Guide
az postgres flexible-server create -h
az postgres flexible-server create -g testGroup -n test-default --location location
az postgres flexible-server create -g testGroup -n test-msentra --location location --create-default-database Disabled --active-directory-auth Enabled
az postgres flexible-server create -g testGroup -n test-msentra-only --location location --create-default-database Disabled --active-directory-auth Enabled --password-auth Disabled
az postgres flexible-server create -g testGroup -n test-msentra-admin --location location --create-default-database Disabled --active-directory-auth Enabled --password-auth Disabled --admin-object-id 00000000-0000-0000-0000-000000000000 --admin-display-name [email protected] --admin-type User
az postgres flexible-server create -g testGroup -n test-msentra-password-admin --location location --create-default-database Disabled --active-directory-auth Enabled --admin-object-id 00000000-0000-0000-0000-000000000000 --admin-display-name [email protected] --admin-type User
az postgres flexible-server create -g testGroup -n nasc-test --location location --create-default-database Disabled --admin-object-id 00000000-0000-0000-0000-000000000000 --admin-display-name [email protected] --admin-type User
To provide values for --admin-object-id, --admin-display-name, and --admin-type please set --active-directory-auth to "Enabled".az postgres flexible-server create -g testGroup -n nasc-test7 --location location --create-default-database Disabled --active-directory-auth Enabled --admin-object-id 00000000-0000-0000-0000-000000000000 --admin-display-name [email protected]
To add Microsoft Entra admin, please provide values for --admin-object-id, --admin-display-name, and --admin-type.History Notes
[RDBMS]
az postgres flexible-server create: Support adding admin during creation if--active-directory-authis Enabled and no longer generate password when--password-authis DisabledThis 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.