Index: /branches/rel_apv_10_7_3/usr/click/bin/backend/sys_cmd.c
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/bin/backend/sys_cmd.c	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/bin/backend/sys_cmd.c	(working copy)
@@ -3252,7 +3252,7 @@
     char cmd[1024];
     int status;
 
-    snprintf(cmd, 1024, "python3 /ca/bin/azure/AZFailoverPoller.py -mode 2");
+    snprintf(cmd, 1024, "python3 /ca/bin/azure/UDRPoller.py -mode 2");
     status = system(cmd);
 }
 
@@ -3809,6 +3809,56 @@
     pclose(fp);
 }
 
+char *
+write_az_ha_config(char *segment)
+{
+	char config[1024];
+	char *result_config;
+	FILE *fp;
+	char process_stdout[1035];
+	char cmd[1024];
+	int offset = 0;
+	snprintf(cmd, sizeof(cmd), "python3 /ca/bin/azure/AZFailoverPoller.py -mode 3");
+	fp = popen(cmd, "r");
+	if (fp == NULL) {
+        printf("Failed to run command\n" );
+        exit(1);
+    }
+    while (fgets(process_stdout, sizeof(process_stdout)-1, fp) != NULL) {
+        process_stdout[strcspn(process_stdout, "\n")] = 0;
+        // Check if the output is "True"
+        if (strcmp(process_stdout, "True") == 0) {
+            offset += snprintf(config + offset, 1024 - offset, "cloud az ha enable\n");
+        } else if (strcmp(process_stdout, "False") == 0) {
+			offset += snprintf(config + offset, 1024 - offset, "cloud az ha disable\n");
+        } else {
+			exit(1);
+		}
+    }
+	fclose(fp);
+	snprintf(cmd, sizeof(cmd), "python3 /ca/bin/azure/UDRPoller.py -mode 3");
+	fp = popen(cmd, "r");
+	if (fp == NULL) {
+        printf("Failed to run command\n" );
+        exit(1);
+    }
+    while (fgets(process_stdout, sizeof(process_stdout)-1, fp) != NULL) {
+        process_stdout[strcspn(process_stdout, "\n")] = 0;
+        // Check if the output is "True"
+        if (strcmp(process_stdout, "True") == 0) {
+            offset += snprintf(config + offset, 1024 - offset, "cloud az udr enable\n");
+        } else if (strcmp(process_stdout, "False") == 0) {
+			offset += snprintf(config + offset, 1024 - offset, "cloud az udr disable\n");
+        } else {
+			exit(1);
+		}
+    }
+	fclose(fp);
+	int len = strlen(config) + 1;
+	result_config = malloc(len);
+	snprintf(result_config, len, "%s", config);
+	return result_config;
+}
 // AZURE CLOUD FUNCTION END
 
 // AWS CLOUD FUNCTION START
Index: /branches/rel_apv_10_7_3/usr/click/bin/backend/sys_tool.c
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/bin/backend/sys_tool.c	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/bin/backend/sys_tool.c	(working copy)
@@ -1218,6 +1218,13 @@
 	},
 	/* TWSD-59 , end */
 
+	/* TWSD-53 , start */
+	{
+		write_az_ha_config,
+		CMD_NORMAL|CMD_ARRAYOS|CMD_SPROXY|CMD_GLOBAL,
+		"#az poller enable configuration"
+	},
+	/* TWSD-53 , end */
 	/*last entry is empty*/
     {
 	NULL,          
Index: /branches/rel_apv_10_7_3/usr/click/lib/libcaui/ca_ui.h
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/lib/libcaui/ca_ui.h	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/lib/libcaui/ca_ui.h	(working copy)
@@ -651,4 +651,7 @@
 /* aws tool configuration */
 extern char *write_aws_ha_config(char *segment);
 
+/* az tool configuration */
+extern char *write_az_ha_config(char *segment);
+
 #endif /* _CA_UI_H_ */
Index: /branches/rel_apv_10_7_3/usr/click/tools/aws/AWSFailoverPoller.py
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/tools/aws/AWSFailoverPoller.py	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/tools/aws/AWSFailoverPoller.py	(working copy)
@@ -71,16 +71,16 @@
 
     @classmethod
     def stop(cls) -> None:
-        '''kill poller that is another running process by its filename,
-        a.k.a. this file name.'''
+        """kill poller that is another running process by its filename,
+        a.k.a. this file name."""
         # get this module name (filename)
         module_name = os.path.basename(__file__)
         cls.kill_poller(module_name)
 
     @classmethod
     def kill_poller(cls, process_name) -> None:
-        '''This method will kill all the process with the same
-        name of process_name.'''
+        """This method will kill all the process with the same
+        name of process_name."""
         for proc in psutil.process_iter(['pid', 'cmdline']):
             if proc.info['cmdline']:
                 for peice_of_cmd in proc.info['cmdline']:
@@ -130,9 +130,15 @@
         choices=choices,
         help='Enter [enable], [disable], or [status] to control poller.'
     )
