Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 63 additions & 1 deletion Aspire.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
Expand Down Expand Up @@ -675,6 +674,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.Azure.Npgsql.EntityF
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.Components.Common.Tests", "tests\Aspire.Components.Common.Tests\Aspire.Components.Common.Tests.csproj", "{30950CEB-2232-F9FC-04FF-ADDCB8AC30A7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AzurePublisher", "AzurePublisher", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AzurePublisher.AppHost", "playground\AzurePublisher\AzurePublisher.AppHost\AzurePublisher.AppHost.csproj", "{3B312ABD-6D11-445C-B18C-DC1D66014D7B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AzurePublisher.ServiceDefaults", "playground\AzurePublisher\AzurePublisher.ServiceDefaults\AzurePublisher.ServiceDefaults.csproj", "{86FF3776-D6AA-EBE6-1886-BFBE60D9ACD2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AzurePublisher.ApiService", "playground\AzurePublisher\AzurePublisher.ApiService\AzurePublisher.ApiService.csproj", "{C6B26D24-780B-3E13-29BD-14B473002C43}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AzurePublisher.Web", "playground\AzurePublisher\AzurePublisher.Web\AzurePublisher.Web.csproj", "{245A3314-4CE2-3EE9-90CD-8E264C462225}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -3961,6 +3970,54 @@ Global
{30950CEB-2232-F9FC-04FF-ADDCB8AC30A7}.Release|x64.Build.0 = Release|Any CPU
{30950CEB-2232-F9FC-04FF-ADDCB8AC30A7}.Release|x86.ActiveCfg = Release|Any CPU
{30950CEB-2232-F9FC-04FF-ADDCB8AC30A7}.Release|x86.Build.0 = Release|Any CPU
{3B312ABD-6D11-445C-B18C-DC1D66014D7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B312ABD-6D11-445C-B18C-DC1D66014D7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B312ABD-6D11-445C-B18C-DC1D66014D7B}.Debug|x64.ActiveCfg = Debug|Any CPU
{3B312ABD-6D11-445C-B18C-DC1D66014D7B}.Debug|x64.Build.0 = Debug|Any CPU
{3B312ABD-6D11-445C-B18C-DC1D66014D7B}.Debug|x86.ActiveCfg = Debug|Any CPU
{3B312ABD-6D11-445C-B18C-DC1D66014D7B}.Debug|x86.Build.0 = Debug|Any CPU
{3B312ABD-6D11-445C-B18C-DC1D66014D7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B312ABD-6D11-445C-B18C-DC1D66014D7B}.Release|Any CPU.Build.0 = Release|Any CPU
{3B312ABD-6D11-445C-B18C-DC1D66014D7B}.Release|x64.ActiveCfg = Release|Any CPU
{3B312ABD-6D11-445C-B18C-DC1D66014D7B}.Release|x64.Build.0 = Release|Any CPU
{3B312ABD-6D11-445C-B18C-DC1D66014D7B}.Release|x86.ActiveCfg = Release|Any CPU
{3B312ABD-6D11-445C-B18C-DC1D66014D7B}.Release|x86.Build.0 = Release|Any CPU
{86FF3776-D6AA-EBE6-1886-BFBE60D9ACD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{86FF3776-D6AA-EBE6-1886-BFBE60D9ACD2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{86FF3776-D6AA-EBE6-1886-BFBE60D9ACD2}.Debug|x64.ActiveCfg = Debug|Any CPU
{86FF3776-D6AA-EBE6-1886-BFBE60D9ACD2}.Debug|x64.Build.0 = Debug|Any CPU
{86FF3776-D6AA-EBE6-1886-BFBE60D9ACD2}.Debug|x86.ActiveCfg = Debug|Any CPU
{86FF3776-D6AA-EBE6-1886-BFBE60D9ACD2}.Debug|x86.Build.0 = Debug|Any CPU
{86FF3776-D6AA-EBE6-1886-BFBE60D9ACD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{86FF3776-D6AA-EBE6-1886-BFBE60D9ACD2}.Release|Any CPU.Build.0 = Release|Any CPU
{86FF3776-D6AA-EBE6-1886-BFBE60D9ACD2}.Release|x64.ActiveCfg = Release|Any CPU
{86FF3776-D6AA-EBE6-1886-BFBE60D9ACD2}.Release|x64.Build.0 = Release|Any CPU
{86FF3776-D6AA-EBE6-1886-BFBE60D9ACD2}.Release|x86.ActiveCfg = Release|Any CPU
{86FF3776-D6AA-EBE6-1886-BFBE60D9ACD2}.Release|x86.Build.0 = Release|Any CPU
{C6B26D24-780B-3E13-29BD-14B473002C43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C6B26D24-780B-3E13-29BD-14B473002C43}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C6B26D24-780B-3E13-29BD-14B473002C43}.Debug|x64.ActiveCfg = Debug|Any CPU
{C6B26D24-780B-3E13-29BD-14B473002C43}.Debug|x64.Build.0 = Debug|Any CPU
{C6B26D24-780B-3E13-29BD-14B473002C43}.Debug|x86.ActiveCfg = Debug|Any CPU
{C6B26D24-780B-3E13-29BD-14B473002C43}.Debug|x86.Build.0 = Debug|Any CPU
{C6B26D24-780B-3E13-29BD-14B473002C43}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C6B26D24-780B-3E13-29BD-14B473002C43}.Release|Any CPU.Build.0 = Release|Any CPU
{C6B26D24-780B-3E13-29BD-14B473002C43}.Release|x64.ActiveCfg = Release|Any CPU
{C6B26D24-780B-3E13-29BD-14B473002C43}.Release|x64.Build.0 = Release|Any CPU
{C6B26D24-780B-3E13-29BD-14B473002C43}.Release|x86.ActiveCfg = Release|Any CPU
{C6B26D24-780B-3E13-29BD-14B473002C43}.Release|x86.Build.0 = Release|Any CPU
{245A3314-4CE2-3EE9-90CD-8E264C462225}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{245A3314-4CE2-3EE9-90CD-8E264C462225}.Debug|Any CPU.Build.0 = Debug|Any CPU
{245A3314-4CE2-3EE9-90CD-8E264C462225}.Debug|x64.ActiveCfg = Debug|Any CPU
{245A3314-4CE2-3EE9-90CD-8E264C462225}.Debug|x64.Build.0 = Debug|Any CPU
{245A3314-4CE2-3EE9-90CD-8E264C462225}.Debug|x86.ActiveCfg = Debug|Any CPU
{245A3314-4CE2-3EE9-90CD-8E264C462225}.Debug|x86.Build.0 = Debug|Any CPU
{245A3314-4CE2-3EE9-90CD-8E264C462225}.Release|Any CPU.ActiveCfg = Release|Any CPU
{245A3314-4CE2-3EE9-90CD-8E264C462225}.Release|Any CPU.Build.0 = Release|Any CPU
{245A3314-4CE2-3EE9-90CD-8E264C462225}.Release|x64.ActiveCfg = Release|Any CPU
{245A3314-4CE2-3EE9-90CD-8E264C462225}.Release|x64.Build.0 = Release|Any CPU
{245A3314-4CE2-3EE9-90CD-8E264C462225}.Release|x86.ActiveCfg = Release|Any CPU
{245A3314-4CE2-3EE9-90CD-8E264C462225}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -4285,6 +4342,11 @@ Global
{192747A2-9338-DECF-5C8C-28EB8E13829B} = {27381127-6C45-4B4C-8F18-41FF48DFE4B2}
{8FCA0CFA-7823-6A2F-342A-107A994915B0} = {C424395C-1235-41A4-BF55-07880A04368C}
{30950CEB-2232-F9FC-04FF-ADDCB8AC30A7} = {C424395C-1235-41A4-BF55-07880A04368C}
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {D173887B-AF42-4576-B9C1-96B9E9B3D9C0}
{3B312ABD-6D11-445C-B18C-DC1D66014D7B} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{86FF3776-D6AA-EBE6-1886-BFBE60D9ACD2} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{C6B26D24-780B-3E13-29BD-14B473002C43} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{245A3314-4CE2-3EE9-90CD-8E264C462225} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {47DCFECF-5631-4BDE-A1EC-BE41E90F60C4}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\AzurePublisher.ServiceDefaults\AzurePublisher.ServiceDefaults.csproj" />
</ItemGroup>

<ItemGroup>
<AspireProjectOrPackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
</ItemGroup>

</Project>
45 changes: 45 additions & 0 deletions playground/AzurePublisher/AzurePublisher.ApiService/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
var builder = WebApplication.CreateBuilder(args);

// Add service defaults & Aspire client integrations.
builder.AddServiceDefaults();

// Add services to the container.
builder.Services.AddProblemDetails();

// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddOpenApi();

var app = builder.Build();

// Configure the HTTP request pipeline.
app.UseExceptionHandler();

if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
}

string[] summaries = ["Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"];

app.MapGet("/weatherforecast", () =>
{
var forecast = Enumerable.Range(1, 5).Select(index =>
new WeatherForecast
(
DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
Random.Shared.Next(-20, 55),
summaries[Random.Shared.Next(summaries.Length)]
))
.ToArray();
return forecast;
})
.WithName("GetWeatherForecast");

app.MapDefaultEndpoints();

app.Run();

record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
{
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "http://localhost:5320",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "https://localhost:7356;http://localhost:5320",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireHost>true</IsAspireHost>
<UserSecretsId>dc659251-92e0-4d41-8538-7ff0247e5dd0</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\AzurePublisher.ApiService\AzurePublisher.ApiService.csproj" />
<ProjectReference Include="..\AzurePublisher.Web\AzurePublisher.Web.csproj" />
</ItemGroup>

<ItemGroup>
<AspireProjectOrPackageReference Include="Aspire.Hosting.AppHost"/>
<AspireProjectOrPackageReference Include="Aspire.Hosting.Redis"/>
<AspireProjectOrPackageReference Include="Aspire.Hosting.Azure" />
</ItemGroup>

</Project>
19 changes: 19 additions & 0 deletions playground/AzurePublisher/AzurePublisher.AppHost/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

var builder = DistributedApplication.CreateBuilder(args);

builder.AddAzurePublisher("azurepublisher");

var cache = builder.AddRedis("cache");

var apiService = builder.AddProject<Projects.AzurePublisher_ApiService>("apiservice");

builder.AddProject<Projects.AzurePublisher_Web>("webfrontend")
.WithExternalHttpEndpoints()
.WithReference(cache)
.WaitFor(cache)
.WithReference(apiService)
.WaitFor(apiService);

builder.Build().Run();
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:17128;http://localhost:15089",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21044",
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22195"
}
},
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:15089",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19118",
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20013"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Aspire.Hosting.Dcp": "Warning"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireSharedProject>true</IsAspireSharedProject>
</PropertyGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />

<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="9.0.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
</ItemGroup>

</Project>
Loading
Loading