빠른 시작: 다중테넌트 Azure Logic Apps에서 Bicep을 사용하여 컨섬션 로직 앱 워크플로 만들기 및 배포

적용 대상: Azure Logic Apps(소비)

Azure Logic Apps1,400개 이상의 커넥터 중에서 선택하여 데이터, 앱, 클라우드 기반 서비스 및 온-프레미스 시스템을 통합하는 자동화된 워크플로를 만들고 실행하는 데 도움이 되는 클라우드 서비스입니다.

이 빠른 시작에서는 시간별 일정에 따라 Azure의 상태를 확인하고 다중 테넌트 Azure Logic Apps에서 실행되는 기본 소비 논리 앱 워크플로를 만들기 위해 Bicep 파일을 배포하는 프로세스에 중점을 둡니다.

Bicep은 선언적 구문을 사용하여 Azure 리소스를 배포하는 DSL(도메인 특정 언어)입니다. 간결한 구문, 신뢰할 수 있는 형식 안전성 및 코드 다시 사용에 대한 지원을 제공합니다. Bicep은 Azure에서 코드형 인프라 솔루션에 대한 최고의 제작 환경을 제공합니다.

필수 조건

Azure 계정 및 구독이 필요합니다. 무료 Azure 계정을 만듭니다.

Bicep 파일 검토

이 빠른 시작에서 사용되는 Bicep 파일은 Azure 빠른 시작 템플릿에서 나온 것입니다.

빠른 시작 템플릿은 기본 제공 되풀이 트리거 및 기본 제공 HTTP 작업을 사용하는 소비 논리 앱 워크플로를 만듭니다. 이 논리 앱은 1시간마다 실행되도록 설정되며, Azure의 상태를 반환하는 URL을 호출합니다. 기본 제공 작업은 Azure Logic Apps 플랫폼에서 기본적으로 실행됩니다.

이 Bicep 파일은 다음 Azure 리소스를 만듭니다.

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

@description('A test URI')
param testUri string = 'https://azure.status.microsoft/status/'

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

var frequency = 'Hour'
var interval = '1'
var type = 'recurrence'
var actionType = 'http'
var method = 'GET'
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: {
        testUri: {
          type: 'string'
          defaultValue: testUri
        }
      }
      triggers: {
        recurrence: {
          type: type
          recurrence: {
            frequency: frequency
            interval: interval
          }
        }
      }
      actions: {
        actionType: {
          type: actionType
          inputs: {
            method: method
            uri: testUri
          }
        }
      }
    }
  }
}

output name string = stg.name
output resourceId string = stg.id
output resourceGroupName string = resourceGroup().name
output location string = location

Bicep 파일 배포

  1. Bicep 파일을 main.bicep으로 로컬 컴퓨터에 저장합니다.

  2. Azure CLI 또는 Azure PowerShell을 사용하여 Bicep 파일을 배포합니다.

    az group create --name exampleRG --location eastus
    az deployment group create --resource-group exampleRG --template-file main.bicep --parameters logicAppName=<logic-name>
    

참고

<logic-name>을 만들 논리 앱의 이름으로 바꿉니다.

배포가 완료되면 배포에 성공했음을 나타내는 메시지가 표시됩니다.

배포된 리소스 검토

Azure Portal, Azure CLI 또는 Azure PowerShell을 사용하여 리소스 그룹에 배포된 리소스를 나열합니다.

az resource list --resource-group exampleRG

리소스 정리

논리 앱이 더 이상 필요하지 않으면 Azure Portal, Azure CLI 또는 Azure PowerShell을 사용하여 리소스 그룹 및 해당 리소스를 삭제합니다.

az group delete --name exampleRG

다음 단계