+
     args = parser.parse_args()
     if args.mode == "enable":
-        AWSFailoverPoller.start()
+        if not AWSFailoverPoller.is_poller_running(args.mode):
+            ProxyAWSLogger.info("start polling mode")
+            AWSFailoverPoller.start()
+        else:
+            ProxyAWSLogger.info(
+                "try to start polling mode, but poller has been running")
     elif args.mode == "disable":
         if AWSFailoverPoller.is_poller_running(args.mode):
             ProxyAWSLogger.info("stop polling mode")
Index: /branches/rel_apv_10_7_3/usr/click/tools/aws/apv_controller/APVController.py
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/tools/aws/apv_controller/APVController.py	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/tools/aws/apv_controller/APVController.py	(working copy)
@@ -58,7 +58,7 @@
 
         name_list = re.findall(pattern, context)
         if not name_list:
-            error_msg = "Error: cannot find APV name in "+context
+            error_msg = "Error: cannot find APV name in " + context
             ProxyAWSLogger.debug(error_msg)
             raise Exception(error_msg)
         return name_list[0][0].strip()
Index: /branches/rel_apv_10_7_3/usr/click/tools/azure/AZFailoverPoller.py
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/tools/azure/AZFailoverPoller.py	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/tools/azure/AZFailoverPoller.py	(working copy)
@@ -1,11 +1,9 @@
-
-import json
 import os
 import argparse
 from datetime import datetime
 import time
+
 import psutil
-import os
 
 from apv_controller.APVController import APVController
 from AZFailoverManager import AZFailoverManager
@@ -16,6 +14,7 @@
 class AZFailoverPoller():
     def __init__(self) -> None:
         pass
+
     def start(self, ip_config_setting_json):
         in_failover = False
         polling_period = 1 #seconds
@@ -61,7 +60,7 @@
                 in_failover = False
 
     def kill_poller(self, process_name):
-        '''This method will kill all the process with the same name of process_name.'''
+        """This method will kill all the process with the same name of process_name."""
         for proc in psutil.process_iter(['pid', 'cmdline']):
             if proc.info['cmdline']:
                 for peice_of_cmd in proc.info['cmdline']:
@@ -70,11 +69,11 @@
                         ProxyAZLogger.info("kill process_name")
 
     def stop(self):
-        '''kill poller that is another running process by its filename, a.k.a. this file name.'''
+        """kill poller that is another running process by its filename, a.k.a. this file name."""
         # get this module name (filename)
         module_name = os.path.basename(__file__)
         self.kill_poller(module_name)
-    
+
     def print_current_time(self, interval):
         pid = os.getpid()
         try:
@@ -84,11 +83,15 @@
                 time.sleep(interval)
         except KeyboardInterrupt:
             ProxyAZLogger.error("\nProcess interrupted. Exiting...")
+
     def is_poller_running(self, this_mode)->bool:
-        '''This method is used to determine if the poller is running or not.
-        return True if it is running
-        return False if it isn't running
-        '''
+        """
+        Checks if the poller is currently running.
+        Args:
+            this_mode (str): The current mode passed to the function to determine if polling is active.
+        Returns:
+            bool: Returns True if the poller is running, False otherwise.
+        """
         module_name = os.path.basename(__file__)
         for proc in psutil.process_iter(['pid', 'cmdline']):
             # print(module_name, proc.info, os.getpid())
