Reputation: 69
I have created one logic app, now I want to copy the same logic to another resource group that I can use for the testing environment.
Can some one help me out with either Azure CLI command or any direct option in the Azure portal itself to copy the logic app from one resource group to another resource group.
I checked in the Azure portal, I can see only the "Move" option, when I use that it is just move my logic app from resource group 1 to resource group 2. But my requirement is it should present in both the resource groups .
Thanks in advance.
Regards, Manikanta
Upvotes: 5
Views: 11056
Reputation: 880
I have also found another pretty neat way how to update already existing LA in other resource groups. It might look a little messy, but when you do it for several times, you can do it much way faster than just always cloning LA. When you open LA and click on Code view
you need to notice that each LA structure is like in an example below. You can take all code in LA1 (resource group 1) from top till outputs
and copy paste it to new LA2 (resource group 2), but some changes needs to be done in LA2 the first time you do this:
SomeActions
part, and update the SomeConnection
, but leave connectionId
and connectionName
as it was defined in LA2, so only the connection name matches between both LA.Next time you want to do an update you just take the code, and copy everything from top till outputs
.
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
...SomeActions
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
},
"OtherParameters": {
"defaultValue": "SomeValue",
"type": "String"
}
},
"triggers": {
"manual": {
"inputs": {
"schema": {
...SomeTrigger
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {
"$connections": {
"value": {
"SomeConnection": {
"connectionId": "SomeId",
"connectionName": "SomeName",
"id": "SomeId"
}
}
}
}
}
Upvotes: 1
Reputation: 880
This might make a little mess with connections, but I found this approach working faster for large LA's than manually recreating the same LA in a new resource group:
Upvotes: 4
Reputation: 14324
You could download the logic app and connections as an ARM template using Logic app VS tools, with this way it contains all connections you set.
Then you could edit it , if you use Visual Studio, just replace the LogicApp.json with the one you downloaded.
If your selected connectors need input from you, a PowerShell window opens in the background and prompts for any necessary passwords or secret keys. After you enter this information, deployment continues.
Also you could deploy the template with Azure Cli.
Upvotes: 4
Reputation: 29491
From Azure portal, you can easily copy your logic app using the Clone
button
Upvotes: 4