in 3-ai-native-e2e-sample/backend/config.py [0:0]
def validate_event_hubs_config() -> Dict[str, str]:
"""Validate and return Event Hubs configuration.
Raises:
ValueError: If any required configuration is missing
"""
connection_string = os.getenv("EVENTHUB_CONNECTION_STRING")
eventhub_name = os.getenv("EVENTHUB_NAME")
consumer_group = os.getenv("CONSUMER_GROUP", "$Default")
if not connection_string:
raise ValueError(
"EVENTHUB_CONNECTION_STRING environment variable is not set. "
"Please check your .env file and environment configuration."
)
if not eventhub_name:
raise ValueError(
"EVENTHUB_NAME environment variable is not set. "
"Please check your .env file and environment configuration."
)
# Log configuration status (without sensitive info)
logger.info(f"✅ Event Hubs configuration validated for hub: {eventhub_name}")
return {
"connection_string": connection_string,
"eventhub_name": eventhub_name,
"consumer_group": consumer_group
}