@@ -100,8 +103,16 @@
 
 
 if __name__=='__main__':
-    parser = argparse.ArgumentParser(description='''This API is used to start polling, stop polling, and check the status of poller for IPs transfering''')
-    parser.add_argument('-mode', type=str, choices=["1", "2", "3"], help='Enter 1 or 2: mode 1: start polling; mode 2: stop polling; mode3: check poller status')
+    parser = argparse.ArgumentParser(
+        description='This API is used to start polling, stop polling, '
+        'and check the status of poller for IPs transfering'
+        )
+    parser.add_argument(
+        '-mode',
+        type=str,
+        choices=["1", "2", "3"],
+        help='Enter 1 or 2: mode 1: start polling; '
+        'mode 2: stop polling; mode3: check poller status')
     args = parser.parse_args()
     az_poller = AZFailoverPoller()
     config_dir = '/ca/conf/'
Index: /branches/rel_apv_10_7_3/usr/click/tools/azure/LoggerManager.py
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/tools/azure/LoggerManager.py	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/tools/azure/LoggerManager.py	(working copy)
@@ -1,5 +1,8 @@
 import argparse
+
 from logger.ProxyAZLogger import ProxyAZLogger
+
+
 class LoggerManager():
     def __init__():
         pass
Index: /branches/rel_apv_10_7_3/usr/click/tools/azure/UDRPoller.py
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/tools/azure/UDRPoller.py	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/tools/azure/UDRPoller.py	(working copy)
@@ -104,7 +104,7 @@
                 for peice_of_cmd in proc.info['cmdline']:
                     if process_name in peice_of_cmd and (not proc.info['pid']==os.getpid()) :
                         proc.kill()
