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

Categories

0 votes
261 views
in Technique[技术] by (71.8m points)

How to set azure logic app parameters using powershell

I'm trying to set the parameters of a logic app using powershell, this is the code I'm using:

$parameters = '{
    "$connections": {
            "syncSourceDatabaseConnection": {
                "connectionId": "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Web/connections/xxxx",
                "connectionName": "xxx",
                "id": "/subscriptions/xxx/providers/Microsoft.Web/locations/southeastasia/managedApis/sql"
            },
            "syncTargetDatabaseConnection": {
                "connectionId": "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Web/connections/xxx",
                "connectionName": "xxx",
                "id": "/subscriptions/xxx/providers/Microsoft.Web/locations/southeastasia/managedApis/sql"
        }
    }
}'

Set-AzLogicApp -ResourceGroupName "xxx" -ResourceName "xxx" -Parameters $parameters -Force

The code executes fine but the connections are not set, how do I fix this?


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

1 Answer

0 votes
by (71.8m points)

You can use this command:

Set-AzLogicApp -ResourceGroupName "<resourcegroup>" -ResourceName "<name>" -ParameterFilePath "?C:Usersxxxxxxest.json" -Force

If you use this command, you need to create a json file locally.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...