Testing workflows with mock outputs in Azure Logic Apps

Testing workflows with mock outputs in Azure Logic Apps allows you to simulate and validate your workflows without affecting your production environments. This feature, known as “Static Results” enables you to set up and return mock outputs from your workflow actions. Below is a step-by-step example of how to test a workflow using mock outputs.

Step 1: Open Your Logic App in the Designer

  1. Go to the Azure portal.
  2. Navigate to your Logic App resource.
  3. Open the Logic App in the Logic Apps Designer.

Step 2: Select the Action to Mock

  1. In the designer, select the action where you want to return mock outputs.
  2. On the action information pane, select the “Testing” tab.
  3. Enable the “Static Result” option.

Step 3: Configure Mock Outputs

  1. From the “Select Fields” list, choose the properties where you want to specify mock outputs to return in the action’s response.
  2. Enter the mock data for the selected properties.

Example Workflow

Here’s an example of setting up mock outputs for an HTTP action:
  1. Trigger: Use a “Recurrence” trigger to run the workflow at a specified interval.
  2. Action: Add an HTTP action to call an endpoint.
  3. Mock Outputs: Enable static results for the HTTP action and configure the mock outputs.

Here's how Logic Apps should look:

estudy247-la-test-mock-20
You can download the logic app template from the estudy247 GitHub repository – la-test-mock-20

Limitations

  • This capability is available only for actions, not triggers.
  • No option currently exists to dynamically or programmatically enable and disable this capability.
  • No indications exist at the Logic App level that this capability is enabled.

For more detailed information, you can refer to the official documentation on testing workflows with mock outputs in Azure Logic Apps.

Post a comment

Leave a Comment

Scroll to Top