You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

通过ARM模板部署带函数密钥的Azure Function链接服务遇错求助

可以通过ARM模板创建带函数密钥的Azure Function链接服务

你的报错核心原因是:参数文件中指定的LS_AF_xxxx_properties_typeProperties_encryptedCredential参数,在你使用的原始ARM模板的parameters节点里没有定义,导致部署引擎无法识别该参数,从而抛出错误。

以下是正确配置的两种方案:

方案1:通过参数传递函数密钥(推荐结合密钥保管库)

在ARM模板中先定义对应参数,再在链接服务资源中引用:

模板的parameters部分添加定义:

"parameters": {
  "LS_AF_xxxx_functionAppUrl": {
    "type": "string"
  },
  "LS_AF_xxxx_functionKey": {
    "type": "secureString"
  }
}

链接服务的资源定义:

{
  "name": "LS_AF_xxxx",
  "type": "Microsoft.DataFactory/factories/linkedservices",
  "apiVersion": "2018-06-01",
  "properties": {
    "type": "AzureFunction",
    "typeProperties": {
      "functionAppUrl": "[parameters('LS_AF_xxxx_functionAppUrl')]",
      "functionKey": "[parameters('LS_AF_xxxx_functionKey')]"
    }
  }
}

注意:为保障安全,建议将函数密钥存储在Azure密钥保管库中,通过@Microsoft.KeyVault(SecretUri=...)的方式引用,避免在参数文件中明文传递密钥。

方案2:使用加密凭证(encryptedCredential)

如果要使用encryptedCredential,需先生成与你的数据工厂、环境绑定的加密值,再将其添加到模板中:

  1. 用PowerShell命令生成加密凭证:
New-AzDataFactoryV2LinkedServiceEncryptedCredential `
  -DataFactoryName "你的数据工厂名称" `
  -ResourceGroupName "你的资源组名称" `
  -LinkedServiceName "你的链接服务名称" `
  -RuntimeContext "Azure"
  1. 将生成的encryptedCredential值直接嵌入到ARM模板的链接服务属性中,或者在模板的parameters里定义该参数后通过参数传递:

模板中直接嵌入的示例:

{
  "name": "LS_AF_xxxx",
  "type": "Microsoft.DataFactory/factories/linkedservices",
  "apiVersion": "2018-06-01",
  "properties": {
    "type": "AzureFunction",
    "typeProperties": {
      "functionAppUrl": "https://xxxx.azurewebsites.net",
      "encryptedCredential": "uiaLtjo8ACh5zYAparmGIhLh_Bhvk4VbsgcGLFWWSFNzAzFumEPZ9w=="
    }
  }
}

通过参数传递的示例(需先在模板的parameters里添加定义):

"parameters": {
  "LS_AF_xxxx_functionAppUrl": {
    "type": "string"
  },
  "LS_AF_xxxx_encryptedCredential": {
    "type": "string"
  }
}

然后在资源中引用:

"typeProperties": {
  "functionAppUrl": "[parameters('LS_AF_xxxx_functionAppUrl')]",
  "encryptedCredential": "[parameters('LS_AF_xxxx_encryptedCredential')]"
}

解决当前报错的直接方法

如果要保留你当前的参数文件配置,只需在原始ARM模板的parameters节点中添加LS_AF_xxxx_properties_typeProperties_encryptedCredential的参数定义,部署引擎就能识别该参数了。

内容的提问来源于stack exchange,提问作者Anshul Dubey

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.14 13:15:58