# ronaldbosma/azure-integration-services-quickstart architecture

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

- Interactive diagram: https://gitdiagram.com/ronaldbosma/azure-integration-services-quickstart
- Repository: https://github.com/ronaldbosma/azure-integration-services-quickstart

## Overview

##### Project Type and Purpose
- This repository is an Azure Integration Services “Quickstart” template. It’s a combined Infrastructure-as-Code (IaC) solution (using Bicep modules) plus a sample application (an API, Azure Function, and Logic App) designed for demos, experimentation, and CI workflows.
- The template deploys a set of Azure services (API Management, Function App, Logic App, Service Bus, Event Hubs namespace, Key Vault, Application Insights, Storage Account) and wires them up so that a message can be published via an API, processed by both a Function and a Logic App, and stored in Table/Blob storage.

##### File Structure & Architectural Patterns
- infra/
- functions/ – Bicep user-defined functions (naming conventions, helpers, tests)
- modules/
– application/ – application-specific resources (API in APIM, Service Bus topic/subscriptions, Storage table & container)
– services/ – modules for each Azure Integration Service (api-management.bicep, function-app.bicep, logic-app.bicep, service-bus.bicep, event-hubs-namespace.bicep, storage-account.bicep, key-vault.bicep, app-insights.bicep, etc.)
– shared/ – reusable modules (role assignments, app settings merge)
- main.bicep & main.parameters.json – top-level orchestration of included services
- src/
- functionApp/ – C# Azure Function project triggered off Service Bus messages, writes to Table Storage
- logicApp/ – Logic App Standard workflow triggered off Service Bus messages, writes to Blob Storage
- tests/tests.http – REST Client calls to the deployed API (publish message, get from table, get from blob)

##### Key Components & Interactions
a. Client → API Management
- HTTP POST “publish” call with subscription key
- HTTP GET calls for table-stored and blob-stored messages
b. API Management → Service Bus Topic
- APIM policy/back-end routes request to Service Bus topic
c. Service Bus Topic → Two Subscribers
- Azure Function (Consumption, .NET 9 isolated)
- Logic App Standard (WS1 tier, custom .NET code runtime)
d. Function App writes message to Storage Account Table
e. Logic App writes message to Storage Account Blob Container
f. Supporting services:
- Key Vault (stores APIM subscription key secret, referenced by Function & Logic App)
- Application Insights (logging & telemetry for API Management, Function, Logic App)
- Event Hubs namespace (optional, only if included)

