Skip to content

Commit 09b4829

Browse files
committed
Add new projects and implement service defaults with OpenTelemetry
- Added new projects: AppHost, ServiceDefaults, ContentLoader, and Shared to the solution. - Implemented Extensions class in ServiceDefaults for adding common services including health checks and OpenTelemetry configuration. - Created ServiceDefaults.csproj with necessary package references for ASP.NET Core and OpenTelemetry. - Introduced Shared project with TipModel and ToolHighlight classes for shared data models. - Removed TipsController and replaced it with RandomTipModel for better encapsulation of tip data. - Updated ContentService to fetch tips from Azure Table Storage instead of local markdown files. - Refactored various pages and components to use the new shared models and updated service methods. - Added necessary using directives and updated view imports for shared models.
1 parent 2ecf0e7 commit 09b4829

33 files changed

Lines changed: 669 additions & 238 deletions

AppHost/AppHost.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Aspire.Hosting;
2+
using Projects;
3+
4+
var builder = DistributedApplication.CreateBuilder(args);
5+
6+
var storage = builder.AddAzureStorage("azure-storage")
7+
.RunAsEmulator(options =>
8+
{
9+
// Configure the Azure Storage Emulator options here if needed
10+
options.WithLifetime(ContainerLifetime.Persistent);
11+
});
12+
13+
var tables = storage.AddTables("tables");
14+
15+
var web = builder.AddProject<Web>("web")
16+
.WithReference(tables)
17+
.WaitFor(tables)
18+
.WithExternalHttpEndpoints();
19+
20+
builder.Build().Run();

AppHost/AppHost.csproj

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<Sdk Name="Aspire.AppHost.Sdk" Version="9.3.0" />
4+
5+
<PropertyGroup>
6+
<OutputType>Exe</OutputType>
7+
<TargetFramework>net9.0</TargetFramework>
8+
<ImplicitUsings>enable</ImplicitUsings>
9+
<Nullable>enable</Nullable>
10+
<UserSecretsId>21fabb30-ac7d-4818-8766-92672e7b369a</UserSecretsId>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.3.0" />
15+
<PackageReference Include="Aspire.Hosting.Azure.Storage" Version="9.3.0" />
16+
</ItemGroup>
17+
18+
<ItemGroup>
19+
<ProjectReference Include="..\Web\Web.csproj" />
20+
</ItemGroup>
21+
22+
</Project>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "https://json.schemastore.org/launchsettings.json",
3+
"profiles": {
4+
"https": {
5+
"commandName": "Project",
6+
"dotnetRunMessages": true,
7+
"launchBrowser": true,
8+
"applicationUrl": "https://localhost:17183;http://localhost:15298",
9+
"environmentVariables": {
10+
"ASPNETCORE_ENVIRONMENT": "Development",
11+
"DOTNET_ENVIRONMENT": "Development",
12+
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21003",
13+
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22092"
14+
}
15+
},
16+
"http": {
17+
"commandName": "Project",
18+
"dotnetRunMessages": true,
19+
"launchBrowser": true,
20+
"applicationUrl": "http://localhost:15298",
21+
"environmentVariables": {
22+
"ASPNETCORE_ENVIRONMENT": "Development",
23+
"DOTNET_ENVIRONMENT": "Development",
24+
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19031",
25+
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20229"
26+
}
27+
}
28+
}
29+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}

AppHost/appsettings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning",
6+
"Aspire.Hosting.Dcp": "Warning"
7+
}
8+
}
9+
}

Content/Tips/azure-ai-services-integration.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: "Azure AI Services Integration Quick Start"
3-
slug: "azure-ai-services-integration"
43
category: "Azure AI"
54
tags: ["azure", "ai-services", "integration", "apis", "cloud"]
65
difficulty: "Advanced"

Content/Tips/github-copilot-prompt-engineering.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: "GitHub Copilot Prompt Engineering Best Practices"
3-
slug: "github-copilot-prompt-engineering"
43
category: "GitHub Copilot"
54
tags: ["prompt-engineering", "best-practices", "productivity"]
65
difficulty: "Beginner"

Content/Tips/microsoft-365-copilot-shortcuts.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: "Microsoft 365 Copilot Power User Shortcuts"
3-
slug: "microsoft-365-copilot-shortcuts"
43
category: "Microsoft 365 Copilot"
54
tags: ["shortcuts", "productivity", "office-365", "power-user"]
65
difficulty: "Intermediate"

Content/Tips/multi-language-ai-development.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: "Multi-Language Code Examples for AI Development"
3-
slug: "multi-language-ai-development"
43
category: "Development"
54
tags: ["csharp", "javascript", "python", "powershell", "ai", "examples"]
65
difficulty: "Intermediate"

ContentLoader/ContentLoader.csproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net9.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Azure.Data.Tables" Version="12.11.0" />
12+
<PackageReference Include="Markdig" Version="0.41.2" />
13+
<PackageReference Include="YamlDotNet" Version="16.3.0" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<ProjectReference Include="..\Shared\Shared.csproj" />
18+
</ItemGroup>
19+
20+
</Project>

0 commit comments

Comments
 (0)