@@ -57,7 +57,7 @@ def flexible_server_create(cmd, client,
5757 resource_group_name = None , server_name = None ,
5858 location = None , backup_retention = None ,
5959 sku_name = None , tier = None ,
60- storage_gb = None , version = None , active_directory_auth = None ,
60+ storage_gb = None , version = None , active_directory_auth = None , microsoft_entra_auth = None ,
6161 admin_name = None , admin_id = None , admin_type = None ,
6262 password_auth = None , administrator_login = None , administrator_login_password = None ,
6363 tags = None , database_name = None ,
@@ -105,7 +105,7 @@ def flexible_server_create(cmd, client,
105105 backup_byok_key = backup_byok_key ,
106106 performance_tier = performance_tier ,
107107 create_cluster = create_cluster ,
108- password_auth = password_auth , active_directory_auth = active_directory_auth ,
108+ password_auth = password_auth , active_directory_auth = active_directory_auth , microsoft_entra_auth = microsoft_entra_auth ,
109109 admin_name = admin_name , admin_id = admin_id , admin_type = admin_type ,)
110110
111111 cluster = None
@@ -139,7 +139,8 @@ def flexible_server_create(cmd, client,
139139 standby_availability_zone = standby_availability_zone )
140140
141141 is_password_auth_enabled = bool (password_auth is not None and password_auth .lower () == 'enabled' )
142- is_microsoft_entra_auth_enabled = bool (active_directory_auth is not None and active_directory_auth .lower () == 'enabled' )
142+ is_microsoft_entra_auth_enabled = bool (active_directory_auth is not None and active_directory_auth .lower () == 'enabled' ) or \
143+ bool (microsoft_entra_auth is not None and microsoft_entra_auth .lower () == 'enabled' )
143144 if is_password_auth_enabled :
144145 administrator_login_password = generate_password (administrator_login_password )
145146
@@ -149,7 +150,7 @@ def flexible_server_create(cmd, client,
149150 backup_byok_identity = backup_byok_identity ,
150151 backup_byok_key = backup_byok_key )
151152
152- auth_config = postgresql_flexibleservers .models .AuthConfig (active_directory_auth = active_directory_auth ,
153+ auth_config = postgresql_flexibleservers .models .AuthConfig (active_directory_auth = 'Enabled' if is_microsoft_entra_auth_enabled else 'Disabled' ,
153154 password_auth = password_auth )
154155
155156 # Create postgresql
@@ -309,7 +310,7 @@ def flexible_server_update_custom_func(cmd, client, instance,
309310 maintenance_window = None ,
310311 byok_identity = None , byok_key = None ,
311312 backup_byok_identity = None , backup_byok_key = None ,
312- active_directory_auth = None , password_auth = None ,
313+ active_directory_auth = None , microsoft_entra_auth = None , password_auth = None ,
313314 private_dns_zone_arguments = None ,
314315 public_access = None ,
315316 tags = None ,
@@ -423,8 +424,8 @@ def flexible_server_update_custom_func(cmd, client, instance,
423424
424425 auth_config = instance .auth_config
425426 administrator_login = instance .administrator_login if instance .administrator_login else None
426- if active_directory_auth :
427- auth_config .active_directory_auth = active_directory_auth
427+ if active_directory_auth or microsoft_entra_auth :
428+ auth_config .active_directory_auth = active_directory_auth if active_directory_auth else microsoft_entra_auth
428429 if password_auth :
429430 administrator_login , administrator_login_password = _update_login (server_name , resource_group_name , auth_config ,
430431 password_auth , administrator_login , administrator_login_password )
0 commit comments