##### Architectural Patterns & Principles
- Serverless / event-driven & pub/sub: Service Bus topic with multiple subscribers
- Infrastructure as Code: Bicep modules for services, application, shared functions, types
- Separation of concerns:
- “services” layer (all Azure services modules)
- “application” layer (resources for the sample app)
- “functions” layer (IaC helper logic)
- “code” layer (Function App + Logic App workflows)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Layers
    subgraph "External Client"
        Client["REST Client (tests/tests.http)"]
    end

    subgraph "Infrastructure (IaC)"
        direction TB
        mainb["Bicep Orchestration\ninfra/main.bicep"]:::iac
        subgraph "IaC Helper Functions"
            helpers["helpers.bicep"]:::iac
            naming["naming-conventions.bicep"]:::iac
        end
        subgraph "Shared Modules"
            assignRoles["assign-roles-to-principal.bicep"]:::iac
            mergeSettings["merge-app-settings.bicep"]:::iac
        end
        subgraph "Service Modules"
            apimMod["API Management Module\napi-management.bicep"]:::iac
            funcMod["Function App Module\nfunction-app.bicep"]:::iac
            logicMod["Logic App Module\nlogic-app.bicep"]:::iac
            sbMod["Service Bus Module\nservice-bus.bicep"]:::iac
            ehMod["Event Hubs Module\nevent-hubs-namespace.bicep"]:::iac
            storageMod["Storage Account Module\nstorage-account.bicep"]:::iac
            kvMod["Key Vault Module\nkey-vault.bicep"]:::iac
            aiMod["App Insights Module\napp-insights.bicep"]:::iac
        end
        subgraph "Application Modules"
            sampleApi["Sample API Module\nsample-api.bicep"]:::iac
            sbApp["Topics & Subscriptions\ntopics-and-subscriptions.bicep"]:::iac
            appStorageMod["App Storage Module\nstorage-account.bicep"]:::iac
        end
        mainb -->|orchestrates| helpers
        mainb --> naming
        mainb --> assignRoles
        mainb --> mergeSettings
        mainb --> apimMod
        mainb --> funcMod
        mainb --> logicMod
        mainb --> sbMod
        mainb --> ehMod
        mainb --> storageMod
        mainb --> kvMod
        mainb --> aiMod
        mainb --> sampleApi
        mainb --> sbApp
        mainb --> appStorageMod
    end

    subgraph "Application Code"
        direction TB
        funcCode["Function App Code\nsrc/functionApp"]:::code
        logicCode["Logic App Code\nsrc/logicApp"]:::code
    end

    %% Runtime components
    Client -->|"POST /publish\nGET /table/blob"| APIM
    APIM["API Management"]:::messaging
    ServiceBus["Service Bus Topic"]:::messaging
    EventHubs["Event Hubs Namespace (optional)"]:::messaging
    Function["Azure Function App"]:::compute
    LogicApp["Logic App"]:::compute
    TableStorage["Table Storage"]:::data
    BlobStorage["Blob Storage"]:::data
    KeyVault["Key Vault"]:::security
    AppInsights["Application Insights"]:::monitoring

    APIM -->|"route to topic"| ServiceBus
    ServiceBus -->|"publish message"| Function
    ServiceBus -->|"publish message"| LogicApp
    Function -->|"write entity"| TableStorage
    LogicApp -->|"write blob"| BlobStorage
    APIM -->|"get key"| KeyVault
    Function -->|"get secret"| KeyVault
    LogicApp -->|"get secret"| KeyVault
    Function -->|"log"| AppInsights
    LogicApp -->|"log"| AppInsights
    APIM -->|"telemetry"| AppInsights

    %% Click events
    click mainb "https://github.com/ronaldbosma/azure-integration-services-quickstart/blob/main/infra/main.bicep"
    click helpers "https://github.com/ronaldbosma/azure-integration-services-quickstart/blob/main/infra/functions/helpers.bicep"
    click naming "https://github.com/ronaldbosma/azure-integration-services-quickstart/blob/main/infra/functions/naming-conventions.bicep"
    click assignRoles "https://github.com/ronaldbosma/azure-integration-services-quickstart/blob/main/infra/modules/shared/assign-roles-to-principal.bicep"
    click mergeSettings "https://github.com/ronaldbosma/azure-integration-services-quickstart/blob/main/infra/modules/shared/merge-app-settings.bicep"
    click apimMod "https://github.com/ronaldbosma/azure-integration-services-quickstart/blob/main/infra/modules/services/api-management.bicep"
    click funcMod "https://github.com/ronaldbosma/azure-integration-services-quickstart/blob/main/infra/modules/services/function-app.bicep"
    click logicMod "https://github.com/ronaldbosma/azure-integration-services-quickstart/blob/main/infra/modules/services/logic-app.bicep"
    click sbMod "https://github.com/ronaldbosma/azure-integration-services-quickstart/blob/main/infra/modules/services/service-bus.bicep"
    click ehMod "https://github.com/ronaldbosma/azure-integration-services-quickstart/blob/main/infra/modules/services/event-hubs-namespace.bicep"
    click storageMod "https://github.com/ronaldbosma/azure-integration-services-quickstart/blob/main/infra/modules/services/storage-account.bicep"
    click kvMod "https://github.com/ronaldbosma/azure-integration-services-quickstart/blob/main/infra/modules/services/key-vault.bicep"
    click aiMod "https://github.com/ronaldbosma/azure-integration-services-quickstart/blob/main/infra/modules/services/app-insights.bicep"
    click sampleApi "https://github.com/ronaldbosma/azure-integration-services-quickstart/blob/main/infra/modules/application/sample-api/sample-api.bicep"
    click sbApp "https://github.com/ronaldbosma/azure-integration-services-quickstart/blob/main/infra/modules/application/service-bus/topics-and-subscriptions.bicep"
    click appStorageMod "https://github.com/ronaldbosma/azure-integration-services-quickstart/blob/main/infra/modules/application/storage-account/storage-account.bicep"
    click funcCode "https://github.com/ronaldbosma/azure-integration-services-quickstart/tree/main/src/functionApp"
    click logicCode "https://github.com/ronaldbosma/azure-integration-services-quickstart/tree/main/src/logicApp"

    %% Styles
    classDef compute fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef data fill:#90EE90,stroke:#333,stroke-width:1px
    classDef messaging fill:#FFA500,stroke:#333,stroke-width:1px
    classDef security fill:#D8BFD8,stroke:#333,stroke-width:1px
    classDef monitoring fill:#DDA0DD,stroke:#333,stroke-width:1px
    classDef iac fill:#F0E68C,stroke:#333,stroke-width:1px
    classDef code fill:#E6E6FA,stroke:#333,stroke-width:1px
```