-                        ProxyAZLogger.info("kill "+process_name)
+                        ProxyAZLogger.info("kill " + process_name)
 
     def is_poller_running(self, this_mode)->bool:
         '''This method is used to determine if the poller is running or not.
@@ -120,8 +120,16 @@
                         return True
         return False
 if __name__=='__main__':
-    parser = argparse.ArgumentParser(description='''This API is used to start polling, stop polling, and check the status of poller for UDR transfering''')
-    parser.add_argument('-mode', type=str, choices=['1', '2', '3'], help='Enter 1 or 2: mode 1 is for starting polling; mode 2 is for stopping polling; mode 3 is for checking poller status')
+    parser = argparse.ArgumentParser(
+        description='This API is used to start polling, stop polling, '
+        'and check the status of poller for UDR transfering'
+        )
+    parser.add_argument(
+        '-mode',
+        type=str,
+        choices=['1', '2', '3'],
+        help='Enter 1 or 2: mode 1 is for starting polling;'
+            ' mode 2 is for stopping polling; mode 3 is for checking poller status')
     args = parser.parse_args()
 
     config_dir = '/ca/conf/'
Index: /branches/rel_apv_10_7_3/usr/click/tools/azure/apv_controller/APVController.py
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/tools/azure/apv_controller/APVController.py	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/tools/azure/apv_controller/APVController.py	(working copy)
@@ -4,56 +4,8 @@
 from collections import deque
 
 from logger.ProxyAZLogger import ProxyAZLogger
+from apv_controller.APVCommander import APVCommander
 
-class APVCommander():
-    def __init__(self) -> None:
-        pass
-    def launch_apv_command(self, apv_command:str):
-        '''
-        /ca/bin/backend -c "show version"`echo -e "\\0374"`
-        template:
-        /ca/bin/backend -c "APV_COMMAND"`echo -e "\\0374"`
-        example:
-        /ca/bin/backend -c "show ha status domain"`echo -e "\\0374"`
-        /ca/bin/backend -c "show version"`echo -e "\\0374"`
-        '''
-        return self.exec_cli_show(apv_command)
-        # command = "/ca/bin/backend -c \"{}\"`echo -e \"\\0374\"`"
-        # command = ["/ca/bin/backend", "-c", f'\"{apv_command}\"`echo', '-e', '\"\\0374\"`']
-
-        # print("Execute command ", " ".join(command))
-        # # context = subprocess.run(command, capture_output=True, text=True).stdout
-        # result = subprocess.run(command,stdout=sys.stdout, stderr=sys.stderr)
-        # print('result', result)
-        # if result.returncode==0:
-        #     print("Succeefully run", apv_command)
-        #     print("result.stdout", result.stdout)
-        #     print("result.stderr", result.stderr)
-
-        # else:
-        #     print('fail to run ', apv_command)
-        #     print("result.stdout", result.stdout)
-        #     print("result.stderr", result.stderr)
-        # print("return context:\n", context)
-        # return context
-    def exec_cli_show(self, cmd):
-        '''this function is from the Tim'''
-        cmd = "/ca/bin/backend -c \"{}\"`echo -e \"\\0374\"`".format(cmd)
-        # cmd = "/ca/bin/backend -c \"show version\"`echo -e \"\\0374\"`"
-        try:
-            output = subprocess.check_output(cmd, shell=True).strip()
-            # print('output', type(output), output.decode('latin-1'))
-            result = output.decode('latin-1')
-            # for char in output:
-            #     try:
-            #         char.encode("utf-8")
-            #         result += char
-            #     except:
-            #         pass
-            # print("result", result)
-            return result[:-1]
-        except Exception as e:
-            print(e)
 
 class APVController():
     def __init__(self) -> None:
@@ -61,41 +13,52 @@
         peer_state_q_max_len = 3 #workaround
         self.peer_state_q:deque = deque(maxlen=peer_state_q_max_len)
 
-    def get_apv_version():
+    def get_apv_version() -> str:
         commander = APVCommander()
         res = commander.launch_apv_command("show version")
         return res
 
-    def get_apv_name(self)->str:
-        ''' get APV name in HA.
-        Algo:
-        step1. Use 'show ha status domain' Array CLI to get the context.
-        step2. The local unit is the name of this APV.
-        '''
+    def get_apv_name(self) -> str:
+        """
+        Retrieves the version of the APV.
+
+        Args:
+            None
+
+        Returns:
+            str: The version string of the APV.
+        """
         if hasattr(self, 'name'):
             return self.name
         commander = APVCommander()
         context = commander.launch_apv_command("show ha status domain")
-        pattern ='Local[\s]+unit:[\s]+(.+)\s(UP|DOWN)\s*'
+        pattern = 'Local[\s]+unit:[\s]+(.+)\s(UP|DOWN|NETWORK_LOGIN)\s*'
         # print('=============================')
         # print("context", type(context), context)
         # print("pattern", type(pattern), pattern)
 
         name_list = re.findall(pattern, context)
         if not name_list:
-            error_msg = "Error: cannot find APV name in "+context
+            error_msg = "Error: cannot find APV name in " + context
+            ProxyAZLogger.error(error_msg)
             raise Exception(error_msg)
         return name_list[0][0].strip()
 
-    def is_primary(self)->bool:
-        '''Check if this APV is primary.
-        Algo:
-        The highiest proirity is primary. Check if this APV name is the same with the name of APV that is highiest priority.
-        step1. Use "show ha config" APV command.
-        step2. Parse it by regrex to get ha group prioirty
-        step3. Sort it by prioirty
-        step4. Check if this APV name is same with the name of APV that is highiest priority.
-        '''
+    def is_primary(self) -> bool:
+        """
+        Retrieves the APV's name in High Availability (HA) mode.
+
+        The method queries the system's HA status to extract the local APV's name.
+
+        Args:
+            None
+
+        Returns:
+            str: The APV name.
+
+        Raises:
+            Exception: If the APV name cannot be determined.
+        """
         self.name = self.get_apv_name()
         commander = APVCommander()
         context = commander.launch_apv_command("show ha config")
@@ -103,7 +66,7 @@
         group_priority_list = re.findall(pattern, context)
         if not group_priority_list:
             error_msg = "Error: cannot find APV group priority in " + context
-            ProxyAZLogger.erro(error_msg)
+            ProxyAZLogger.error(error_msg)
             exit(1)
 
         group_priority_list = [(item[0], int(item[1])) for item in group_priority_list] # make priority of string to integer
@@ -111,27 +74,34 @@
         sorted_group_priority_list = sorted(group_priority_list, key=lambda x: x[1]) #from low priority to heigh priority
 
         return self.name==sorted_group_priority_list[-1][0]
-    def is_primary_alive(self)->bool:
-        '''This function is to check if the primary APV is alive or not.
-        return True: primary APV is alive, do nothing
-        return False: Primary APV is not alive.
-        This must be called in secondary APV.
+
+    def is_primary_alive(self) -> bool:
+        """
+        Check if this APV is primary.
         Algo:
-        step1. Use APV CLI "show ha status domain to check if peer(primary APV) is UP or DOWN".
-        step2. if peer(primary APV) is "DOWN", it means primary is dead, aka not alive.
-        '''
+        The highiest proirity is primary. Check if this APV name is the same with the name of APV that is highiest priority.
+        step1. Use "show ha config" APV command.
+        step2. Parse it by regrex to get ha group prioirty
+        step3. Sort it by prioirty
+        step4. Check if this APV name is same with the name of APV that is highiest priority.
+
+        Args:
+            None
+
+        Returns:
+            bool: True if this APV is primary, False otherwise.
+
+        Raises:
+            Exception: If the APV's HA configuration cannot be retrieved or parsed.
+        """
         commander = APVCommander()
         context = commander.launch_apv_command("show ha status domain")
