@@ -853,10 +853,44 @@ def test_functionapp_flex_zone_redundant_not_active(self, resource_group, storag
853853 .format (resource_group , functionapp_name , FLEX_ASP_LOCATION_FUNCTIONAPP , storage_account )).get_output_in_json ()
854854
855855 server_farm_id = functionapp ['properties' ]['serverFarmId' ]
856- function_plan = self .cmd ('az functionapp plan show --ids {}'
856+ function_plan = self .cmd ('functionapp plan show --ids {}'
857857 .format (server_farm_id )).get_output_in_json ()
858858 self .assertTrue (function_plan ['zoneRedundant' ] == False )
859859
860+ @ResourceGroupPreparer (location = FLEX_ASP_LOCATION_FUNCTIONAPP )
861+ @StorageAccountPreparer ()
862+ def test_functionapp_flex_plan_enable_zone_redundant (self , resource_group , storage_account ):
863+ functionapp_name = self .create_random_name (
864+ 'functionapp' , 40 )
865+
866+ functionapp = self .cmd ('functionapp create -g {} -n {} -f {} -s {} --runtime python --runtime-version 3.11'
867+ .format (resource_group , functionapp_name , FLEX_ASP_LOCATION_FUNCTIONAPP , storage_account )).get_output_in_json ()
868+
869+ server_farm_id = functionapp ['properties' ]['serverFarmId' ]
870+ function_plan = self .cmd ('functionapp plan show --ids {}' .format (server_farm_id )).get_output_in_json ()
871+ self .assertTrue (function_plan ['zoneRedundant' ] == False )
872+ updated_plan = self .cmd ('functionapp plan update --id {} --set zoneRedundant=true' .format (server_farm_id )).get_output_in_json ()
873+ self .assertTrue (updated_plan ['zoneRedundant' ] == True )
874+ function_plan = self .cmd ('functionapp plan show --ids {}' .format (server_farm_id )).get_output_in_json ()
875+ self .assertTrue (function_plan ['zoneRedundant' ] == True )
876+
877+ @ResourceGroupPreparer (location = FLEX_ASP_LOCATION_FUNCTIONAPP )
878+ @StorageAccountPreparer ()
879+ def test_functionapp_flex_plan_disable_zone_redundant (self , resource_group , storage_account ):
880+ functionapp_name = self .create_random_name (
881+ 'functionapp' , 40 )
882+
883+ functionapp = self .cmd ('functionapp create -g {} -n {} -f {} -s {} --runtime python --runtime-version 3.11 --zone-redundant'
884+ .format (resource_group , functionapp_name , FLEX_ASP_LOCATION_FUNCTIONAPP , storage_account )).get_output_in_json ()
885+
886+ server_farm_id = functionapp ['properties' ]['serverFarmId' ]
887+ function_plan = self .cmd ('functionapp plan show --ids {}' .format (server_farm_id )).get_output_in_json ()
888+ self .assertTrue (function_plan ['zoneRedundant' ] == True )
889+ updated_plan = self .cmd ('functionapp plan update --id {} --set zoneRedundant=false' .format (server_farm_id )).get_output_in_json ()
890+ self .assertTrue (updated_plan ['zoneRedundant' ] == False )
891+ function_plan = self .cmd ('functionapp plan show --ids {}' .format (server_farm_id )).get_output_in_json ()
892+ self .assertTrue (function_plan ['zoneRedundant' ] == False )
893+
860894 @ResourceGroupPreparer (location = FLEX_ASP_LOCATION_FUNCTIONAPP )
861895 @StorageAccountPreparer ()
862896 def test_functionapp_flex_scale_config (self , resource_group , storage_account ):
0 commit comments