microsoftlearning/trainer-demo-deploy/az-webapp-development

Claude Code and agent skill by microsoftlearning/trainer-demo-deploy

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

.NET 10 C# sample web application scaffolding patterns, industry-specific seed data templates, Dockerfile generation, and azd service wiring for demo workload scenarios.

Install

npx vskill@latest install microsoftlearning/trainer-demo-deploy/az-webapp-development

SKILL.md

The same SKILL.md was published earlier as microsoftlearning/trainer-demo-deploy/az-webapp-development.

Webapp Development Skill

Patterns and templates for scaffolding .NET 10 C# sample web applications with industry-specific data for Azure demo scenarios. When the architecture includes a data service (Storage Table, SQL, Cosmos DB, etc.), the app uses that service as its data backend. Otherwise, it falls back to local JSON seed files. Covers project structure, data service patterns, container support, and azd integration.


1. Project Structure

Every sample webapp follows this layout:

text
generated-scenarios/{project}/src/{ProjectName}.Web/
├── {ProjectName}.Web.csproj
├── Program.cs
├── appsettings.json
├── appsettings.Development.json
├── Dockerfile # Container targets only
├── .dockerignore # Container targets only
├── Models/
│ ├── {Entity1}.cs
│ ├── {Entity2}.cs
│ └── {Entity3}.cs
├── Services/
│ └── SampleDataService.cs
├── SeedData/
│ ├── {entity1}s.json
│ ├── {entity2}s.json
│ └── {entity3}s.json
├── Pages/
│ ├── Index.cshtml
│ ├── Index.cshtml.cs
│ ├── {Entity1}/
│ │ ├── Index.cshtml
│ │ ├── Index.cshtml.cs
│ │ ├── Details.cshtml
│ │ └── Details.cshtml.cs
│ ├── {Entity2}/
│ │ └── ... (same pattern)
│ └── Shared/
│ ├── _Layout.cshtml
│ └── _ViewImports.cshtml
└── wwwroot/
├── css/
│ └── site.css
└── lib/
Naming Conventions
ElementConventionExample
Project folder{PascalCase}.WebHealthcareDemo.Web
Model classesPascalCase singularPatient, Doctor
Seed filescamelCase plural .jsonpatients.json
Pages foldersPascalCase plural of entityPages/Patients/
Service classSee data strategy belowDepends on backend
Data Strategy Decision
Architecture IncludesService ClassNuGet Packages Required
Storage Account (Table Storage)TableStorageDataServiceAzure.Data.Tables, Azure.Identity
SQL DatabaseSqlDataServiceMicrosoft.Data.SqlClient
Cosmos DB (NoSQL)CosmosDataServiceMicrosoft.Azure.Cosmos
Cosmos DB (Table API)TableStorageDataServiceAzure.Data.Tables, Azure.Identity
Redis CacheRedisDataServiceMicrosoft.Extensions.Caching.StackExchangeRedis
None of the aboveSampleDataService(none — local JSON fallback)
Rule: Use the Azure data service when one is present in the architecture.
Only fall back to SampleDataService with local JSON when no data endpoint exists.

2. Industry Data Templates

Healthcare

Models:

csharp
public class Doctor
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Specialty { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
public string Phone { get; set; } = string.Empty;
}
public class Patient
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public DateTime DateOfBirth { get; set; }
public string BloodType { get; set; } = string.Empty;
public int DoctorId { get; set; }
}
public class Appointment
{
public int Id { get; set; }
public int PatientId { get; set; }
public int DoctorId { get; set; }
public DateTime ScheduledAt { get; set; }
public string Reason { get; set; } = string.Empty;
public string Status { get; set; } = "Scheduled";
}

Seed data (doctors.json excerpt):

json
[
{
"Id": 1,
"Name": "Dr. Sarah Chen",
"Specialty": "Cardiology",
"Email": "s.chen@clinic.local",
"Phone": "555-0101"
},
{
"Id": 2,
"Name": "Dr. James Wilson",
"Specialty": "Neurology",
"Email": "j.wilson@clinic.local",
"Phone": "555-0102"
}
]
Retail

Models: Product, Category, Order

csharp
public class Product
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public decimal Price { get; set; }
public int CategoryId { get; set; }
public int StockQuantity { get; set; }
}
public class Category
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
}
public class Order
{
public int Id { get; set; }
public string CustomerName { get; set; } = string.Empty;
public DateTime OrderDate { get; set; }
public decimal TotalAmount { get; set; }
public string Status { get; set; } = "Pending";
public List<int> ProductIds { get; set; } = new();
}
Finance

Models: Account, Transaction, Customer

