{"record":{"id":"1cdcd168d6d7ec79","repo":"conductor-oss/conductor","slug":"credentialref-is-required-for-azure-foundry-agent","errorCode":null,"errorMessage":"credentialRef is required for Azure Foundry agent requests","messagePattern":"credentialRef is required for Azure Foundry agent requests","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/AzureFoundryAgentClient.java","lineNumber":327,"sourceCode":"                .pendingToolName(pendingToolName)\n                .reasonForIncompletion(reason)\n                .build();\n    }\n\n    private static ConductorAgentState toState(String azureStatus) {\n        return switch (azureStatus) {\n            case \"completed\" -> ConductorAgentState.COMPLETED;\n            case \"failed\", \"expired\" -> ConductorAgentState.FAILED;\n            case \"cancelled\" -> ConductorAgentState.CANCELED;\n            case \"requires_action\" -> ConductorAgentState.WAITING;\n            default -> ConductorAgentState.RUNNING; // queued, in_progress\n        };\n    }\n\n    private OAuthTokenProvider buildTokenProvider(ConductorAgentStartRequest request) {\n        String credentialRef = request.getCredentialRef();\n        if (StringUtils.isBlank(credentialRef)) {\n            throw new IllegalArgumentException(\n                    \"credentialRef is required for Azure Foundry agent requests\");\n        }\n        String clientId = credentialResolutionService.resolve(credentialRef + \".client_id\");\n        String clientSecret = credentialResolutionService.resolve(credentialRef + \".client_secret\");\n        String tenantId = credentialResolutionService.resolve(credentialRef + \".tenant_id\");\n\n        if (StringUtils.isAnyBlank(clientId, clientSecret, tenantId)) {\n            throw new IllegalStateException(\n                    \"Azure Foundry credential '\"\n                            + credentialRef\n                            + \"' must contain client_id, client_secret, and tenant_id\");\n        }\n\n        String scope =\n                StringUtils.defaultIfBlank(\n                        rawConfig(request, \"scope\"),\n                        credentialResolutionService.resolve(credentialRef + \".scope\"));\n        scope = StringUtils.defaultIfBlank(scope, DEFAULT_SCOPE);","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/AzureFoundryAgentClient.java#L309-L345","documentation":"Error \"credentialRef is required for Azure Foundry agent requests\" thrown in conductor-oss/conductor.","triggerScenarios":"Thrown at agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/AzureFoundryAgentClient.java:327 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set credentialRef on the Azure Foundry agent request to a stored credential containing the Azure service principal."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}