【发布时间】:2021-10-03 20:04:20
【问题描述】:
我正在尝试将我的逻辑应用 ARM 模板转换为 pulumi 。但它不接受我的 JSON 形式的连接参数。我需要在逻辑应用步骤中传递我的 github 连接详细信息
你能告诉我如何在 pulumi python 中做到这一点吗?
"parameters": {
"$connections": {
"value": {
"github": {
"connectionId": "/subscriptions/b417b96c-ff1e-4d07-bc32-74bd70a2a033/resourceGroups/task/providers/Microsoft.Web/connections/github",
"connectionName": "github",
"id": "/subscriptions/b417b96c-ff1e-4d07-bc32-74bd70a2a033/providers/Microsoft.Web/locations/eastus/managedApis/github"
}
}
}
我的代码
example_action_custom = azure.logicapps.ActionCustom("exampleActionCustom",
logic_app_id=example_workflow.id,
name= "Create_a_repository_using_a_template",
body="""{
"inputs": {
"body": {
"name": "cog-chalnge-pmi-shah-@{triggerBody()?['ghusername']}",
"owner": "@triggerBody()?['ghusername']",
"private": true
},
"headers": {
"Accept": "application/vnd.github.baptiste-preview+json"
},
"host": {
"connection": {
"name": "@parameters('$connections')['github']['connectionId']"
}
},
"method": "post",
"parameters": {
"$connections": {
"value": {
"github": {
"connectionId": "/subscriptions/b417b96c-ff1e-4d07-bc32-74bd70a2a033/resourceGroups/bluecode_test_task/providers/Microsoft.Web/connections/github",
"connectionName": "github",
"id": "/subscriptions/b417b96c-ff1e-4d07-bc32-74bd70a2a033/providers/Microsoft.Web/locations/eastus/managedApis/github"
}
}
}
},
"path": "/repos/@{encodeURIComponent('')}/@{encodeURIComponent('')}/generate"
},
"runAfter": {},
"type": "ApiConnection"
}
""")
无法创建 github 连接器
我尝试过的有用链接 - https://www.pulumi.com/docs/reference/pkg/azure/logicapps/workflow/ https://www.pulumi.com/docs/reference/pkg/azure/logicapps/actioncustom
【问题讨论】:
-
当你说它不接受时,它会引发任何错误吗?如果是这样,您可以添加回溯吗?另外,能不能加一些相关的代码?
-
我编辑了内容。请检查
标签: python python-3.x arm azure-logic-apps pulumi