# azure/logicapps architecture

> Architecture diagram of the GitHub repository azure/logicapps, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/azure/logicapps
- Repository: https://github.com/azure/logicapps

## Overview

##### Project Type and Purpose
- This repository is a “sample‐hub” for Azure Logic Apps. It hosts:
- Custom connector samples (connectors/AzureVM, connectors/Microsoft Graph)
- Logic App workflow templates (templates/)
- End-to-end demo projects (LogicApps-AI-RAG-Demo, ai-sample, arc-enabled-logic-app-sample, azure-devops-sample, codeful-workflows, labs/)
- Automation scripts (scripts/)
- A .NET-based test framework (LogicAppsSampleTestFramework/)
- Purpose: demonstrate patterns (serverless, event-driven), provide deployable templates and code samples, and show DevOps pipelines for CI/CD.

##### File Structure Analysis
- Top-level categories:
- connectors/ – ARM templates & docs for custom API Connectors
- templates/ – ready-to-use Logic App workflows
- LogicAppsSampleTestFramework/ – .NET test harness for Logic Apps
- scripts/ – PowerShell scripts for run management, migrations, scheduling
- azure-devops-sample/, arc-enabled-logic-app-sample/, codeful-workflows/, ai-sample/, LogicApps-AI-RAG-Demo/ – each is a standalone demo combining Logic Apps + supporting code (Functions, parameters, host.json, Bicep/ARM, pipelines)
- CI/CD: .github/workflows and azure-devops-sample/.pipelines show GitHub Actions and Azure DevOps templates
- Infra as code: Bicep (arc-enabled), ARM JSON (connectors, templates)

##### README Insights
- Confirms it’s a collection of samples for Azure Logic Apps, linking to feedback/Q&A.
- No single “runtime” project – it’s an umbrella of demos.

