如何使用 powershell 设置 azure 逻辑应用程序定义
How to set azure logic app definition using powershell
我正在尝试使用 powershell 设置逻辑应用程序的定义,这是我正在使用的行:
Set-AzLogicApp -ResourceGroupName "dummy-dev-rg" -ResourceName "dummy-la-d" -Definition "{\"definition\":{\"$schema\":\"https:\/\/schema.management.azure.com\/providers\/Microsoft.Logic\/schemas\/2016-06-01\/workflowdefinition.json#\",\"actions\":{},\"contentVersion\":\"1.0.0.0\",\"outputs\":{},\"parameters\":{},\"triggers\":{}},\"parameters\":{}}"
我从逻辑应用程序本身获取定义并使用在线工具将其转换为 JSON,我得到了这个结果:
A positional parameter cannot be found that accepts argument 'definition\:{\:\https:\/\/schema.management.azure.com\/providers\/Microsoft.Logic\/schemas\/2016-06-01\/workfl
owdefinition.json#\,\actions\:{},\contentVersion\:.0.0.0\,\outputs\:{},\parameters\:{},\triggers\:{}},\parameters\:{}}'.
At line:1 char:1
我假设定义格式是错误的,我怎样才能传递正确的格式?
只需使用以下命令即可。
$json = '{
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {},
"triggers": {}
}'
Set-AzLogicApp -ResourceGroupName xxxx -ResourceName joylogic -Definition $json
你应该注意你的命令中的最后一个 parameters
属于 -Parameters
参数,你需要使用它而不是 -Definition
.
我正在尝试使用 powershell 设置逻辑应用程序的定义,这是我正在使用的行:
Set-AzLogicApp -ResourceGroupName "dummy-dev-rg" -ResourceName "dummy-la-d" -Definition "{\"definition\":{\"$schema\":\"https:\/\/schema.management.azure.com\/providers\/Microsoft.Logic\/schemas\/2016-06-01\/workflowdefinition.json#\",\"actions\":{},\"contentVersion\":\"1.0.0.0\",\"outputs\":{},\"parameters\":{},\"triggers\":{}},\"parameters\":{}}"
我从逻辑应用程序本身获取定义并使用在线工具将其转换为 JSON,我得到了这个结果:
A positional parameter cannot be found that accepts argument 'definition\:{\:\https:\/\/schema.management.azure.com\/providers\/Microsoft.Logic\/schemas\/2016-06-01\/workfl
owdefinition.json#\,\actions\:{},\contentVersion\:.0.0.0\,\outputs\:{},\parameters\:{},\triggers\:{}},\parameters\:{}}'.
At line:1 char:1
我假设定义格式是错误的,我怎样才能传递正确的格式?
只需使用以下命令即可。
$json = '{
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {},
"triggers": {}
}'
Set-AzLogicApp -ResourceGroupName xxxx -ResourceName joylogic -Definition $json
你应该注意你的命令中的最后一个 parameters
属于 -Parameters
参数,你需要使用它而不是 -Definition
.