{"record":{"id":"0be7e69b02e83ee7","repo":"microsoft/semantic-kernel","slug":"missing-required-configuration-host-and-port-must","errorCode":null,"errorMessage":"Missing required configuration. HOST and PORT must be set.","messagePattern":"Missing required configuration\\. HOST and PORT must be set\\.","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"python/samples/demos/copilot_studio_skill/src/api/config.py","lineNumber":36,"sourceCode":"    # and must match these named as Bot configuration expects\n    APP_ID = os.getenv(\"BOT_APP_ID\")\n    APP_PASSWORD = os.getenv(\"BOT_PASSWORD\")\n    APP_TENANTID = os.getenv(\"BOT_TENANT_ID\")\n    APP_TYPE = os.getenv(\"APP_TYPE\", \"singletenant\")\n\n    # Required for Copilot Skill\n    # Can be a list of allowed agent Ids,\n    # or \"*\" to allow any agent\n    ALLOWED_CALLERS = os.getenv(\"ALLOWED_CALLERS\", [\"*\"])\n\n    # Required for Azure OpenAI\n    AZURE_OPENAI_CHAT_DEPLOYMENT_NAME = os.getenv(\"AZURE_OPENAI_CHAT_DEPLOYMENT_NAME\")\n    AZURE_OPENAI_ENDPOINT = os.getenv(\"AZURE_OPENAI_ENDPOINT\")\n    AZURE_OPENAI_API_VERSION = os.getenv(\"AZURE_OPENAI_API_VERSION\")\n\n    def validate(self):\n        if not self.HOST or not self.PORT:\n            raise Exception(\"Missing required configuration. HOST and PORT must be set.\")\n        if not self.APP_ID or not self.APP_PASSWORD or not self.APP_TENANTID:\n            raise Exception(\"Missing required configuration. APP_ID, APP_PASSWORD, and APP_TENANT_ID must be set.\")\n\n        if not self.ALLOWED_CALLERS:\n            raise Exception(\"Missing required configuration. ALLOWED_CALLERS must be set.\")\n\n\nconfig = Config()\nconfig.validate()\n","sourceCodeStart":18,"sourceCodeEnd":46,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/samples/demos/copilot_studio_skill/src/api/config.py#L18-L46","documentation":"A generic Exception raised by Config.validate() when HOST or PORT is falsy. Note the Config class provides defaults (HOST='localhost', PORT=8080), so this only triggers if HOST is explicitly set to an empty string or PORT is set to a falsy value like 0 — i.e. an explicit misconfiguration rather than a missing one.","triggerScenarios":"Setting HOST='' (empty) or PORT=0 in the environment, making `not self.HOST` or `not self.PORT` true during the module-level config.validate() call.","commonSituations":"A deployment template sets HOST to an empty variable; PORT set to 0 inadvertently; .env with HOST= (blank).","solutions":["Set HOST to a real hostname/IP (or unset it to accept the 'localhost' default).","Set PORT to a positive integer (or unset to accept 8080).","Remove empty HOST=/PORT= lines from your .env."],"exampleFix":"// before\nHOST=\nPORT=0\n\n// after\nHOST=0.0.0.0\nPORT=8080","handlingStrategy":"validation","validationCode":"import os\nhost = os.getenv('HOST')\nport = os.getenv('PORT')\nif host == '' or port in ('', '0'):\n    raise SystemExit(\"HOST must be non-empty and PORT a positive integer.\")","typeGuard":"def is_valid_host_port(h, p) -> bool:\n    return bool(h) and str(p).isdigit() and int(p) > 0","tryCatchPattern":null,"preventionTips":["Avoid setting HOST/PORT to empty in deployment templates; unset them to use defaults.","Validate bound config in CI before deploy."],"tags":["configuration","env-vars","copilot-studio","startup"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}