-        print(context)
-        pattern ='Peer[\s]+unit:[\s]+(.+)\s(UP|DOWN)\s*'
+        pattern = 'Peer[\s]+unit:[\s]+(.+)\s(UP|DOWN|NETWORK_LOGIN)\s*'
         peer_up_or_down_list = re.findall(pattern, context)
-        print(peer_up_or_down_list)
-
-        # print("peer_up_or_down_list", peer_up_or_down_list)
 
         if not peer_up_or_down_list:
             error_msg = "Error: cannot parse peer status in "+ context
-            ProxyAZLogger.erro(error_msg)
+            ProxyAZLogger.error(error_msg)
             exit(1)
 
         import sys
@@ -141,7 +111,6 @@
         # Redirect sys.stdout to the file
         sys.stdout = file
 
-
         timestamp = datetime.now().strftime('%Y-%m-%d %H:%M:%S')  # Current time formatted as YYYY-MM-DD HH:MM:SS
         print(f"[{timestamp}] {peer_up_or_down_list[0]}")
         sys.stdout = sys.__stdout__
@@ -160,7 +129,6 @@
         return True # the machine just booted, do nothing
 
 
-
 if __name__=='__main__':
     parser = argparse.ArgumentParser(description='Process optional name argument.')
     parser.add_argument('-c', type=str, help='Enter 1 or 2: mode 1: start polling; mode 2: stop polling')
Index: /branches/rel_apv_10_7_3/usr/click/tools/azure/az_auth/AZAuthController.py
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/tools/azure/az_auth/AZAuthController.py	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/tools/azure/az_auth/AZAuthController.py	(working copy)
@@ -1,9 +1,9 @@
 import subprocess
-import threading
 import sys
 import os
 import time
 import re
+
 from logger.AZLogger import AZLogger
 
 class AZAuthController():
Index: /branches/rel_apv_10_7_3/usr/click/tools/azure/az_nic/NICController.py
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/tools/azure/az_nic/NICController.py	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/tools/azure/az_nic/NICController.py	(working copy)
@@ -1,5 +1,6 @@
 import json
 import copy
+
 from azure.identity import DefaultAzureCredential
 from azure.mgmt.compute import ComputeManagementClient
 from azure.mgmt.network import NetworkManagementClient
Index: /branches/rel_apv_10_7_3/usr/click/tools/azure/az_route_table/RouteTableFailoverManager.py
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/tools/azure/az_route_table/RouteTableFailoverManager.py	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/tools/azure/az_route_table/RouteTableFailoverManager.py	(working copy)
@@ -1,4 +1,5 @@
 import json
+
 from az_route_table.RouteTableController import RouteTableController
 
 
@@ -105,12 +106,12 @@
         self.route_config['secondary']['routing_rules_list'] = secondary_routing_rules_list
         # save file
         with open(self.before_failover_route_config_filename, 'w') as file:
-            json.dump(self.route_config, file, indent=4)            
+            json.dump(self.route_config, file, indent=4)
+
 
 if __name__=="__main__":
     fm = RouteTableFailoverManager()
