You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1434d2b
Browse filesBrowse the repository at this point in the historyBrowse files
Port the Vacation Planner web app samples to .NET 10 (#120)
* Point Terraform samples at azure.localhost.localstack.cloud:4566
Use the Azure-scoped emulator host as the azurerm provider metadata_host in
every sample's providers.tf and in the Terraform READMEs that quote it, so
the documented configuration matches what the deploy scripts apply.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Add .NET 10 ports of the custom-image and managed-identity web app samples
Introduce the ASP.NET Core Razor Pages port of the Vacation Planner used by
every web-app sample: one Index page with TempData flash messages, a Delete
page keyed on the store id, an IActivityStore abstraction initialized at
startup, a /health endpoint, and Kestrel binding to the PORT that App Service
and the emulator inject. The custom-image variant serves the same info page
and /api/status from a multi-stage sdk:10.0 -> aspnet:10.0 image; the
managed-identity variant stores one blob per activity through
DefaultAzureCredential.
Deployment artifacts mirror the Python siblings: DOTNETCORE|10.0 code
deployment with the project source zipped for the Oryx build, dotnet_version
in Terraform, runtimeName 'dotnetcore' in Bicep, unchanged WEBSITES_PORT
values and validation scripts. Register both samples in run-samples.sh, link
them from the root README and normalize line endings for C# sources.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Add the .NET 10 port of the SQL Database web app sample; describe every sample in the root README
The Vacation Planner reads its SQL connection string from the Key Vault
secret (falling back to SQL_* variables or a Microsoft Entra token), serves
HTTPS on port 8443 with the Key Vault certificate, and exposes /update/{id}
and /api/certificate like the Python sample; get-web-app-url.sh now fails
when the 8443 endpoint or its certificate cannot be retrieved instead of
comparing two empty thumbprints. InvariantGlobalization is dropped from the
template because Microsoft.Data.SqlClient cannot open connections in
invariant mode.
The root README outline gains an introduction, a longer description per
sample, the implementation language in parentheses, and separate Python and
.NET links for the web-app samples.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Add the .NET 10 port of the MySQL flexible server web app sample
MySqlConnector store with the same idempotent DDL, md5 ids, 30x2s startup
retry and TLS-without-verification semantics (MYSQL_SSL) as the Python
sample; artifacts switch to DOTNETCORE|10.0 with a source zip for the Oryx
build, dotnet_version in Terraform and 'dotnetcore' in Bicep.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Add the .NET 10 port of the PostgreSQL flexible server web app sample
Npgsql store with the same DDL, indexes, md5 ids, 30x2s startup retry and
libpq "prefer" TLS semantics as the Python sample; artifacts switch to
DOTNETCORE|10.0 with a source zip for the Oryx build, dotnet_version in
Terraform and 'dotnetcore' in Bicep.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Add the .NET 10 port of the Cosmos DB for MongoDB web app sample
MongoDB.Driver store keeping the {_id, username, activity, timestamp}
documents, md5 ids and the three indexes of the Python sample, created once at
startup instead of on every operation; artifacts switch to DOTNETCORE|10.0
with a source zip for the Oryx build, dotnet_version in Terraform and
'dotnetcore' in Bicep. call-web-app.sh probes container port 8000, the port
this sample sets through WEBSITES_PORT, instead of 80.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Add the .NET 10 port of the Cosmos DB for NoSQL web app sample
Microsoft.Azure.Cosmos store in Gateway mode (the emulator exposes the account
endpoint over HTTPS only), keeping the {id, username, activity, timestamp}
items partitioned by /username, the 400 RU container created on demand and
id-keyed deletes of the Python sample; scripts-only deployment as in the
Python sibling, switched to DOTNETCORE:10.0 with a source zip.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Log requests and store operations in the .NET web app samples
The port kept only the startup and store-initialization logs, so nothing
appeared in the container log while adding, updating or deleting an activity —
unlike the Python samples, which log a gunicorn access line per request, the
store operation (with the affected documents) and an application-level
"Activity added/updated" line.
Add the same three layers to every .NET sample: a one-line access log
("POST / -> 302 in 45.3ms") from a small middleware, the store operation with
its documents or affected-row counts, and "Activity added/updated/deleted" from
the page handlers. Each store logs at the granularity its Python counterpart
does: full documents for Cosmos DB (MongoDB and NoSQL APIs), blob names and
sizes for Blob Storage, row counts and ids for SQL Database, retrieval counts
for the MySQL and PostgreSQL flexible servers.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Update the architecture diagram of the Cosmos DB for MongoDB .NET sample
The .NET sample now carries its own Visio drawing and rendered PNG instead of
the copies inherited from the Python sibling.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Unify the SQL Database call script name and register the NoSQL .NET sample in CI
The .NET SQL Database sample's get-web-app-url.sh becomes call-web-app.sh, the
name every other sample uses and the one its Python sibling's README already
documented; the Python script is renamed with it so both run-samples.sh entries
resolve. The renamed .NET copy keeps the strict certificate checks (a failed
call, an empty thumbprint or a missing TLS certificate now exit 1 instead of
comparing two empty strings).
Also from manual validation of the samples: the Terraform deployments use the
local-* resource naming of the script deployments and pass secret_name through,
and the validate/README instructions show how to read the web app host name.
Register samples/web-app-cosmosdb-nosql-api/dotnet in run-samples.sh; it was
the only validated .NET web app missing from the matrix, which now builds 17
web-app-*/dotnet jobs.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Fix the NoSQL deploy script's working directory and the certificate subject check
Two CI failures that survived four re-runs were deterministic, not flaky:
- web-app-cosmosdb-nosql-api/scripts/deploy.sh did `cd "../src"` without
anchoring to the script's own location, so it worked when run from scripts/
but not as `bash scripts/deploy.sh` from the sample root, which is how
run-samples.sh invokes it: `cd: ../src: No such file or directory`. Both
language variants now set CURRENT_DIR the way every other sample does.
- The SQL Database certificate check compared distinguished names literally,
so OpenSSL 3's "CN = sample-web-app-sql" never matched Key Vault's
"CN=sample-web-app-sql". Both are normalized before comparing (leading "/"
and the spaces around "=" of the OpenSSL 1 and 3 spellings), and the match
is a fixed-string one so a CN with regex metacharacters cannot misfire.
The Python copy of that check also stops reporting success when there is
nothing to check: its app only serves HTTPS on 8443 when started directly, so
under gunicorn the old code compared two empty thumbprints and called them
equal. It now says the port is not served and skips.
From the Copilot review: the NoSQL delete flash message reads "Activity
deleted." like the Python sample, and the unused Docker helper functions are
gone from the custom-image call script.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Retry a stalled emulator start and a failed sample once before failing the job
Of the 11 jobs that failed on the first run of the samples workflow, 8 were in
samples this branch does not touch and went green when re-run by hand: two
never reached the sample at all (`localstack wait -t 600` expired while ~80
jobs competed for runner I/O and image pulls) and one hit a transient 500 from
the emulator while creating a MySQL firewall rule.
Automate what the manual re-runs were doing:
- the emulator start gets one clean retry, printing the container's last log
lines when the first wait expires;
- the sample runs with continue-on-error and, on failure, once more against a
freshly restarted emulator, because the deploy scripts are not idempotent and
would otherwise re-run against half-provisioned resources. A genuinely broken
sample fails both attempts, so it still fails the job.
The job also gets a 90-minute bound: a sample takes 10-25 minutes, a retry
doubles the worst case, and a hung deployment would otherwise hold a runner for
GitHub's 6-hour default.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Survive the emulator's transient firewall-rule 500 and a stalled emulator start
The samples workflow came back with 2 failures out of 78 (from 11), and both
were emulator-side transients rather than sample defects:
- web-app-mysql-flexible-server/dotnet failed twice, both times on
`az mysql flexible-server firewall-rule create` answering 500. The Azure
CLI's own retries all land within ~5 seconds of each other, which is too
early: the PUT succeeds once the server finishes provisioning. The create is
now retried five times at 10-second intervals in the MySQL and PostgreSQL
samples (both languages, since the blocks were identical), and a persistent
failure warns instead of aborting: the rule only governs public network
access, which the emulator does not enforce, and the database bootstrap a few
lines later fails loudly if the server is genuinely unreachable.
- aci-blob-storage/python/bicep failed on an arm64 runner because the emulator
never became ready - the container logged nothing for the last ten minutes of
each 600-second wait, so the boot had stalled rather than slowed. The
readiness retry now makes three 400-second attempts instead of two
600-second ones: the same overall budget, one more chance, and a stalled
container is replaced sooner.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+22-20Lines changed: 22 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,26 +27,28 @@ This repository contains comprehensive sample projects demonstrating how to deve
27
27
28
28
## Outline
29
29
30
-
| Sample Name | Description |
31
-
|-------------|-------------|
32
-
|[Function App and Storage](./samples/function-app-storage-http/dotnet/README.md)| Azure Functions App using Blob, Queue, and Table Storage |
33
-
|[Function App and Front Door](./samples/function-app-front-door/python/README.md)| Azure Functions App exposed via Front Door |
34
-
|[Function App and Managed Identities](./samples/function-app-managed-identity/python/README.md)| Azure Function App using Managed Identities |
35
-
|[Function App and Service Bus](./samples/function-app-service-bus/dotnet/README.md)| Azure Function App using Service Bus |
36
-
|[Web App and CosmosDB for MongoDB API ](./samples/web-app-cosmosdb-mongodb-api/python/README.md)| Azure Web App using CosmosDB for MongoDB API |
37
-
|[Web App and CosmosDB for NoSQL API ](./samples/web-app-cosmosdb-nosql-api/python/README.md)| Azure Web App using CosmosDB for NoSQL API |
38
-
|[Web App and Managed Identities](./samples/web-app-managed-identity/python/README.md)| Azure Web App using Managed Identities |
39
-
|[Web App and SQL Database ](./samples/web-app-sql-database/python/README.md)| Azure Web App using SQL Database |
40
-
|[Web App and PostgreSQL Database ](./samples/web-app-postgresql-flexible-server/python/README.md)| Azure Web App using PostgreSQL Database |
41
-
|[Web App and MySQL Database ](./samples/web-app-mysql-flexible-server/python/README.md)| Azure Web App using MySQL Database |
42
-
|[Web App with Custom Docker Image](./samples/web-app-custom-image/python/README.md)| Azure Web App running a custom Docker image |
43
-
|[ACI and Blob Storage](./samples/aci-blob-storage/python/README.md)| Azure Container Instances with ACR, Key Vault, and Blob Storage |
44
-
|[Container Apps and Blob Storage](./samples/container-apps-blob-storage/python/README.md)| Azure Container Apps running a guestbook app from ACR with Blob Storage, secrets, revisions, replicas and scale rules |
45
-
|[Azure Service Bus with Spring Boot](./samples/servicebus/java/README.md)| Azure Service Bus used by a Spring Boot application |
46
-
|[URL Shortener](./samples/url-shortener/python/README.md)| URL shortener composing Web App, Functions, Storage, Key Vault, Service Bus and PostgreSQL |
47
-
|[Event Hubs Fraud Detection Pipeline](./samples/eventhubs/python/README.md)| Real-time payment stream processing with Event Hubs (AMQP, Kafka and HTTPS ingestion, Capture, Schema Registry), an Event Hubs-triggered Function App, Key Vault, Storage and a Web App dashboard |
48
-
|[Event Hubs Cold-Path Automation](./samples/eventhubs-eventgrid/python/README.md)| Event Hubs Capture raises `Microsoft.EventHub.CaptureFileCreated` to an Event Grid system topic, a subscription delivers it into a second event hub, and an Event Hubs-triggered Function App decodes each Avro archive and writes per-device summaries |
49
-
30
+
Each sample is a self-contained project with its own README, Azure CLI scripts and, where applicable, Bicep and Terraform deployments that target both real Azure and the LocalStack for Azure emulator. The language of each implementation is shown in parentheses; the web-app samples share the same *Vacation Planner* application and come in a Python (Flask) and a .NET 10 (ASP.NET Core Razor Pages) version.
31
+
32
+
| Sample | Description |
33
+
|--------|-------------|
34
+
|[Function App and Storage (.NET)](./samples/function-app-storage-http/dotnet/README.md)| A gaming scoreboard built on Azure Functions (isolated worker): HTTP triggers record player scores in Table Storage, publish messages to Queue Storage and write game-session summaries to Blob Storage, all against the emulated storage account. |
35
+
|[Function App and Front Door (Python)](./samples/function-app-front-door/python/README.md)| A minimal Python Function App answering `/{name}`, published behind an Azure Front Door (Standard) profile so requests reach the function through the Front Door endpoint; deployable to real Azure or to the emulator. |
36
+
|[Function App and Managed Identities (Python)](./samples/function-app-managed-identity/python/README.md)| A serverless text processor: an Azure Functions app reads text blobs from an `input` container, converts them to uppercase and writes the result to an `output` container, authenticating to the storage account with a managed identity instead of keys. |
37
+
|[Function App and Service Bus (.NET)](./samples/function-app-service-bus/dotnet/README.md)| An Azure Functions app on an App Service plan that exchanges messages through Service Bus queues: an HTTP trigger sends greetings and a queue trigger consumes them, connecting with either a connection string or a managed identity. |
38
+
| Web App and CosmosDB for MongoDB API ([Python](./samples/web-app-cosmosdb-mongodb-api/python/README.md), [.NET](./samples/web-app-cosmosdb-mongodb-api/dotnet/README.md)) | The *Vacation Planner* single-page web app on an Azure Web App with regional VNet integration, storing activities in the `activities` collection of an Azure Cosmos DB for MongoDB account reached through a private endpoint. |
39
+
| Web App and CosmosDB for NoSQL API ([Python](./samples/web-app-cosmosdb-nosql-api/python/README.md), [.NET](./samples/web-app-cosmosdb-nosql-api/dotnet/README.md)) | The *Vacation Planner* single-page web app on an Azure Web App, storing activities as JSON items in the `activities` container of an Azure Cosmos DB for NoSQL database partitioned by user; deployed with Azure CLI scripts. |
40
+
| Web App and Managed Identities ([Python](./samples/web-app-managed-identity/python/README.md), [.NET](./samples/web-app-managed-identity/dotnet/README.md)) | The *Vacation Planner* single-page web app on an Azure Web App, storing each activity as a blob in an `activities` container and accessing Blob Storage through a user-assigned or system-assigned managed identity rather than connection strings. |
41
+
| Web App and SQL Database ([Python](./samples/web-app-sql-database/python/README.md), [.NET](./samples/web-app-sql-database/dotnet/README.md)) | The *Vacation Planner* single-page web app on an Azure Web App, storing activities in an Azure SQL Database. The connection string and the HTTPS certificate are read from Azure Key Vault, and an API endpoint verifies the Key Vault certificate. |
42
+
| Web App and PostgreSQL Database ([Python](./samples/web-app-postgresql-flexible-server/python/README.md), [.NET](./samples/web-app-postgresql-flexible-server/dotnet/README.md)) | The *Vacation Planner* single-page web app on an Azure Web App, storing activities in an Azure Database for PostgreSQL flexible server injected into a virtual network (delegated subnet and private DNS zone), with the database and application user created by the deploy scripts. |
43
+
| Web App and MySQL Database ([Python](./samples/web-app-mysql-flexible-server/python/README.md), [.NET](./samples/web-app-mysql-flexible-server/dotnet/README.md)) | The *Vacation Planner* single-page web app on an Azure Web App, storing activities in an Azure Database for MySQL flexible server injected into a virtual network, using TLS-only connections, with the database and application user created by the deploy scripts. |
44
+
| Web App with Custom Docker Image ([Python](./samples/web-app-custom-image/python/README.md), [.NET](./samples/web-app-custom-image/dotnet/README.md)) | A web app that runs a custom container image built locally and pushed to Azure Container Registry; the web app pulls it with a managed identity (AcrPull) through a VNet-integrated network and reports its image and host name on `/api/status`. |
45
+
|[ACI and Blob Storage (Python)](./samples/aci-blob-storage/python/README.md)| A containerized Flask web app on Azure Container Instances, with its image in Azure Container Registry, its secrets in Key Vault and its data in Blob Storage. |
46
+
|[Container Apps and Blob Storage (Python)](./samples/container-apps-blob-storage/python/README.md)| A guestbook web app on Azure Container Apps pulled from Azure Container Registry that persists entries in Blob Storage and exercises secrets, revisions, replicas and scale rules. |
47
+
|[Azure Service Bus with Spring Boot (Java)](./samples/servicebus/java/README.md)| A Java Spring Boot application that sends and receives Service Bus messages through the Spring Cloud Azure Service Bus Stream Binder. |
48
+
|[URL Shortener (Python)](./samples/url-shortener/python/README.md)|*Linklet*, a Flask URL shortener on an Azure Web App with an event-driven Azure Functions worker, composing Web App, Functions, Storage, Key Vault, Service Bus and PostgreSQL into a single causal chain. |
49
+
|[Event Hubs Fraud Detection Pipeline (Python)](./samples/eventhubs/python/README.md)| A streaming platform in miniature: payments ingested into Event Hubs over AMQP, Kafka and HTTPS, validated against Schema Registry, archived with Capture, scored by an Event Hubs-triggered Function App and shown on a Web App dashboard, with secrets in Key Vault. |
50
+
|[Event Hubs Cold-Path Automation (Python)](./samples/eventhubs-eventgrid/python/README.md)| A cold-chain monitoring pipeline in which Event Hubs Capture raises `Microsoft.EventHub.CaptureFileCreated` events to an Event Grid system topic; a subscription delivers them into a second event hub and an Event Hubs-triggered Function App decodes each Avro archive into per-device summaries. |
51
+
50
52
## Sample Structure
51
53
52
54
Each sample project is organized by Azure service and includes:
0 commit comments