Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ee1192c
add to ignore
nasc17 Feb 24, 2025
d9d34d4
Merge pull request #5 from nasc17/nasc/gitUpdates
nasc17 Feb 24, 2025
6c0e048
Merge branch 'Azure:dev' into dev2
nasc17 Mar 4, 2025
6370088
Fix bug when updating cmk geo
nasc17 Mar 4, 2025
7f19801
Revert "add to ignore"
nasc17 Mar 4, 2025
4857a1a
Merge branch 'Azure:dev' into dev2
nasc17 Mar 7, 2025
50e8d48
Merge branch 'dev2' of https://github.com/nasc17/azure-cli into dev2
nasc17 Mar 7, 2025
3b1d20b
Updates to not create password if pasword is disabled
nasc17 Mar 10, 2025
8737f01
Add admin during create
nasc17 Mar 10, 2025
201906e
Update text
nasc17 Mar 10, 2025
c087a40
fixes
nasc17 Mar 10, 2025
e3ceab8
fix
nasc17 Mar 10, 2025
2c6ad36
PR comments
nasc17 Mar 11, 2025
f814f53
PR comments
nasc17 Mar 11, 2025
04aa6a0
lint fix
nasc17 Mar 11, 2025
c0c36b5
Revert "Updates to not create password if pasword is disabled"
nasc17 Mar 11, 2025
2e0117c
Merge branch 'Azure:dev' into dev2
nasc17 Mar 11, 2025
e6dbe6a
Merge branch 'Azure:dev' into dev2
nasc17 Mar 11, 2025
5b94a52
Merge remote-tracking branch 'origin/dev2' into nasc/aadUpdates3925
nasc17 Mar 11, 2025
b54254b
Merge branch 'Azure:dev' into dev2
nasc17 Mar 19, 2025
db35f9e
Merge remote-tracking branch 'origin/dev2' into nasc/aadUpdates3925
nasc17 Mar 19, 2025
37b4c33
PR comments
nasc17 Mar 20, 2025
530cc84
add to ignore
nasc17 Feb 24, 2025
05d3f9b
Revert "add to ignore"
nasc17 Mar 4, 2025
f00cdf6
Updates to not create password if pasword is disabled
nasc17 Mar 10, 2025
41a45ba
Add admin during create
nasc17 Mar 10, 2025
7dfe734
Update text
nasc17 Mar 10, 2025
786e983
fixes
nasc17 Mar 10, 2025
dd9c0a7
fix
nasc17 Mar 10, 2025
e3e09e6
PR comments
nasc17 Mar 11, 2025
d59db5f
PR comments
nasc17 Mar 11, 2025
656297b
lint fix
nasc17 Mar 11, 2025
5665c6b
Revert "Updates to not create password if pasword is disabled"
nasc17 Mar 11, 2025
cc57147
PR comments
nasc17 Mar 20, 2025
d6035a8
Lint fixes
nasc17 Mar 20, 2025
8ea0516
merge fix
nasc17 Mar 20, 2025
d9fbc29
Merge branch 'nasc/aadUpdates3925' of https://github.com/nasc17/azure…
nasc17 Mar 20, 2025
b75b4e4
Merge remote-tracking branch 'upstream/dev' into nasc/aadUpdates3925
nasc17 Mar 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions src/azure-cli/azure/cli/command_modules/rdbms/_helptext_pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,20 @@
az postgres flexible-server create -g testGroup -n testServer --location testLocation \\
--key $keyIdentifier --identity testIdentity
- name: >
Create a PostgreSQL flexible server with active directory auth as well as password auth.
Create a PostgreSQL flexible server with Microsoft Entra auth as well as password auth.
text: >
# create flexible server with aad auth and password auth enabled

az postgres flexible-server create -g testGroup -n testServer --location testLocation \\
--active-directory-auth Enabled
- name: >
Create a PostgreSQL flexible server with active directory auth only.
Create a PostgreSQL flexible server with Microsoft Entra auth only and primary administrator specified.
text: >
# create flexible server with aad only auth and password auth disabled
# create flexible server with aad only auth and password auth disabled with primary administrator specified

az postgres flexible-server create -g testGroup -n testServer --location testLocation \\
--active-directory-auth Enabled --password-auth Disabled
--active-directory-auth Enabled --password-auth Disabled \\
--admin-object-id 00000000-0000-0000-0000-000000000000 --admin-display-name [email protected] --admin-type User
- name: >
Create a PostgreSQL flexible server with public access, geo-redundant backup enabled and add the range of IP address to have access to this server.
The --public-access parameter can be 'All', 'None', <startIpAddress>, or <startIpAddress>-<endIpAddress>
Expand Down Expand Up @@ -256,7 +257,7 @@
text: az postgres flexible-server update --resource-group testGroup --name testserver --tags "k1=v1" "k2=v2"
- name: Reset password
text: az postgres flexible-server update --resource-group testGroup --name testserver -p password123
- name: Update a flexible server to enable active directory auth for password auth enabled server
- name: Update a flexible server to enable Microsoft Entra auth for password auth enabled server
text: az postgres flexible-server update --resource-group testGroup --name testserver --active-directory-auth Enabled
- name: Change key/identity for data encryption. Data encryption cannot be enabled post server creation, this will only update the key/identity.
text: >
Expand Down Expand Up @@ -959,48 +960,48 @@