-    # fm.save_current_route('pimary_table', 'secondary_table') 
+    # fm.save_current_route('pimary_table', 'secondary_table')
     # fm.handle_failover_happen()
     fm.handle_failover_recover()
 
-    
\ No newline at end of file
Index: /branches/rel_apv_10_7_3/usr/click/tools/azure/az_vm/VMController.py
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/tools/azure/az_vm/VMController.py	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/tools/azure/az_vm/VMController.py	(working copy)
@@ -2,6 +2,7 @@
 from azure.identity import DefaultAzureCredential
 from azure.mgmt.compute import ComputeManagementClient
 
+
 class VMController():
     def __init__(self, subscription_id:str, resource_group_name:str) -> None:
         self.subscription_id = subscription_id
@@ -20,5 +21,4 @@
             print("Exception", e)
             print("power_state", power_state)
             return False
-            
-        
\ No newline at end of file
+ 
Index: /branches/rel_apv_10_7_3/usr/click/tools/azure/logger/ProxyAZLogger.py
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/tools/azure/logger/ProxyAZLogger.py	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/tools/azure/logger/ProxyAZLogger.py	(working copy)
@@ -1,21 +1,23 @@
-from logger.AZLogger import AbstractAZLogger
-from logger.AZLogger import AZLogger
 import os
 import json
 
+from logger.AZLogger import AbstractAZLogger
+from logger.AZLogger import AZLogger
+
+
 class ProxyAZLogger(AbstractAZLogger):
-    '''
+    """
     This class is designed using the proxy pattern, a structural design pattern.
     Becuase there is a requirement of dynamically changing the level of serverity, we use proxy to determine
     if configuration file is chaged or not in order to keep the AZLogger class pure.
-    '''
+    """
     config_modified_indicator_file = os.path.join(AZLogger.current_module_directory, 'config_modified.txt')
     with open(AZLogger.config_file_path, 'r') as config_file:
         config = json.load(config_file)
     is_logger_on = config["is_logger_on"]
     @classmethod
     def get_config(cls)->dict:
-        '''THe usage of this method refers to the set_config()'''
+        """THe usage of this method refers to the set_config()"""
         try:
             with open(AZLogger.config_file_path, 'r') as config_file:
                 config = json.load(config_file)
@@ -27,14 +29,14 @@
 
     @classmethod
     def set_config(cls, config:dict)->None:
-        '''The suggested method to modify configuration file is to use get_config() method
+        """The suggested method to modify configuration file is to use get_config() method
         to get the original configuration dictionary, modify the dictionary objecct, and invoke set_config() with
         arugment of modified dictionary object
         algo:
         1. take input to override the original config dictionary.
         2. write the file.
         3. set config file modified indictor
-        '''
+        """
         # AZLogger.info(f"setting new config: {config}")
         ori_config = cls.get_config()
         for key in ori_config.keys():
@@ -45,14 +47,14 @@
             pass
     @classmethod
     def is_config_modified(cls)->bool:
-        '''This method is used to check if the configuration file is modified or not.
+        """This method is used to check if the configuration file is modified or not.
         The alogrithem to do that is check if there is the modified file existed.
         If the file existed, the configuration file is modified; otherwise, the configuration is unchaged.
-        '''
+        """
         return os.path.exists(cls.config_modified_indicator_file)
     @classmethod
     def _refresh_config(cls)->None:
-        '''If the config file indictor file is existed, then reload the configuration file and delete indictor file.'''
+        """If the config file indictor file is existed, then reload the configuration file and delete indictor file."""
         if cls.is_config_modified():
             AZLogger.reload_config()
             with open(AZLogger.config_file_path, 'r') as config_file:
@@ -67,8 +69,8 @@
         cls.set_config(config)
     @classmethod
     def turn_on(cls)->None:
-        '''This on off functionality is on off all the invoking debug, info, warning, and error method using ProxyAZLogger class.
-        That is, if the client directly use AZLogger, the message is still be logger. However, it's not recommanded'''
+        """This on off functionality is on off all the invoking debug, info, warning, and error method using ProxyAZLogger class.
+        That is, if the client directly use AZLogger, the message is still be logger. However, it's not recommanded"""
         config = cls.get_config()
         config["is_logger_on"] = True
         cls.set_config(config)
