> For the complete documentation index, see [llms.txt](https://doc.duaer.com/zh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/zh/integrations/builtin/credentials/azureopenai.md).

# 在 Duaer 里配置 Azure OpenAI 凭证

在 Duaer 中保存 Azure OpenAI 的连接信息，供数字组织节点在运行时使用。密钥经实例加密密钥保护，不会写进节点参数。
## 获取 Azure OpenAI 密钥和地址 <a href="#get-the-key-and-endpoint" id="get-the-key-and-endpoint"></a>

Duaer 的 Azure Open AI 凭证先选 Endpoint Type，再填对应的地址：

1. 在 Azure 门户打开你的 Azure OpenAI（或 Azure AI Foundry）资源，进入 Keys and Endpoint，复制 KEY 1，填进 API Key。
2. Endpoint Type 选 Classic 时，Resource Name 填资源名，也就是 https://<资源名>.openai.azure.com 里的那一段；API Version 一般保持默认。
3. Endpoint Type 选 Azure AI Foundry 时，把完整的 OpenAI 兼容地址（形如 https://<名称>.services.ai.azure.com/openai/v1）填进 Endpoint。
4. 在资源里部署要用的模型。Duaer 的 Azure AI Foundry Chat Model 节点里，Model (Deployment) Name 填的是部署名，不是模型名。

## Duaer 里的 Azure Open AI 字段 <a href="#azure-open-ai" id="azure-open-ai"></a>

在 Duaer 里新建 Azure Open AI 凭证，填写这些字段：

- Endpoint Type：Classic 对应 *.openai.azure.com（资源名加按部署区分的地址）。Azure AI Foundry 对应 *.services.ai.azure.com/openai/v1（完整终端地址）。默认 Classic，可选 Classic、Azure AI Foundry。
- API Key（必填，密钥）
- Resource Name（必填）：Endpoint Type 为 Classic 时显示。
- API Version（必填）：默认 2025-03-01-preview，Endpoint Type 为 Classic 时显示。
- Endpoint（必填）：完整的 Azure AI Foundry OpenAI 兼容基础地址。Endpoint Type 为 Azure AI Foundry 时显示。
- Endpoint：可选。默认是 https://<资源名>.openai.azure.com。Endpoint Type 为 Classic 时显示。

使用它的 Duaer 节点：[Embeddings Azure OpenAI](/zh/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.embeddingsazureopenai.md)、[Azure AI Foundry Chat Model](/zh/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatazureopenai.md)。

## 在 Duaer 里保存连接

打开 Credentials，创建 Azure OpenAI。按字段填写密钥、OAuth 或服务器地址。保存后，数字组织节点引用这份凭证，而不是把密钥写进参数。

凭证内容经实例的加密密钥保护。换密钥或弄丢密钥后，已存凭证会解不开，见托管文档里的加密密钥说明。

## 谁能用这份凭证

能否看到或编辑，取决于项目和角色。不要把密钥贴进聊天或变量。外部密钥库见外部密钥文档。
## Questions

### Duaer 的 Azure OpenAI 凭证密钥会出现在节点参数里吗？

不会。在 Duaer 里，Azure OpenAI 的密钥保存在凭证中，节点只引用凭证。执行记录也不应出现明文密钥。

### 在 Duaer 里 Azure OpenAI 凭证保存失败常见原因是什么？

字段填错、OAuth 回调地址与实例 URL 不一致，或当前角色不能创建凭证。先核对 Azure OpenAI 服务商要求的字段，再确认你在该项目里有权新建凭证。

