Skip to main content

Infrastructure Overview

Architecture Diagram

The Mastra Agent Framework is deployed as a containerized application with supporting Azure services for AI, storage, security, and networking.

Authentication Flow

Deployment Order

Resources are deployed in dependency order:

Resource Components

Core Infrastructure

ComponentPurposeSKU Options
Resource GroupContainer for all resourcesN/A
User-Assigned Managed IdentityPasswordless auth to all Azure servicesN/A

Compute

ComponentPurposeSKU Options
App Service PlanHosts App Service and Function AppF1, B1-B3, S1-S3, P0v3-P3v3
App ServiceMain API (container-based, Linux)Inherits from plan
Function AppBackground processing (container-based)Inherits from plan

Data & Storage

ComponentPurposeSKU Options
Azure SQL ServerPrimary relational databaseBasic, S0-S12, P1-P15
Storage AccountBlobs, Files, Tables, QueuesStandard_LRS
Container RegistryDocker image repositoryBasic, Standard, Premium

AI Services

ComponentPurposeSKU Options
Azure AI ServicesAzure AI model deploymentsS0
Content SafetyContent moderation for TAPF0, S0
Form RecognizerDocument IntelligenceF0, S0
AI SearchVector search, indexingBasic, Standard

Security & Networking

ComponentPurposeSKU Options
Key VaultSecrets, connection stringsStandard, Premium
API ManagementGateway, JWT/subscription authDeveloper, Basic, Standard
VNetNetwork isolationN/A
Private EndpointsPrivate connectivity to servicesN/A

Monitoring

ComponentPurposeSKU Options
Application InsightsLogging, metrics, tracesPay-as-you-go
Log Analytics WorkspaceLog aggregationPay-as-you-go

Resource Naming Convention

All resources follow a consistent naming pattern:

{environment}-{projectPrefix?}-{projectName}-{resourceType}

Examples

EnvironmentProject PrefixProject NameResourceFinal Name
dev-aitoolsApp Servicedev-aitools-app
stagingk12aitoolsSQL Serverstaging-k12-aitools-sql
prodtapaitoolsKey Vaultprod-tap-aitools-kv

Resource Group Naming

{ENVIRONMENT}-{projectPrefix?}-{projectName}-rg

Example: DEV-aitools-rg or STAGING-k12-aitools-rg

Private Endpoints Architecture

Only data-storing services require Private Endpoints:

note

Why no Private Endpoints for some services?

  • ACR: Basic SKU doesn't support PE; stores container images, not business data
  • Content Safety: Processes data transiently, no persistent storage
  • Form Recognizer: Processes documents transiently, no persistent storage
  • Template Parameters (template-parameters): Complete parameter reference
  • RBAC Permissions (permissions): Permission mapping for managed identity
  • Environment Configurations (environments): Dev vs Staging vs Prod differences
  • Networking & Security (networking): VNet, Private Endpoints, Service Endpoints
  • Cost Estimates (cost-estimates): Detailed cost breakdown by environment