csharp
public class Customer
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
public DateTime MemberSince { get; set; }
}
public class Account
{
public int Id { get; set; }
public int CustomerId { get; set; }
public string AccountType { get; set; } = "Checking";
public decimal Balance { get; set; }
public string Currency { get; set; } = "USD";
}
public class Transaction
{
public int Id { get; set; }
public int AccountId { get; set; }
public DateTime Date { get; set; }
public decimal Amount { get; set; }
public string Type { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
}
Education

Models: Student, Course, Enrollment

Hospitality

Models: Room, Guest, Reservation

Logistics

Models: Shipment, Warehouse, Driver

Real Estate

Models: Property, Agent, Listing

Manufacturing

Models: Product, WorkOrder, Machine

For industries not listed: derive 2-4 entities from the project description,
following the same patterns (Id, Name, descriptive fields, status fields).

3. Data Service Pattern

The SampleDataService loads JSON seed data at startup and serves it in-memory.

csharp
using System.Text.Json;
public class SampleDataService
{
private readonly IWebHostEnvironment _env;
public SampleDataService(IWebHostEnvironment env)
{
_env = env;
}
public List<T> Load<T>(string fileName)
{
var path = Path.Combine(_env.ContentRootPath, "SeedData", fileName);
if (!File.Exists(path))
return new List<T>();
var json = File.ReadAllText(path);
return JsonSerializer.Deserialize<List<T>>(json, new JsonSerializerOptions
{
PropertyNameCaseInsensitive = true
}) ?? new List<T>();
}
}

Registration in `Program.cs`:

csharp
builder.Services.AddSingleton<SampleDataService>();

3b. Azure Data Backend Patterns

When the architecture includes a data service, use the patterns below instead of SampleDataService. The app should still include SeedData/ JSON files — these are used to seed the backend on first run if the data store is empty.

Azure Table Storage (Azure.Data.Tables)
csharp
using Azure.Data.Tables;
using Azure.Identity;
using System.Text.Json;
public class TableStorageDataService
{
private readonly TableServiceClient _serviceClient;
private readonly IWebHostEnvironment _env;
public TableStorageDataService(TableServiceClient serviceClient, IWebHostEnvironment env)
{
_serviceClient = serviceClient;
_env = env;
}
public async Task<List<T>> GetAllAsync<T>(string tableName) where T : class, ITableEntity, new()
{
var tableClient = _serviceClient.GetTableClient(tableName);
await tableClient.CreateIfNotExistsAsync();
var entities = new List<T>();
await foreach (var entity in tableClient.QueryAsync<T>())
{
entities.Add(entity);
}
return entities;
}
public async Task<T?> GetByIdAsync<T>(string tableName, string partitionKey, string rowKey) where T : class, ITableEntity, new()
{
var tableClient = _serviceClient.GetTableClient(tableName);
try
{
var response = await tableClient.GetEntityAsync<T>(partitionKey, rowKey);
return response.Value;
}
catch (Azure.RequestFailedException ex) when (ex.Status == 404)
{
return null;
}
}
public async Task SeedIfEmptyAsync<T>(string tableName, string seedFileName) where T : class, ITableEntity, new()
{
var tableClient = _serviceClient.GetTableClient(tableName);
await tableClient.CreateIfNotExistsAsync();
await foreach (var _ in tableClient.QueryAsync<T>(maxPerPage: 1))
{
return; // Table already has data
}
var path = Path.Combine(_env.ContentRootPath, "SeedData", seedFileName);
if (!File.Exists(path)) return;
var json = await File.ReadAllTextAsync(path);
var items = JsonSerializer.Deserialize<List<T>>(json, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });
if (items == null) return;
foreach (var item in items)
{
await tableClient.UpsertEntityAsync(item);
}
}
}

Registration in `Program.cs` (Table Storage):

csharp
var storageEndpoint = builder.Configuration["StorageAccountEndpoint"]
?? builder.Configuration["AZURE_STORAGE_ENDPOINT"]
?? throw new InvalidOperationException("Storage account endpoint not configured");
builder.Services.AddSingleton(new TableServiceClient(new Uri(storageEndpoint), new DefaultAzureCredential()));
builder.Services.AddSingleton<TableStorageDataService>();

Model adaptation for Table Storage entities:

Models must implement ITableEntity. Use PartitionKey + RowKey as the key:

csharp
using Azure;
using Azure.Data.Tables;
public class ProductEntity : ITableEntity
{
public string PartitionKey { get; set; } = "Products";
public string RowKey { get; set; } = string.Empty; // Use Id.ToString()
public DateTimeOffset? Timestamp { get; set; }
public ETag ETag { get; set; }
public string Name { get; set; } = string.Empty;
public string SKU { get; set; } = string.Empty;
public string Category { get; set; } = string.Empty;
public double UnitPrice { get; set; }
public int StockQuantity { get; set; }
public string Status { get; set; } = string.Empty;
}
Azure SQL (Microsoft.Data.SqlClient)
csharp
using Microsoft.Data.SqlClient;
public class SqlDataService
{
private readonly string _connectionString;
public SqlDataService(IConfiguration config)
{
_connectionString = config.GetConnectionString("SqlDb")
?? throw new InvalidOperationException("SQL connection string not configured");
}
public async Task<List<T>> QueryAsync<T>(string query, Func<SqlDataReader, T> map)
{
var results = new List<T>();
await using var conn = new SqlConnection(_connectionString);
await conn.OpenAsync();
await using var cmd = new SqlCommand(query, conn);
await using var reader = await cmd.ExecuteReaderAsync();
while (await reader.ReadAsync())
{
results.Add(map(reader));
}
return results;
}
}
Cosmos DB (Microsoft.Azure.Cosmos)
csharp
using Microsoft.Azure.Cosmos;
public class CosmosDataService
{
private readonly CosmosClient _client;
private readonly string _databaseName;

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
31
Repository forks
26
7-day trend score
17

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/microsoftlearning/trainer-demo-deploy/az-webapp-development/badge)](https://verified-skill.com/skills/microsoftlearning/trainer-demo-deploy/az-webapp-development)

Something wrong with this skill or its page? Tell us.