locked
Monitor Azure DevOps release result RRS feed

  • Question

  • Hi,

    I'm using a Logic App to create a release in Azure Devops. The release definition trigger is set to deploy after a release. I want to wait until the release has completed before moving to the next steps and determine if the release has succeeded or failed.

    The built-in Azure DevOps triggers/actions do not offer a solution. I can add a task in the release definition to send the results to my Logic App for example, but how to configure the Logic App to wait for the result? Is there a more efficient way to handle this?

    Thanks!


    Message from: http://social.technet.microsoft.com/Forums/en-US/user

    Sunday, March 3, 2019 8:52 PM

Answers

  • Sorry for not getting back sooner.

    The problem here seems that though Logic Apps doesn't complain about using Body in the Untilloop, it doesn't seem to be working as expected.
    Also, the value being compared against is not available in the run history as well making it difficult to notice.

    So, you can fix this by

    1. Initializing a string variable before the until loop
    2. Use this variable in the until loop's condition
    3. Set this variable's value to the body returned by the HTTP request after that action in the until loop
    4. Move the send email action to after the until loop

    So, your Logic App should be something like this
    image

    You can ignore the Increment variable action and the final Compose action would be the Send an email action in your case.


    • Marked as answer by Gilgamesh2008 Friday, March 22, 2019 9:03 AM
    Monday, March 18, 2019 11:51 AM

All replies

  • This sounds like a perfect use case for the HTTP Webhook Action but I'm unsure if its fully possible.

    Basically, this action sends a request to a server along with a callback uri and suspends the logic app. The server is expected to call the callback uri when done with its processing, waking up the logic app.

    At first, I thought we could use this connector to set a variable in your pipeline but I believe your release would have already started by then.

    So, the only options that remain are -

    1. Call anther logic app from your task with the remaining tasks. I guess the problem here would be that you would have separate logic app invocations if you need to correlate which invocation of the first LA caused the second LA to trigger.

    2. Call a Function which monitors the release pipeline and resumes the Logic App once done. This is the perfect place for Durable Functions, especially the Monitoring Pattern.

    You can pass your release details along with the callback URI for the webhook action which your function can use to monitor the status of the release and once its done, call the callback URI to resume the Logic App.

    Tuesday, March 5, 2019 9:20 AM
  • Hi Pramod,

    I was hoping to be able to do it within the same Logic App and I think I made some progress, but something is not right yet.

    My approach was to use the UNTIL action to keep checking the Azure DevOps release status like shown below:

    For troubleshooting I added the email action that emails me the result of the GET request. I restricted the loop to 5 minutes.

    What happens is that I get a couple of emails with the status changing from 'notStarted' to 'inProgress' and finally multiple loops with status 'succeeded'. So the GetReleaseStatus step works, but the loop doesn't stop until it hits the time limit, while actually (as I realize just now) it should stop after the first loop as every response contains 'succeeded' multiple times.

    Any clues as to what I'm doing wrong here?


    Message from: http://social.technet.microsoft.com/Forums/en-US/user

    Monday, March 11, 2019 8:19 AM
  • Any thoughts on how to tackle this?

    Message from: http://social.technet.microsoft.com/Forums/en-US/user

    Monday, March 18, 2019 10:42 AM
  • Sorry for not getting back sooner.

    The problem here seems that though Logic Apps doesn't complain about using Body in the Untilloop, it doesn't seem to be working as expected.
    Also, the value being compared against is not available in the run history as well making it difficult to notice.

    So, you can fix this by

    1. Initializing a string variable before the until loop
    2. Use this variable in the until loop's condition
    3. Set this variable's value to the body returned by the HTTP request after that action in the until loop
    4. Move the send email action to after the until loop

    So, your Logic App should be something like this
    image

    You can ignore the Increment variable action and the final Compose action would be the Send an email action in your case.


    • Marked as answer by Gilgamesh2008 Friday, March 22, 2019 9:03 AM
    Monday, March 18, 2019 11:51 AM
  • Great! Your solution has done the trick.


    Message from: http://social.technet.microsoft.com/Forums/en-US/user

    Friday, March 22, 2019 9:04 AM