def setAndValidateEnvConfigurations():
    """
    Function to validate the environment variables set
    :return: True is all configurations are set, else False
    """
    missingConfigurations = []
    invalidVerdicts = []
    verdicts = ['spam', 'malicious', 'phishing', 'graymail', 'neutral', 'bec', 'scam', 'noVerdict']
    defaultValues = {"Region": "us", "Verdicts":"malicious"}
    requiredConfigurations = ['ApiKey', 'ClientId', 'ClientSecret', 'WorkspaceID', 'SharedKey', 'Region', 'Verdicts' ]
    for config in requiredConfigurations:
        if os.environ.get(config) is None or len(os.environ.get(config)) == 0:
            if config not in defaultValues:
                missingConfigurations.append(config)
            else:
                logging.error(f"Configuration is not set for {config}, using default value {defaultValues[config]}" )
        if os.environ.get(config) and config == "Verdicts":
            verdictList = os.environ.get(config).split(",")
            verdictList = [v.strip() for v in verdictList]
            for verdict in verdictList:
                if verdict not in verdicts:
                    invalidVerdicts.append(verdict)
    if invalidVerdicts:
        strOfVerdicts = ','.join([str(elem) for elem in invalidVerdicts]) 
        logging.error(f"Encountered invalid verdict, {strOfVerdicts}")
    if missingConfigurations:
        strOfConfig = ','.join([str(ele) for ele in missingConfigurations])
        logging.error(f"Please set the required configurations as environment variables {strOfConfig}")
        return False
    return True

    Function to validate the environment variables set
    :return: True is all configurations are set, else False
    
Solutions/Cisco ETD/Data Connectors/CiscoETDAzureSentinelConnector/__init__.py