Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to set the definition of the logic app using powershell, this is the line I'm using:

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":{}}"

I took the definition from the logic app itself and converted it to JSON using an online tool, I'm getting this result:

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:1.0.0.0,outputs:{},parameters:{},riggers:{}},parameters:{}}'.
    At line:1 char:1

I'm assuming the definition format is wrong, how can I pass a correct one?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
317 views
Welcome To Ask or Share your Answers For Others

1 Answer

Just use the commands below.

$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

enter image description here

And you should note the last parameters in your command belongs to -Parameters parameter, you need to use it instead of -Definition.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...