arcus-azure / arcus.scripting

Scripting with Microsoft Azure in a breeze.
https://scripting.arcus-azure.net/
MIT License
9 stars 13 forks source link

logic app standard support for Azure Logic Apps script #413

Closed LaurentAerens closed 1 year ago

LaurentAerens commented 1 year ago

Is your feature request related to a problem? Please describe. Currently we are using logic apps standard more and more and they have workflows instead of logic app names

Describe the solution you'd like I would like it is the current logic app scripts (especially Disabling Azure Logic Apps from configuration file) would have support for disabling and enabling workflows in standard logic apps.

Describe alternatives you've considered Currently we disable and enable them by manipulating the app-settings:

   {
    "name": "Workflows.testflow-rcv.FlowState",
    "value": "Disabled"
  },
stijnmoreels commented 1 year ago

Great, thx @LaurentAerens for the issue! Seems like it would be a great addition to keep our Scripting repo up-to-date.

pim-simons commented 1 year ago

@LaurentAerens I have been looking into this but unfortunately there is no API to disable or enable a Logic App workflow, see the docs here https://learn.microsoft.com/en-us/rest/api/appservice/workflows.

I checked what kind of HTTP call the browser does when enabling/disabling a Logic App Standard workflow and it basically executes a PUT to add an app setting indicating the workflow is disabled (the same way you do it now).

We could leverage this script and see if we can work with that as this script basically does what we need to enable/disable a workflow.

@LaurentAerens does this approach sound OK to you?

pim-simons commented 1 year ago

Already did a quick test and this approach works fine, see https://github.com/arcus-azure/arcus.scripting/pull/415/files

LaurentAerens commented 1 year ago

sorry for the late response, Didn't get any update emails from this issue.

Currently we also the app setting in the pipeline to disable the logic apps but is this could be done with a arcus script that would help us a lot.

pim-simons commented 1 year ago

sorry for the late response, Didn't get any update emails from this issue.

Currently we also the app setting in the pipeline to disable the logic apps but is this could be done with a arcus script that would help us a lot.

Sounds good :) I will pick this up further. One question though, looking at https://scripting.arcus-azure.net/Features/powershell/azure-logic-apps#disabling-azure-logic-apps-from-configuration-file and https://scripting.arcus-azure.net/Features/powershell/azure-logic-apps#enabling-azure-logic-apps-from-configuration-file you can specify a ResourcePrefix that will enable/disable all Logic Apps that start with that prefix. With regard to Logic App Standard, do we want to prefix to work for the Logic App Site or for the Workflows? I would guess the Workflows but just wanted to check to be sure.

LaurentAerens commented 1 year ago

in our case that would be workflow, but i can see cases for both being usefull.

pim-simons commented 1 year ago

in our case that would be workflow, but i can see cases for both being usefull.

Thinking about this I think we could only do the prefix for workflow, since if you do this on Logic App site level you would not know which workflows to disable. For now I will keep the resourceprefix just for the workflows.