helps['postgres flexible-server ad-admin'] = """
type: group
short-summary: Manage server Active Directory administrators.
short-summary: Manage server Microsoft Entra administrators.
"""

helps['postgres flexible-server ad-admin create'] = """
type: command
short-summary: Create an Active Directory administrator.
short-summary: Create a Microsoft Entra administrator.
examples:
- name: Create Active Directory administrator with user '[email protected]', administrator ID '00000000-0000-0000-0000-000000000000' and type User.
- name: Create Microsoft Entra administrator with user '[email protected]', administrator ID '00000000-0000-0000-0000-000000000000' and type User.
text: az postgres flexible-server ad-admin create -g testgroup -s testsvr -u [email protected] -i 00000000-0000-0000-0000-000000000000 -t User
"""

helps['postgres flexible-server ad-admin delete'] = """
type: command
short-summary: Delete an Active Directory administrator.
short-summary: Delete a Microsoft Entra administrator.
examples:
- name: Delete Active Directory administrator with ID '00000000-0000-0000-0000-000000000000'.
- name: Delete Microsoft Entra administrator with ID '00000000-0000-0000-0000-000000000000'.
text: az postgres flexible-server ad-admin delete -g testgroup -s testsvr -i 00000000-0000-0000-0000-000000000000
"""

helps['postgres flexible-server ad-admin list'] = """
type: command
short-summary: List all Active Directory administrators.
short-summary: List all Microsoft Entra administrators.
examples:
- name: List Active Directory administrators.
- name: List Microsoft Entra administrators.
text: az postgres flexible-server ad-admin list -g testgroup -s testsvr
"""

helps['postgres flexible-server ad-admin show'] = """
type: command
short-summary: Get an Active Directory administrator.
short-summary: Get a Microsoft Entra administrator.
examples:
- name: Get Active Directory administrator with ID '00000000-0000-0000-0000-000000000000'.
- name: Get Microsoft Entra administrator with ID '00000000-0000-0000-0000-000000000000'.
text: az postgres flexible-server ad-admin show -g testgroup -s testsvr -i 00000000-0000-0000-0000-000000000000
"""

helps['postgres flexible-server ad-admin wait'] = """
type: command
short-summary: Wait for an Active Directory administrator to satisfy certain conditions.
short-summary: Wait for a Microsoft Entra administrator to satisfy certain conditions.
examples:
- name: Wait until an Active Directory administrator exists.
- name: Wait until a Microsoft Entra administrator exists.
text: az postgres flexible-server ad-admin wait -g testgroup -s testsvr -i 00000000-0000-0000-0000-000000000000 --exists
- name: Wait for an Active Directory administrator to be deleted.
- name: Wait for a Microsoft Entra administrator to be deleted.
text: az postgres flexible-server ad-admin wait -g testgroup -s testsvr -i 00000000-0000-0000-0000-000000000000 --deleted
"""

Expand Down
22 changes: 13 additions & 9 deletions src/azure-cli/azure/cli/command_modules/rdbms/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _complex_params(command_group): # pylint: disable=too-many-statements
c.argument('auto_grow', arg_type=get_enum_type(['Enabled', 'Disabled']), options_list=['--auto-grow'], help='Enable or disable autogrow of the storage. Default value is Enabled.')
c.argument('auto_scale_iops', arg_type=get_enum_type(['Enabled', 'Disabled']), options_list=['--auto-scale-iops'], help='Enable or disable autoscale of iops. Default value is Disabled.')
c.argument('infrastructure_encryption', arg_type=get_enum_type(['Enabled', 'Disabled']), options_list=['--infrastructure-encryption', '-i'], help='Add an optional second layer of encryption for data using new encryption algorithm. Default value is Disabled.')
c.argument('assign_identity', options_list=['--assign-identity'], help='Generate and assign an Azure Active Directory Identity for this server for use with key management services like Azure KeyVault.')
c.argument('assign_identity', options_list=['--assign-identity'], help='Generate and assign an Microsoft Entra Identity for this server for use with key management services like Azure KeyVault.')
c.argument('tags', tags_type)

if command_group == 'mariadb':
Expand All @@ -90,7 +90,7 @@ def _complex_params(command_group): # pylint: disable=too-many-statements
c.argument('auto_grow', arg_type=get_enum_type(['Enabled', 'Disabled']), options_list=['--auto-grow'], help='Enable or disable autogrow of the storage. Default value is Enabled.')
c.argument('auto_scale_iops', arg_type=get_enum_type(['Enabled', 'Disabled']), options_list=['--auto-scale-iops'], help='Enable or disable autogrow of the storage. Default value is Disabled.')
c.argument('infrastructure_encryption', arg_type=get_enum_type(['Enabled', 'Disabled']), options_list=['--infrastructure-encryption', '-i'], help='Add an optional second layer of encryption for data using new encryption algorithm. Default value is Disabled.')
c.argument('assign_identity', options_list=['--assign-identity'], help='Generate and assign an Azure Active Directory Identity for this server for use with key management services like Azure KeyVault.')
c.argument('assign_identity', options_list=['--assign-identity'], help='Generate and assign an Microsoft Entra Identity for this server for use with key management services like Azure KeyVault.')

