def disable_function(self):
        """Disable a function app as failure count reached to 10.

        Raises:
            Exception: if any error occurs
        """
        try:
            __method_name = inspect.currentframe().f_code.co_name
            url = (consts.DISABLE_FUNCTION_APP_URL).format(consts.SUBSCRIPTION_ID, consts.RESOURCE_GROUP, consts.FUNCTION_APP_NAME)

            access_token = self.azure_token_generator()
            headers = {"Authorization": f"Bearer {access_token}"}
            response = requests.post(url=url, headers=headers)

            response.raise_for_status()
            if response.status_code in [200, 201]:
                self.applogger.info(
                    "{}(method={}): {}: Function App disabled successfully.".format(
                        consts.LOGS_STARTS_WITH, __method_name, self.function_name
                    )
                )
            else:
                self.applogger.error(
                    "{}(method={}): {}: Error occurred while disabling function. status_code={}, reason={}".format(
                        consts.LOGS_STARTS_WITH, __method_name, self.function_name, response.status_code, response.text
                    )
                )
                raise Exception
        except requests.exceptions.HTTPError as err:
            self.applogger.error(
                "{}(method={}): {}: Error occurred while disabling function : status code: {}, reason: '{}'.".format(
                    consts.LOGS_STARTS_WITH, __method_name, self.function_name, response.status_code, err
                )
            )
            self.save_checkpoint(data={"disable_function": False}, disable_function_error=True)
            raise Exception
        except Exception as err:
            self.applogger.error(
                "{}(method={}): {}: Error occured while disabling function : '{}'.".format(
                    consts.LOGS_STARTS_WITH, __method_name, self.function_name, err
                )
            )
            self.save_checkpoint(data={"disable_function": False}, disable_function_error=True)
            raise Exception
Disable a function app as failure count reached to 10.

        Raises:
            Exception: if any error occurs
        
Solutions/Vectra XDR/Data Connectors/VectraDataConnector/SharedCode/collector.py