##### Diagramming the Architecture
a. Main Components
- Developer Workstation / GitHub
- CI/CD pipelines (GitHub Actions, Azure DevOps)
- Infrastructure as Code (ARM, Bicep)
- Azure Resource Group
- Azure Logic Apps service (Consumption & Standard)
- Azure Functions (TokenizeDocFunction, any codeful workflows)
- Custom API Connectors (AzureVM, Microsoft Graph)
- External Azure services (Storage, Service Bus, Cosmos DB, Key Vault as used by samples)
- Test Framework Host (.NET MockHttpHost, WorkflowTestHost)
b. Relationships & Interactions
1. Developer pushes code → CI/CD triggers → deploys ARM/Bicep → provisions RG, Logic App services, Functions, Connectors
2. Client or Scheduler triggers Logic App HTTP trigger or recurrence
3. Logic App workflows orchestrate calls:
– Invoke Azure Function (e.g., TokenizeDocFunction)
– Execute Connector operations (start VM, query Graph)
– Write/read from storage or queues
4. Test Framework spins up MockHttpHost to replay and validate workflows
c. Architectural Patterns
- Serverless / Event-driven orchestration (Logic Apps + Functions)
- Infrastructure as Code (ARM, Bicep)
- CI/CD pipelines template-driven
- Test-driven workflow validation
d. Key Technologies
- Azure Logic Apps (Standard & Consumption)
- Azure Functions (Python, C#)
- ARM / Bicep templates
- GitHub Actions & Azure DevOps pipelines
- .NET Core test framework

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Actors
    Dev["Developer Workstation / GitHub"]:::external
    Client["Client / Scheduler"]:::external

    %% CI/CD and IaC
    CI["CI/CD Pipelines\n(GitHub Actions & Azure DevOps)"]:::cicd
    IaC["Infrastructure as Code\n(ARM & Bicep)"]:::infra

    %% Azure Resource Group
    RG["Azure Resource Group"]:::azure

    %% Catalog Layer
    subgraph "Samples Catalog"
        style Samples Catalog stroke:#333,stroke-width:2px
        subgraph "Connectors"
            AzureVM["AzureVM Connector"]:::codemodule
            Graph["Microsoft Graph Connector"]:::codemodule
        end
        templates["Logic App Workflow Templates"]:::codemodule

        subgraph "Demo Modules"
            AI_RAG["LogicApps AI RAG Demo Workflow"]:::codemodule
            AI_Sample["AI Sample Workflow"]:::codemodule
            ArcEnabled["Arc-enabled Logic App Sample"]:::codemodule
            DevOpsSample["Azure DevOps Sample"]:::codemodule
            Codeful["RecommendCoffee Codeful Workflow"]:::codemodule
            Labs["Twitter to Power BI Lab"]:::codemodule
        end

        scripts["Automation Scripts"]:::codemodule
        TestFramework[".NET Test Framework"]:::codemodule
    end

    %% Azure Runtime Services
    LogicApps["Azure Logic Apps Service"]:::azure
    Functions["Azure Functions"]:::azure
    ConnectorsRuntime["Custom API Connectors"]:::azure
    subgraph "External Azure Services"
        Storage[(Storage)]
        Queue[(Service Bus)]
        Cosmos[(Cosmos DB)]
        KeyVault[(Key Vault)]
    end

    %% Test Mock Host
    MockHost["MockHttpHost & WorkflowTestHost"]:::codemodule

    %% Connections
    Dev -->|push code| CI
    CI -->|deploy| IaC
    IaC -->|provision| RG
    RG --> LogicApps
    RG --> Functions
    RG --> ConnectorsRuntime

    Client -->|trigger| LogicApps
    LogicApps -->|invoke| Functions
    LogicApps -->|call| ConnectorsRuntime
    Functions -->|read/write| Storage
    Functions -->|enqueue| Queue
    LogicApps -->|read/write| Cosmos
    LogicApps -->|get secrets| KeyVault

    TestFramework --> MockHost
    MockHost -->|simulate calls| LogicApps

    %% Click Events for Mappings
    click AzureVM "https://github.com/azure/logicapps/tree/master/connectors/AzureVM"
    click Graph "https://github.com/azure/logicapps/tree/master/connectors/Microsoft Graph"
    click templates "https://github.com/azure/logicapps/tree/master/templates/"
    click AI_RAG "https://github.com/azure/logicapps/tree/master/LogicApps-AI-RAG-Demo/SampleAIWorkflows/"
    click AI_RAG "https://github.com/azure/logicapps/tree/master/LogicApps-AI-RAG-Demo/TokenizeDocFunction"
    click AI_Sample "https://github.com/azure/logicapps/tree/master/ai-sample/SampleAIWorkflows/"
    click AI_Sample "https://github.com/azure/logicapps/tree/master/ai-sample/TokenizeDocFunction"
    click ArcEnabled "https://github.com/azure/logicapps/tree/master/arc-enabled-logic-app-sample/env/"
    click ArcEnabled "https://github.com/azure/logicapps/tree/master/arc-enabled-logic-app-sample/src/"
    click DevOpsSample "https://github.com/azure/logicapps/tree/master/azure-devops-sample/.pipelines/"
    click DevOpsSample "https://github.com/azure/logicapps/tree/master/azure-devops-sample/deploy/"
    click DevOpsSample "https://github.com/azure/logicapps/tree/master/azure-devops-sample/logic/"
    click Codeful "https://github.com/azure/logicapps/tree/master/codeful-workflows/samples/recommend-coffee/codeful-logicapp-recommendcoffee"
    click Labs "https://github.com/azure/logicapps/tree/master/labs/twitter-to-powerbi"
    click scripts "https://github.com/azure/logicapps/tree/master/scripts/"
    click TestFramework "https://github.com/azure/logicapps/blob/master/LogicAppsSampleTestFramework/LogicAppsSampleTestFramework.sln"
    click TestFramework "https://github.com/azure/logicapps/tree/master/LogicAppsSampleTestFramework/TestCases/"
    click TestFramework "https://github.com/azure/logicapps/tree/master/LogicAppsSampleTestFramework/TestFramework/"
    click CI "https://github.com/azure/logicapps/tree/master/.github/workflows/"

    %% Styles
    classDef azure fill:#007FFF,stroke:#005BBB,color:#fff
    classDef infra fill:#00AA00,stroke:#007700,color:#fff
    classDef cicd fill:#FFA500,stroke:#CC8400,color:#000
    classDef codemodule fill:#888888,stroke:#555555,color:#fff
    classDef external fill:#CCCCCC,stroke:#999999,color:#000
```
