DEV Community

Kenichiro Nakamura
Kenichiro Nakamura

Posted on

1

Quickly provision Logic App environment to start developing the flow

This is the Dec 20th article of
Power Automate advent calendar 2022, and I decided to explain how to provision Logic App environment by using bicep.

Main audience for this article is citizen developers who are familiar with Power Automate (and Power Platform solutions).

Difference between Power Automate and Logic App

The most important difference, at least for me, is that Power Automate is owned by user, whereas Logic App belongs to Azure resource. If the flow you are developing is part of backend system, then the owner of the flow obviously shouldn't be user(s).

The good news is that if you can develop Power Automate, you can do so with Logic App, as there are quite similar.

Environment difference

Power Automate is run in Power Platform, whereas Logic App runs in Azure subscription. Therefore, you need to have Azure subscription and appropriate access to the subscription.

You can start using Azure for free if don't have any yet. See Build in the cloud with an Azure free account for more detail.

How to provision Logic App

There are several ways to create Logic App.

  • Azure Portal
  • Azure CLI/Azure PowerShell Module
  • ARM/bicep template

Interesting part of Logic App deployment is that we can include workflow definition itself. However, I want to provision new environment to start development, I explain how to provision environment without any definition.

Azure CLI

Firstly, I explain how to use az command only to create a Logic App.

1. Install logic az cli extension.

az extension add --name logic
Enter fullscreen mode Exit fullscreen mode

2. Create resource group where you provision Logic App. Change name and location as you need.

az group create --name <your resource group name> --location eastus
Enter fullscreen mode Exit fullscreen mode

3. Create definition json as definition.json.

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json",
        "contentVersion": "1.0.0.0",
        "parameters": {},
        "triggers": {},
        "actions": {}
    }
}
Enter fullscreen mode Exit fullscreen mode

4. Run the command to create Logic App.

az logic workflow create -g "<your resource group name>" -l "eastus" --name "testLogicApp" --definition ".\definition.json"
Enter fullscreen mode Exit fullscreen mode

Bicep

Secondly, using bicep.

1. Create logicapp.bicep as below.

@description('The name of the logic app to create.')
param logicAppName string

@description('Location for all resources.')
param location string = resourceGroup().location

var workflowSchema = 'https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#'

resource stg 'Microsoft.Logic/workflows@2019-05-01' = {
  name: logicAppName
  location: location
  tags: {
    displayName: logicAppName
  }
  properties: {
    definition: {
      '$schema': workflowSchema
      contentVersion: '1.0.0.0'
      parameters: {
      }
      triggers: {
      }
      actions: {
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

2. Run the command.

az deployment group create -g "<your resource group name>" --template-file .\logicapp.bicep --parameters logicAppName=testLogicApp2
Enter fullscreen mode Exit fullscreen mode

Result

In both cases, you can find created Logic Apps in Portal.

Azure Portal Logic Apps

When you open either one, you can see Logic App Designer page.

Logic App Designer

What's next?

As you can see, the definition body is blank. If you want to recreate same or similar workflow, try to convert your flow into definition, then you can easily deploy to different environment.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay