{"record":{"id":"8b02bbff100e006a","repo":"BerriAI/litellm","slug":"azure-sentinel-dcr-immutable-id-is-required-set-i","errorCode":null,"errorMessage":"AZURE_SENTINEL_DCR_IMMUTABLE_ID is required. Set it as an environment variable or pass dcr_immutable_id parameter.","messagePattern":"AZURE_SENTINEL_DCR_IMMUTABLE_ID is required\\. Set it as an environment variable or pass dcr_immutable_id parameter\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/azure_sentinel/azure_sentinel.py","lineNumber":105,"sourceCode":"        resolved_stream_name: Final = stream_name or os.getenv(\"AZURE_SENTINEL_STREAM_NAME\") or \"Custom-LiteLLM\"\n        resolved_audit_stream_name: Final = (\n            audit_stream_name or os.getenv(\"AZURE_SENTINEL_AUDIT_STREAM_NAME\") or resolved_stream_name\n        )\n        resolved_endpoint: Final = endpoint or os.getenv(\"AZURE_SENTINEL_ENDPOINT\")\n        resolved_tenant_id: Final = tenant_id or os.getenv(\"AZURE_SENTINEL_TENANT_ID\") or os.getenv(\"AZURE_TENANT_ID\")\n        resolved_client_id: Final = client_id or os.getenv(\"AZURE_SENTINEL_CLIENT_ID\") or os.getenv(\"AZURE_CLIENT_ID\")\n        resolved_client_secret: Final = (\n            client_secret or os.getenv(\"AZURE_SENTINEL_CLIENT_SECRET\") or os.getenv(\"AZURE_CLIENT_SECRET\")\n        )\n        resolved_authority_host: Final = self._normalize_authority_host(\n            authority_host\n            or os.getenv(\"AZURE_SENTINEL_AUTHORITY_HOST\")\n            or os.getenv(\"AZURE_AUTHORITY_HOST\")\n            or DEFAULT_AZURE_AUTHORITY_HOST\n        )\n\n        if not resolved_dcr_immutable_id:\n            raise ValueError(\n                \"AZURE_SENTINEL_DCR_IMMUTABLE_ID is required. Set it as an environment variable or pass dcr_immutable_id parameter.\"\n            )\n        if not resolved_endpoint:\n            raise ValueError(\n                \"AZURE_SENTINEL_ENDPOINT is required. Set it as an environment variable or pass endpoint parameter.\"\n            )\n        if not resolved_tenant_id:\n            raise ValueError(\n                \"AZURE_SENTINEL_TENANT_ID or AZURE_TENANT_ID is required. Set it as an environment variable or pass tenant_id parameter.\"\n            )\n        if not resolved_client_id:\n            raise ValueError(\n                \"AZURE_SENTINEL_CLIENT_ID or AZURE_CLIENT_ID is required. Set it as an environment variable or pass client_id parameter.\"\n            )\n        if not resolved_client_secret:\n            raise ValueError(\n                \"AZURE_SENTINEL_CLIENT_SECRET or AZURE_CLIENT_SECRET is required. Set it as an environment variable or pass client_secret parameter.\"\n            )","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/azure_sentinel/azure_sentinel.py#L87-L123","documentation":"AzureSentinelLogger.__init__ resolves the Data Collection Rule immutable id from the dcr_immutable_id constructor kwarg or the AZURE_SENTINEL_DCR_IMMUTABLE_ID env var; if neither is set it raises immediately, before any log can be shipped. The DCR immutable id is the immutableId GUID of the Azure Monitor Data Collection Rule that tells the Logs Ingestion API how to route records into the target table.","triggerScenarios":"Adding \"azure_sentinel\" to litellm callbacks/settings without provisioning the Azure Monitor pipeline; creating the DCR in the portal but never copying its immutableId; exporting the other AZURE_SENTINEL_* values but not this one; running the proxy in a pod whose secret mount omitted this key.","commonSituations":"Teams note the DCR resource name instead of its immutableId; CI/staging environments missing secrets; docs examples that show only endpoint and tenant; rotating to a new DCR without updating env.","solutions":["Retrieve the value with `az monitor data-collection rule show --name <dcr> --resource-group <rg> --query immutableId` (or portal: Data Collection Rule -> JSON view -> immutableId) and export AZURE_SENTINEL_DCR_IMMUTABLE_ID=<that guid>","Or pass dcr_immutable_id=\"...\" explicitly when constructing AzureSentinelLogger programmatically","Set the other four required values at the same time (endpoint, tenant id, client id, client secret) — each has its own check that will fire next","Redeploy the proxy/worker so the new env is visible to the process"],"exampleFix":"// before\nexport AZURE_SENTINEL_ENDPOINT=https://my-ws-o1.ingest.monitor.azure.com\nexport AZURE_SENTINEL_TENANT_ID=...  # DCR id forgotten -> ValueError at init\n// after\nexport AZURE_SENTINEL_DCR_IMMUTABLE_ID=\"dcr-0000aaaa1111bbbb2222cccc3333dddd\"\nexport AZURE_SENTINEL_ENDPOINT=https://my-ws-o1.ingest.monitor.azure.com\nexport AZURE_SENTINEL_TENANT_ID=...\nexport AZURE_SENTINEL_CLIENT_ID=...\nexport AZURE_SENTINEL_CLIENT_SECRET=...","handlingStrategy":"validation","validationCode":"import os\n\nrequired = {\n    \"dcr_immutable_id\": (\"AZURE_SENTINEL_DCR_IMMUTABLE_ID\",),\n    \"endpoint\": (\"AZURE_SENTINEL_ENDPOINT\",),\n    \"tenant_id\": (\"AZURE_SENTINEL_TENANT_ID\", \"AZURE_TENANT_ID\"),\n    \"client_id\": (\"AZURE_SENTINEL_CLIENT_ID\", \"AZURE_CLIENT_ID\"),\n    \"client_secret\": (\"AZURE_SENTINEL_CLIENT_SECRET\", \"AZURE_CLIENT_SECRET\"),\n}\nmissing = [n for n, envs in required.items() if not any(os.getenv(e) for e in envs)]\nif missing:\n    raise RuntimeError(f\"azure_sentinel not configured, missing: {missing}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provision DCR + association + app registration before enabling the callback","Store all five values in one secret/env file so they are set or unset as a unit","Add a startup smoke test that constructs AzureSentinelLogger before serving traffic","Capture immutableId programmatically (az monitor data-collection rule show --query immutableId) rather than copying from the portal"],"tags":["azure-sentinel","azure-monitor","data-collection-rule","litellm","configuration","missing-env-var"],"backgroundTag":"missing-env-var","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}