@@ -76,8 +78,8 @@
         # cls.is_logger_on = True
     @classmethod
     def turn_off(cls)->None:
-        '''This on off functionality is on off all the invoking debug, info, warning, and error method using ProxyAZLogger class.
-        That is, if the client directly use AZLogger, the message is still be logger. However, it's not recommanded'''
+        """This on off functionality is on off all the invoking debug, info, warning, and error method using ProxyAZLogger class.
+        That is, if the client directly use AZLogger, the message is still be logger. However, it's not recommanded"""
         config = cls.get_config()
         config["is_logger_on"] = False
         cls.set_config(config)
@@ -85,30 +87,30 @@
         # cls.is_logger_on = False
     @classmethod
     def get_log(cls)->str:
-        '''return a string of content of log file'''
+        """return a string of content of log file"""
         config = cls.get_config()
         with open(config["log_path"], 'r', encoding='utf-8') as file:
             content = file.read()
         return content
     @classmethod
     def get_log_list(cls) -> list:
-        '''return a list of content of log file'''
+        """return a list of content of log file"""
         with open(cls.get_log_file_path(), "r") as file:
             lines = file.readlines()
         return lines
     @classmethod
     def get_Logger_state(cls)->bool:
-        '''This is used to check if logger is on or not
+        """This is used to check if logger is on or not
         return True if logger is on
         return False if logger is off
-        '''
+        """
         config = cls.get_config()
         return config["is_logger_on"]
     @classmethod
     def get_Logger_level_state(cls)->str:
-        '''This is used to check if logger level is debug, info, warning, and error
+        """This is used to check if logger level is debug, info, warning, and error
         return a string of log severity
