{"record":{"id":"b3c53006cfc5b784","repo":"FlowiseAI/Flowise","slug":"azure-foundry-api-key-is-missing-in-credentials","errorCode":null,"errorMessage":"Azure Foundry API Key is missing in credentials.","messagePattern":"Azure Foundry API Key is missing in credentials\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/components/nodes/retrievers/AzureRerankRetriever/AzureRerankRetriever.ts","lineNumber":127,"sourceCode":"                baseClasses: ['Document', 'json']\n            },\n            {\n                label: 'Text',\n                name: 'text',\n                description: 'Concatenated string from pageContent of documents',\n                baseClasses: ['string', 'json']\n            }\n        ]\n    }\n\n    async init(nodeData: INodeData, input: string, options: ICommonObject): Promise<any> {\n        const baseRetriever = nodeData.inputs?.baseRetriever as BaseRetriever\n        const model = nodeData.inputs?.model as string\n        const query = nodeData.inputs?.query as string\n        const credentialData = await getCredentialData(nodeData.credential ?? '', options)\n        const azureApiKey = getCredentialParam('azureFoundryApiKey', credentialData, nodeData)\n        if (!azureApiKey) {\n            throw new Error('Azure Foundry API Key is missing in credentials.')\n        }\n        const azureEndpoint = getCredentialParam('azureFoundryEndpoint', credentialData, nodeData)\n        if (!azureEndpoint) {\n            throw new Error('Azure Foundry Endpoint is missing in credentials.')\n        }\n        const topK = nodeData.inputs?.topK as string\n        const k = topK ? parseFloat(topK) : (baseRetriever as VectorStoreRetriever).k ?? 4\n        const maxChunksPerDoc = nodeData.inputs?.maxChunksPerDoc as string\n        const maxChunksPerDocValue = maxChunksPerDoc ? parseFloat(maxChunksPerDoc) : 10\n        const output = nodeData.outputs?.output as string\n\n        const azureCompressor = new AzureRerank(azureApiKey, azureEndpoint, model, k, maxChunksPerDocValue)\n\n        const retriever = new ContextualCompressionRetriever({\n            baseCompressor: azureCompressor,\n            baseRetriever: baseRetriever\n        })\n","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/retrievers/AzureRerankRetriever/AzureRerankRetriever.ts#L109-L145","documentation":"Thrown by AzureRerankRetriever.init when getCredentialParam('azureFoundryApiKey', ...) returns falsy. The retriever cannot authorize calls to Azure AI Foundry without the key, so it aborts during node initialization before building the compressor.","triggerScenarios":"No credential selected on the Azure Rerank Retriever node; selected credential lacks the azureFoundryApiKey field; credential saved with an empty key; wrong credential type bound.","commonSituations":"User created a generic Azure credential instead of the Foundry-specific one; key field left blank; credential was deleted or not shared with the chatflow.","solutions":["Create an Azure AI Foundry credential in Flowise and fill the API Key field.","Bind that credential to the Azure Rerank Retriever node.","Verify the key is non-empty and has not been rotated out.","Confirm the credential type exposes the azureFoundryApiKey parameter name."],"exampleFix":"// before: no credential, or empty key\n// after: in Flowise UI, create credential with azureFoundryApiKey=<your-key> and select it on the node","handlingStrategy":"validation","validationCode":"if (!azureApiKey) {\n  throw new Error('Azure Foundry API key is required. Create an Azure AI Foundry credential and bind it.')\n}","typeGuard":"function hasAzureApiKey(cred: unknown): cred is { azureFoundryApiKey: string } {\n  return !!cred && typeof (cred as any).azureFoundryApiKey === 'string' && (cred as any).azureFoundryApiKey.length > 0\n}","tryCatchPattern":"// Config error, not retryable. Catch only to surface a user-friendly message.\ntry {\n  await retriever.init(nodeData, input, options)\n} catch (e) {\n  if (e instanceof Error && /API Key is missing/.test(e.message)) {\n    // show credential picker\n  }\n  throw e\n}","preventionTips":["Create a dedicated Azure AI Foundry credential type with the key field required.","Validate the credential is bound on the node before running the chatflow.","Rotate keys via credential update, not by editing the chatflow."],"tags":["azure","rerank","credentials","retriever","config"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}