# giancarllotorres/iac-fabric-azureglobalai architecture

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

- Interactive diagram: https://gitdiagram.com/giancarllotorres/iac-fabric-azureglobalai
- Repository: https://github.com/giancarllotorres/iac-fabric-azureglobalai

## Overview

##### Project type and purpose
- This is an Infrastructure-as-Code (IaC) Terraform project for Azure and Microsoft Fabric.
- Its goal is to automate provisioning of a Terraform backend (core), then deploy Azure/Fabric resources (main) via CI/CD pipelines.

##### File structure
- Top-level files:
- InitialSetUp.ps1 – bootstraps environment-specific variables.
- README.md – project overview.
- core/ – Terraform code to provision the remote state backend (storage account, container, locks).
- main.tf, providers.tf, outputs.tf, variables.tf, versions.tf, vars/*.tfvars
- main/ – Terraform code that depends on core’s backend. Defines Azure resource groups, services, and Fabric objects.
- backend.tf + backend/*.backend.tfvars – points Terraform to the remote state.
- fabobjects.tf – Microsoft Fabric constructs.
- azure infrastructure definitions in main.tf, providers.tf, variables.tf, vars/*.tfvars
- pipelines/ – YAML definitions for automating two stages:
- pipeline-core.yml – runs core/ code.
- pipeline-main.yml – runs main/ code.
- pipeline-master.yml – orchestrates core then main.

##### README for additional insights
- Step-by-step deployment flow:
1) Run InitialSetUp.ps1
2) Trigger master pipeline → core pipeline → main pipeline
- Prerequisites: Terraform, Azure subscription, PowerShell, DevOps platform
- Emphasis on automated, repeatable, version-controlled provisioning.

a. Main components:
- Developer workstation (InitialSetUp.ps1)
- CI/CD platform (Azure DevOps or GitHub Actions) with three pipelines: master, core, main
- Terraform core module (core/) → Terraform remote state backend in Azure Storage
- Terraform main module (main/) → Azure resources & Fabric objects
- Azure subscription boundary containing:
– Storage account + container for state
– Resource groups, services (VMs, SQL, storage, etc.)
– Microsoft Fabric workspace and objects
b. Relationships & interactions:
1) Dev runs InitialSetUp.ps1 → updates .tfvars
2) Master pipeline triggers → invokes core pipeline
3) Core pipeline applies core/ code → provisions state backend
4) Master pipeline proceeds to main pipeline
5) Main pipeline applies main/ code → creates Azure & Fabric resources, storing state in the backend
c. Architectural patterns / design principles:
- Layered IaC: backend provisioning separate from main resources
- Git-driven CI/CD orchestrator
- Parameterization via tfvars for tst/prd environments
- Separation of concerns: state management vs. resource provisioning
d. Key technologies & frameworks:
- Terraform modules & workspaces
- Azure Storage Account as Terraform state backend
- Azure DevOps pipelines (YAML) or GitHub Actions
- PowerShell bootstrap script
- Microsoft Fabric objects API via Terraform provider

##### Essential details
- Which tfvars file is used per environment.
- That core’s backend.tfvars and main’s backend.tfvars are separate.
- Call out the storage account name and container where state lives.
- Conditional logic or workspace selection if used.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Layer
    Dev["Developer Workstation"]:::dev
    README["README.md"]:::dev

    %% CI/CD Pipelines
    subgraph "CI/CD Platform" 
        direction TB
        MasterPipe["Master Pipeline"]:::cicd
        CorePipe["Core Pipeline"]:::cicd
        MainPipe["Main Pipeline"]:::cicd
    end

    %% Terraform Modules
    CoreModule["Core Terraform Module"]:::terraform
    MainModule["Main Terraform Module"]:::terraform

    %% Azure Subscription Boundary
    subgraph "Azure Subscription" 
        direction TB
        Storage["Terraform State Backend\n(Azure Storage)"]:::azure
        ResourceGroup["Resource Group & Services"]:::azure
        FabricWS["Fabric Workspace & Objects"]:::azure
    end

    %% Flow Relationships
    Dev -->|"runs InitialSetUp.ps1"| MasterPipe
    Dev -->|"views README.md"| README
    MasterPipe -->|"triggers"| CorePipe
    CorePipe -->|"applies core/ code"| CoreModule
    CoreModule -->|"provisions"| Storage
    MasterPipe -->|"triggers"| MainPipe
    MainPipe -->|"applies main/ code"| MainModule
    MainModule -->|"creates"| ResourceGroup
    MainModule -->|"deploys"| FabricWS

    %% Click Events
    click Dev "https://github.com/giancarllotorres/iac-fabric-azureglobalai/blob/main/InitialSetUp.ps1"
    click README "https://github.com/giancarllotorres/iac-fabric-azureglobalai/blob/main/README.md"
    click MasterPipe "https://github.com/giancarllotorres/iac-fabric-azureglobalai/blob/main/pipelines/pipeline-master.yml"
    click CorePipe "https://github.com/giancarllotorres/iac-fabric-azureglobalai/blob/main/pipelines/pipeline-core.yml"
    click MainPipe "https://github.com/giancarllotorres/iac-fabric-azureglobalai/blob/main/pipelines/pipeline-main.yml"
    click CoreModule "https://github.com/giancarllotorres/iac-fabric-azureglobalai/tree/main/core/"
    click MainModule "https://github.com/giancarllotorres/iac-fabric-azureglobalai/tree/main/main/"

    %% Styles
    classDef dev fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef cicd fill:#FFA500,stroke:#333,stroke-width:1px
    classDef terraform fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef azure fill:#90EE90,stroke:#333,stroke-width:1px
```