c.argument('location', arg_type=get_location_type(self.cli_ctx))
if command_group == 'postgres':
Expand All @@ -102,7 +102,7 @@ def _complex_params(command_group): # pylint: disable=too-many-statements
with self.argument_context('{} server update'.format(command_group)) as c:
c.ignore('family', 'capacity', 'tier')
c.argument('sku_name', options_list=['--sku-name'], help='The name of the sku. Follows the convention {pricing tier}_{compute generation}_{vCores} in shorthand. Examples: B_Gen5_1, GP_Gen5_4, MO_Gen5_16.')
c.argument('assign_identity', options_list=['--assign-identity'], help='Generate and assign an Azure Active Directory Identity for this server for use with key management services like Azure KeyVault.')
c.argument('assign_identity', options_list=['--assign-identity'], help='Generate and assign an Microsoft Entra Identity for this server for use with key management services like Azure KeyVault.')

with self.argument_context('{} server restore'. format(command_group)) as c:
c.argument('server_name', options_list=['--name', '-n'], arg_type=overriding_none_arg_type)
Expand Down Expand Up @@ -211,8 +211,8 @@ def _complex_params(command_group): # pylint: disable=too-many-statements

with self.argument_context('{} server ad-admin'.format(command_group)) as c:
c.argument('server_name', options_list=['--server-name', '-s'])
c.argument('login', options_list=['--display-name', '-u'], help='Display name of the Azure AD administrator user or group.')
c.argument('sid', options_list=['--object-id', '-i'], help='The unique ID of the Azure AD administrator.')
c.argument('login', options_list=['--display-name', '-u'], help='Display name of the Microsoft Entra administrator user or group.')
c.argument('sid', options_list=['--object-id', '-i'], help='The unique ID of the Microsoft Entra administrator.')

if command_group == 'mysql':
with self.argument_context('{} server upgrade'.format(command_group)) as c:
Expand Down Expand Up @@ -529,7 +529,7 @@ def _flexible_server_params(command_group):
active_directory_auth_arg_type = CLIArgumentType(
options_list=['--active-directory-auth'],
arg_type=get_enum_type(['Enabled', 'Disabled']),
help='Whether Azure Active Directory authentication is enabled.'
help='Whether Microsoft Entra authentication is enabled.'
)

password_auth_arg_type = CLIArgumentType(
Expand Down Expand Up @@ -594,6 +594,10 @@ def _flexible_server_params(command_group):
c.argument('version', default='16', arg_type=version_arg_type)
c.argument('backup_retention', default=7, arg_type=pg_backup_retention_arg_type)
c.argument('active_directory_auth', default='Disabled', arg_type=active_directory_auth_arg_type)
c.argument('admin_id', options_list=['--admin-object-id', '-i'], help='The unique ID of the Microsoft Entra administrator.')
c.argument('admin_name', options_list=['--admin-display-name', '-m'], help='Display name of the Microsoft Entra administrator user or group.')
c.argument('admin_type', options_list=['--admin-type', '-t'],
arg_type=get_enum_type(['User', 'Group', 'ServicePrincipal', 'Unknown']), help='Type of the Microsoft Entra administrator.')
c.argument('password_auth', default='Enabled', arg_type=password_auth_arg_type)
c.argument('auto_grow', default='Disabled', arg_type=auto_grow_arg_type)
c.argument('storage_type', default=None, arg_type=storage_type_arg_type)
Expand Down Expand Up @@ -977,11 +981,11 @@ def _flexible_server_params(command_group):

for scope in ['create', 'show', 'delete', 'wait']:
with self.argument_context('{} flexible-server ad-admin {}'.format(command_group, scope)) as c:
c.argument('sid', options_list=['--object-id', '-i'], help='The unique ID of the Azure AD administrator.')
c.argument('sid', options_list=['--object-id', '-i'], help='The unique ID of the Microsoft Entra administrator.')

with self.argument_context('{} flexible-server ad-admin create'.format(command_group)) as c:
c.argument('login', options_list=['--display-name', '-u'], help='Display name of the Azure AD administrator user or group.')
c.argument('principal_type', options_list=['--type', '-t'], default='User', arg_type=get_enum_type(['User', 'Group', 'ServicePrincipal', 'Unknown']), help='Type of the Azure AD administrator.')
c.argument('login', options_list=['--display-name', '-u'], help='Display name of the Microsoft Entra administrator user or group.')
c.argument('principal_type', options_list=['--type', '-t'], default='User', arg_type=get_enum_type(['User', 'Group', 'ServicePrincipal', 'Unknown']), help='Type of the Microsoft Entra administrator.')
c.argument('identity', help='Name or ID of identity used for AAD Authentication.', validator=validate_identity)

# server advanced threat protection settings
Expand Down
Loading