-        '''
+        """
         config = cls.get_config()
         return config["level_of_severity"]
     @classmethod
Index: /branches/rel_apv_10_7_3/usr/click/webui/htdocs/new/src/hive/cloud/az/az_log_view.py
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/webui/htdocs/new/src/hive/cloud/az/az_log_view.py	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/webui/htdocs/new/src/hive/cloud/az/az_log_view.py	(working copy)
@@ -1,15 +1,9 @@
-from django.http import HttpResponse
 import subprocess, os, json
+
+from django.http import HttpResponse
+
 from hive.utils import aninfo, anerror
-import logging
 
-log_file_path = '/ca/webui/htdocs/new/logfile.log'
-logging.basicConfig(
-    filename=log_file_path,            # Path to the log file
-    level=logging.DEBUG,               # Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
-    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',  # Log message format
-    datefmt='%Y-%m-%d %H:%M:%S'         # Date format in the logs
-)
 
 def get_all_log(request):
     command = "python3 /ca/bin/azure/LoggerManager.py -mode show"
Index: /branches/rel_apv_10_7_3/usr/click/webui/htdocs/new/src/hive/cloud/az/az_nic_view.py
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/webui/htdocs/new/src/hive/cloud/az/az_nic_view.py	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/webui/htdocs/new/src/hive/cloud/az/az_nic_view.py	(working copy)
@@ -1,6 +1,19 @@
-from django.http import HttpResponse
 import subprocess, json
-from hive.utils import aninfo, anerror
+import shlex
+
+from django.http import HttpResponse
+
+from hive.utils import aninfo, anerror, cmd_direct
+
+
+def create_json_response(data, status_code):
+    """Creates a JSON response with the given data and status code."""
+    return HttpResponse(
+        json.dumps(data),
+        content_type="application/json",
+        status=status_code
+    )
+
 
 def get_all_nic_config(request):
     command = "python3 /ca/bin/azure/ConfigManager.py -mode getipconfig"
@@ -21,6 +34,7 @@
                 status=200
         )
 
+
 def delete_nic_config_by_index(request):
     required_keys = ["index"]
     data = json.loads(request.body)
@@ -43,6 +57,7 @@
         status=201
     )
 
+
 def add_nic_config(request):
     '''add nic ip configuration'''
     # verify user input
@@ -100,6 +115,8 @@
         content_type="application/json",
         status=200
     )
+
+
 def switch_nic_poller(request):
     # verify user input
     required_keys = ["status"]
@@ -114,7 +131,20 @@
             )
     # use az tool
     status = {"on": "1", "off": "2"}.get(data["status"])
-    command = "python3 /ca/bin/azure/AZFailoverPoller.py -mode {}".format(status)
+    command = (
+        "python3 /ca/bin/azure/AZFailoverPoller.py -mode "
+        "{}".format(status)
+    )
+    try:
+        # Start the command in the background. That is why we use Popen instead of call.
+        args = shlex.split(command)
+        subprocess.Popen(args)
+        cmd_direct("write memory") # launch Array CLi write memory
+        aninfo("hive.debug", "swtich nic poller status to {}".format(data["status"]))
+        return create_json_response({"message": "Succeed"}, 200)
+    except RuntimeError:
+        return create_json_response({"message": "error while running az tools."}, 500)
+
     res = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     stdout, stderr = res.communicate()
 
@@ -125,6 +155,7 @@
             content_type="application/json",
             status=500
         )
+    cmd_direct("write memory") # launch Array CLi write memory
     aninfo("hive.debug", "switch nic poller to {}".format(data["status"]))
     return HttpResponse(
         json.dumps({"message":"succeed"}),
Index: /branches/rel_apv_10_7_3/usr/click/webui/htdocs/new/src/hive/cloud/az/az_udr_view.py
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/webui/htdocs/new/src/hive/cloud/az/az_udr_view.py	(revision 39056)
+++ /branches/rel_apv_10_7_3/usr/click/webui/htdocs/new/src/hive/cloud/az/az_udr_view.py	(working copy)
@@ -1,8 +1,19 @@
-import subprocess, json, os
+import subprocess, json
+import shlex
 
 from django.http import HttpResponse
 
-from hive.utils import aninfo, anerror
+from hive.utils import aninfo, anerror, cmd_direct
+
+
+def create_json_response(data, status_code):
+    """Creates a JSON response with the given data and status code."""
+    return HttpResponse(
+        json.dumps(data),
+        content_type="application/json",
+        status=status_code
+    )
+
 
 def switch_udr_poller(request):
     # verify user input
@@ -22,25 +33,23 @@
             content_type="application/json",
             status=400
         )
+    aninfo("hive.debug", "switch_udr_poller")
 
     # use az tool
     status = {"on": "1", "off": "2"}.get(data["status"])
-    command = "python3 /ca/bin/azure/UDRPoller.py -mode {}".format(status)
-    res = subprocess.Popen(command.split(), stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w'))
-    stdout, stderr = res.communicate()
-    if stderr:
-        anerror("hive.debug", stderr)
-        return HttpResponse(
-        json.dumps({"message":"error while running az tools"}),
-            content_type="application/json",
-            status=500
-        )
-    aninfo("hive.debug", "swtich udr status to {}".format(data["status"]))
-    return HttpResponse(
-        json.dumps({"message":"succeed"}),
-        content_type="application/json",
-        status=200
+    command = (
+        "python3 /ca/bin/azure/UDRPoller.py -mode "
+        "{}".format(status)
     )
+    try:
+        # Start the command in the background. That is why we use Popen instead of call.
+        args = shlex.split(command)
+        subprocess.Popen(args)
+        cmd_direct("write memory") # launch Array CLi write memory
+        aninfo("hive.debug", "swtich udr status to {}".format(data["status"]))
+        return create_json_response({"message": "Succeed"}, 200)
+    except RuntimeError:
+        return create_json_response({"message": "error while running az tools."}, 500)
 
 
 def get_udr_poller_status(request):
@@ -54,6 +63,8 @@
             content_type="application/json",
             status=500
         )
+    aninfo("hive.debug", "get_udr_poller_status")
+
     is_running = {"True": True, "False": False}.get(stdout.replace("\n", ""))
     if is_running is None:
         anerror("hive.debug", stderr)
@@ -74,7 +85,7 @@
     '''add udr ip configuration'''
     # verify user input
     required_keys = ["sub_id", "res_grp_name", "vm_name", "ip_running", "ip_deallocating"]
-   
+
     data = json.loads(request.body)
     for key in required_keys:
         if key not in data:
