Skip to content

Latest commit

 

History

History
57 lines (38 loc) · 2.3 KB

File metadata and controls

57 lines (38 loc) · 2.3 KB

Local debug scripts

Helpers to launch the workshop demo apps locally without having to remember the dotnet flags.

Script Purpose
start-local.ps1 Default: builds and runs Mapaq.Api + Mapaq.Web as containers (docker compose up --build -d), polls the web app until it responds, then opens the browser. Pass -NoContainer for the classic dotnet run flow (two background pwsh windows on the https dev ports). Falls back to the dotnet flow automatically when Docker is unavailable.
stop-local.ps1 Tears down the docker compose stack and stops any Mapaq.Api / Mapaq.Web dotnet processes started by start-local.ps1.

Quick start

pwsh ./scripts/start-local.ps1

Container defaults (root compose.yaml):

Prefer the classic dotnet run flow? Add -NoContainer:

pwsh ./scripts/start-local.ps1 -NoContainer

-NoContainer defaults (from the project launchSettings.json):

The API falls back to an in-memory EF Core database when no SQL connection string is supplied, so no Azure SQL or LocalDB is required for a smoke debug session.

Wire up real telemetry (optional)

$cs = az monitor app-insights component show -g rg-workshop-dev -a appi-workshop-dev --query connectionString -o tsv
pwsh ./scripts/start-local.ps1 -NoContainer -ConnectionString $cs

This sets APPLICATIONINSIGHTS_CONNECTION_STRING, ApplicationInsights__ConnectionString, and AzureMonitor__ConnectionString for both processes so distributed traces land in your real App Insights resource. (-ConnectionString / -SqlConnectionString apply to the -NoContainer dotnet flow.)

Wire up real Azure SQL (optional)

pwsh ./scripts/start-local.ps1 -NoContainer `
    -ConnectionString $cs `
    -SqlConnectionString 'Server=tcp:sql-workshop.database.windows.net;Database=mapaq;Authentication=Active Directory Default;Encrypt=True;'

Stop

pwsh ./scripts/stop-local.ps1

Or close the spawned Mapaq.Api / Mapaq.Web pwsh windows (dotnet flow) / run docker compose down (container flow).