{"record":{"id":"3dc86375b9cdc7ef","repo":"microsoft/autogen","slug":"workbench-template-templateid-not-found","errorCode":null,"errorMessage":"Workbench template ${templateId} not found","messagePattern":"Workbench template (.+?) not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-studio/frontend/src/components/types/component-templates.ts","lineNumber":570,"sourceCode":"  templateId: string;\n}\n\nexport function getWorkbenchTemplatesForDropdown(): WorkbenchDropdownOption[] {\n  return WORKBENCH_TEMPLATES.map((template) => ({\n    key: template.id,\n    label: template.label,\n    description: template.description,\n    templateId: template.id,\n  }));\n}\n\nexport function createWorkbenchFromTemplate(\n  templateId: string,\n  customLabel?: string\n): Component<ComponentConfig> {\n  const template = getTemplateById(\"workbench\", templateId);\n  if (!template) {\n    throw new Error(`Workbench template ${templateId} not found`);\n  }\n\n  return createComponentFromTemplate(templateId, \"workbench\", {\n    label: customLabel || `New ${template.label}`,\n  });\n}\n\n// Generic dropdown option interface\nexport interface ComponentDropdownOption {\n  key: string;\n  label: string;\n  description: string;\n  templateId: string;\n}\n\n// Generic helper functions for all component types\nexport function getTemplatesForDropdown(\n  componentType: ComponentTypes","sourceCodeStart":552,"sourceCodeEnd":588,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-studio/frontend/src/components/types/component-templates.ts#L552-L588","documentation":"Raised inside the azure_ad_token_provider callback when DefaultAzureCredential.get_token() succeeds as a call but returns an empty/missing token string. This is the defensive check between acquiring a credential and handing it to AsyncAzureOpenAI; an empty token would otherwise surface later as an opaque 401 from the service.","triggerScenarios":"Configuring azure_openai embeddings without openai_api_key (forcing the DefaultAzureCredential path) in an environment where the credential chain runs but yields no usable token — e.g. managed identity unavailable, az CLI not logged in, or a corrupted cached token.","commonSituations":"Local development without `az login`; running in a container/CI where neither AZURE_CLIENT_* env vars nor a managed identity exist; a shared token cache containing an expired entry; the default subscription lacking access to the Cognitive Services scope.","solutions":["Authenticate locally: run `az login` and confirm the account has access to the Azure OpenAI resource.","For CI/service environments, set AZURE_CLIENT_ID/AZURE_TENANT_ID/AZURE_CLIENT_SECRET (service principal) or ensure a user-assigned managed identity is attached and set AZURE_CLIENT_ID to its client id.","Simplest unblock: pass `openai_api_key` in the config to bypass the DefaultAzureCredential path entirely.","Verify with `az account get-access-token --resource https://cognitiveservices.azure.com` to reproduce the failure outside the tool."],"exampleFix":"# before\nconfig = AzureAISearchConfig(\n    ..., embedding_provider=\"azure_openai\", embedding_model=M,\n    openai_endpoint=EP,\n)  # no api_key -> DefaultAzureCredential path\n\n# after (choose one)\n# 1) key auth:\nconfig = AzureAISearchConfig(..., openai_api_key=os.environ[\"AZURE_OPENAI_API_KEY\"])\n# 2) fix env: az login  (or set AZURE_CLIENT_ID/TENANT_ID/CLIENT_SECRET)","handlingStrategy":"validation","validationCode":"from azure.identity import DefaultAzureCredential\n\ndef token_acquirable() -> bool:\n    try:\n        tok = DefaultAzureCredential().get_token(\"https://cognitiveservices.azure.com/.default\")\n        return bool(tok and tok.token)\n    except Exception:\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    results = await tool.run(query)\nexcept ValueError as e:\n    if \"DefaultAzureCredential\" in str(e):\n        # credential-chain problem: fall back to key auth or surface a login hint\n        raise\n    raise","preventionTips":["Run `az login` in dev; set AZURE_CLIENT_ID/TENANT_ID/CLIENT_SECRET in CI.","Prefer key auth (openai_api_key) where managed identity is unavailable.","Test token acquisition in a startup health check."],"tags":["python","azure-authentication","azure-openai","embeddings","identity"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}