diff --git a/docs/media/messaging-project.png b/docs/media/messaging-project.png index 71c5abf7ff..b7d83883c4 100644 Binary files a/docs/media/messaging-project.png and b/docs/media/messaging-project.png differ diff --git a/docs/messaging/messaging-components.md b/docs/messaging/messaging-components.md index 775d0538b3..ee048e9f18 100644 --- a/docs/messaging/messaging-components.md +++ b/docs/messaging/messaging-components.md @@ -1,7 +1,7 @@ --- title: Use .NET Aspire messaging components in ASP.NET Core description: Learn how to connect an ASP.NET Core app to messaging services using .NET Aspire components. -ms.date: 05/14/2024 +ms.date: 05/22/2024 ms.topic: tutorial --- @@ -28,10 +28,10 @@ Alternatively: - **Azure CLI**: Run the following commands in the Azure CLI or CloudShell to set up the required Azure Service Bus resources: ```azurecli-interactive - az group create -n -location eastus + az group create -n --location eastus az servicebus namespace create -g --name --location eastus - az servicebus topic create --g --namespace-name --name notifications - az servicebus topic subscription create --g --namespace-name --topic-name notifications --name mobile + az servicebus topic create -g --namespace-name --name notifications + az servicebus topic subscription create -g --namespace-name --topic-name notifications --name mobile ``` > [!NOTE] @@ -67,19 +67,13 @@ Create a .NET Aspire app using either Visual Studio or the .NET CLI. Visual Studio provides app templates to get started with .NET Aspire that handle some of the initial setup configurations for you. 1. At the top of Visual Studio, navigate to **File** > **New** > **Project**. -1. In the dialog window, search for *ASP.NET Core* and select **ASP.NET Core Web API**. Choose **Next**. +1. In the dialog window, search for *Aspire* and select **.NET Aspire Starter Application**. Choose **Next**. 1. On the **Configure your new project** screen: - - Enter a **Project Name** of **AspireMessaging**. + - Enter a **Solution Name** of **AspireMessaging**. - Leave the rest of the values at their defaults and select **Next**. 1. On the **Additional information** screen: - - Make sure **.NET 8.0** is selected. - - Ensure that **Enlist in Aspire orchestration** is checked and select **Next**. - -Visual Studio creates a new ASP.NET Core solution that is structured to use .NET Aspire. The solution consists of the following projects: - -- **AspireMessaging** - An API project with default .NET Aspire service configurations. -- **AspireMessaging.AppHost** - An orchestrator project designed to connect and configure the different projects and services of your app. The orchestrator should be set as the startup project. -- **AspireMessaging.ServiceDefaults** - A shared class library to hold code that can be reused across the projects in your solution. + - Uncheck **Use Redis for caching** (not required for this tutorial). + - Select **Create**. ## [.NET CLI](#tab/dotnet-cli) @@ -89,13 +83,14 @@ Use the [`dotnet new`](/dotnet/core/tools/dotnet-new) command to create a new .N dotnet new aspire-starter --name AspireMessaging ``` +--- + The solution consists of the following projects: -- **AspireMessaging** - An API project with default .NET Aspire service configurations. +- **AspireMessaging.ApiService** - An API project with default .NET Aspire service configurations. - **AspireMessaging.AppHost** - An orchestrator project designed to connect and configure the different projects and services of your app. The orchestrator should be set as the startup project. - **AspireMessaging.ServiceDefaults** - A shared class library to hold code that can be reused across the projects in your solution. - ---- +- **AspireMessaging.Web** - A Blazor Server project that serves as the front end for the app. ### Add the Worker Service project @@ -152,7 +147,7 @@ The completed solution structure should resemble the following: ## Add the .NET Aspire component to the API -Add the [.NET Aspire Azure Service Bus](azure-service-bus-component.md) component to your `AspireMessaging` app: +Add the [.NET Aspire Azure Service Bus](azure-service-bus-component.md) component to your `AspireMessaging.ApiService` app: ```dotnetcli dotnet add package Aspire.Azure.Messaging.ServiceBus @@ -201,7 +196,7 @@ In the _:::no-loc text="appsettings.json":::_ file of the `AspireMessaging` proj ## Create the API endpoint -The API must provide an endpoint to receive data and publish it to the Service Bus topic and broadcast to subscribers. Add the following endpoint to the `AspireMessaging` project to send a message to the topic: +The API must provide an endpoint to receive data and publish it to the Service Bus topic and broadcast to subscribers. Add the following endpoint to the `AspireMessaging.ApiService` project to send a message to the Service Bus topic. Place this code in _Program.cs_ before the `app.MapDefaultEndpoints()` call: ```csharp app.MapPost("/notify", static async (ServiceBusClient client, string message) => @@ -225,7 +220,7 @@ app.MapPost("/notify", static async (ServiceBusClient client, string message) => await sender.SendMessagesAsync(messageBatch); Console.WriteLine($"A message has been published to the topic."); -}) +}); ``` ## Add the .NET Aspire component to the Worker Service @@ -239,7 +234,7 @@ dotnet add package Aspire.Azure.Messaging.ServiceBus In the _:::no-loc text="Program.cs":::_ file of the `AspireMessaging.WorkerService` Razor Pages project, add a call to the `AddAzureServiceBus` extension methods: ```csharp -builder.AddAzureServiceBus("serviceBusConnection"); +builder.AddAzureServiceBusClient("serviceBusConnection"); ``` This method accomplishes the following tasks: @@ -335,32 +330,17 @@ public class Worker( The sample app is now ready for testing. Verify that the data submitted to the API is sent to the Azure Service Bus topic and consumed by the subscriber worker service: -## [Visual Studio](#tab/visual-studio) - -1. Press the run button at the top of Visual Studio to launch your Aspire app. The .NET Aspire dashboard app should open in the browser. -1. On the resources page, in the **aspireweb** row, click the link in the **Endpoints** column to open the Swagger UI page of your API. -1. On the .NET Aspire dashboard, navigate to the logs for the **AspireWorkerService** project. -1. Back on the Swagger UI page, expand the **/notify** endpoint and select **Try it out**. -1. Enter a test message in the **message** input box. -1. Select **Execute** to send a test request. -1. Switch back to the **AspireWorkerService** logs. You should see the test message printed in the output logs. - -## [.NET CLI](#tab/dotnet-cli) +1. Launch the Aspire app by selecting the run button (Visual Studio) or running `dotnet run --project AspireMessaging.AppHost`. The .NET Aspire dashboard app should open in the browser. +1. On the resources page, in the **apiservice** row, find the link in the **Endpoints** that opens the `weatherforecast` endpoint. Note the HTTPS port number. +1. On the .NET Aspire dashboard, navigate to the logs for the **aspiremessaging-workerservice** project. +1. In a terminal window, use the `curl` command to send a test message to the API: -1. In a terminal window at the root of your project, use the `dotnet run` command to start the app: - - ```csharp - dotnet run --project AspireMessaging.AppHost + ```bash + curl -X POST -H "Content-Type: application/json" https://localhost:{port}/notify?message=hello%20aspire ``` -1. On the resources page, in the **aspireweb** row, click the link in the **Endpoints** column to open the Swagger UI page of your API. -1. On the .NET Aspire dashboard, navigate to the logs for the **AspireWorkerService** project. -1. Back on the Swagger UI page, expand the **/notify** endpoint and select **Try it out**. -1. Enter a test message in the **message** input box. -1. Select **Execute** to send a test request. -1. Switch back to the **AspireWorkerService** logs. You should see the test message printed in the output logs. - ---- + Be sure to replace **{port}** with the port number from earlier. +1. Switch back to the **aspiremessaging-workerservice** logs. You should see the test message printed in the output logs. Congratulations! You created and configured an ASP.NET Core API that connects to Azure Service Bus using Aspire components. diff --git a/docs/storage/azure-storage-components.md b/docs/storage/azure-storage-components.md index 0fc8585fb6..7fa1e1fb2c 100644 --- a/docs/storage/azure-storage-components.md +++ b/docs/storage/azure-storage-components.md @@ -1,7 +1,7 @@ --- title: Connect an ASP.NET Core app to .NET Aspire storage components description: Learn how to connect an ASP.NET Core app to .NET Aspire storage components. -ms.date: 05/14/2024 +ms.date: 05/22/2024 ms.topic: tutorial zone_pivot_groups: azure-storage-mechanism ms.custom: devx-track-extended-azdevcli @@ -116,20 +116,14 @@ Create a .NET Aspire app using either Visual Studio or the .NET CLI. ## [Visual Studio](#tab/visual-studio) 1. At the top of Visual Studio, navigate to **File** > **New** > **Project**. -1. In the dialog window, search for *Blazor* and select **Blazor Web App**. Choose **Next**. +1. In the dialog window, search for *Aspire* and select **.NET Aspire Starter Application**. Choose **Next**. 1. On the **Configure your new project** screen: - - Enter a **Project Name** of **AspireStorage**. - - Leave the rest of the values at their defaults and select **Next**. + - Enter a **Solution Name** of **AspireStorage** and select **Next**. 1. On the **Additional information** screen: - - Make sure **.NET 8.0** is selected. - - Ensure the **Interactive render mode** is set to **None**. - - Check the **Enlist in .NET Aspire orchestration** option and select **Create**. - -Visual Studio creates a new ASP.NET Core solution that is structured to use .NET Aspire. The solution consists of the following projects: + - Uncheck **Use Redis for caching** (not required for this tutorial). + - Select **Create**. -- **AspireStorage**: A Blazor project that depends on service defaults. -- **AspireStorage.AppHost**: An orchestrator project designed to connect and configure the different projects and services of your app. The orchestrator should be set as the startup project. -- **AspireStorage.ServiceDefaults**: A shared class library to hold configurations that can be reused across the projects in your solution. +Visual Studio creates a new ASP.NET Core solution that is structured to use .NET Aspire. ## [.NET CLI](#tab/net-cli) @@ -139,13 +133,14 @@ Use the [`dotnet new`](/dotnet/core/tools/dotnet-new) command to create a new .N dotnet new aspire-starter --name AspireStorage ``` +--- + The solution consists of the following projects: -- **AspireStorage** - An API project with default .NET Aspire service configurations. +- **AspireStorage.ApiService** - An API project with default .NET Aspire service configurations. - **AspireStorage.AppHost** - An orchestrator project designed to connect and configure the different projects and services of your app. The orchestrator should be set as the startup project. - **AspireStorage.ServiceDefaults** - A shared class library to hold code that can be reused across the projects in your solution. - ---- +- **AspireStorage.Web** - A Blazor Server project that serves as the front end of your app. ### Add the Worker Service project @@ -155,7 +150,7 @@ Next, add a Worker Service project to the solution to retrieve and process messa 1. In the solution explorer, right click on the top level _AspireStorage_ solution node and select **Add** > **New project**. 1. Search for and select the **Worker Service** template and choose **Next**. -1. For the **Project name**, enter _AspireStorage.Worker_ and select **Next**. +1. For the **Project name**, enter _AspireStorage.WorkerService_ and select **Next**. 1. On the **Additional information** screen: - Make sure **.NET 8.0** is selected. - Make sure **Enlist in .NET Aspire orchestration** is checked and select **Create**. @@ -163,7 +158,7 @@ Next, add a Worker Service project to the solution to retrieve and process messa Visual Studio adds the project to your solution and updates the _:::no-loc text="Program.cs":::_ file of the _AspireStorage.AppHost_ project with a new line of code: ```csharp -builder.AddProject(); +builder.AddProject("aspirestorage-workerservice"); ``` Visual Studio tooling added this line of code to register your new project with the object, which enables orchestration features. For more information, see [.NET Aspire orchestration overview](../fundamentals/app-host-overview.md). @@ -202,29 +197,29 @@ The completed solution structure should resemble the following: ## Add the .NET Aspire components to the Blazor app -Add the [.NET Aspire Azure Blob Storage component](azure-storage-blobs-component.md) and [.NET Aspire Azure Queue Storage component](azure-storage-queues-component.md) packages to your _AspireStorage_ project: +Add the [.NET Aspire Azure Blob Storage component](azure-storage-blobs-component.md) and [.NET Aspire Azure Queue Storage component](azure-storage-queues-component.md) packages to your _AspireStorage.Web_ project: ```dotnetcli dotnet add package Aspire.Azure.Storage.Blobs dotnet add package Aspire.Azure.Storage.Queues ``` -Your **AspireStorage** project is now set up to use .NET Aspire components. Here's the updated _AspireStorage.csproj_ file: +Your **AspireStorage.Web** project is now set up to use .NET Aspire components. Here's the updated _AspireStorage.Web.csproj_ file: -:::code language="xml" source="snippets/tutorial/AspireStorage/AspireStorage/AspireStorage.csproj" highlight="10-13"::: +:::code language="xml" source="snippets/tutorial/AspireStorage/AspireStorage.Web/AspireStorage.Web.csproj" highlight="14-15"::: The next step is to add the components to the app. -In the _:::no-loc text="Program.cs":::_ file of the _AspireStorage_ project, add calls to the and extension methods after the creation of the `builder` but before the call to `AddServiceDefaults`. For more information, see [.NET Aspire service defaults](../fundamentals/service-defaults.md). Provide the name of your connection string as a parameter. +In the _:::no-loc text="Program.cs":::_ file of the _AspireStorage.Web_ project, add calls to the and extension methods after the creation of the `builder` but before the call to `AddServiceDefaults`. For more information, see [.NET Aspire service defaults](../fundamentals/service-defaults.md). Provide the name of your connection string as a parameter. :::zone pivot="azurite" -:::code source="snippets/tutorial/AspireStorage/AspireStorage/Program.cs" highlight="2-3,7-8,29-38"::: +:::code source="snippets/tutorial/AspireStorage/AspireStorage.Web/Program.cs" highlight="4-5,9-10,36-48"::: :::zone-end :::zone pivot="azure-portal,azure-cli" -:::code source="snippets/tutorial/AspireStorage/AspireStorage/Program.cs" range="1-26,40-58" highlight="2-3,7-8"::: +:::code source="snippets/tutorial/AspireStorage/AspireStorage.Web/Program.cs" range="1-35,49-63" highlight="2-3,7-8"::: :::zone-end @@ -235,21 +230,21 @@ With the additional `using` statements, these methods accomplish the following t :::zone pivot="azurite" -When the _AspireStorage_ project starts, it will create a `fileuploads` container in Azurite Blob Storage and a `tickets` queue in Azurite Queue Storage. This is conditional when the app is running in a development environment. When the app is running in a production environment, the container and queue are assumed to have already been created. +When the _AspireStorage.Web_ project starts, it will create a `fileuploads` container in Azurite Blob Storage and a `tickets` queue in Azurite Queue Storage. This is conditional when the app is running in a development environment. When the app is running in a production environment, the container and queue are assumed to have already been created. :::zone-end ## Add the .NET Aspire component to the Worker Service -The worker service handles pulling messages off of the Azure Storage queue for processing. Add the [.NET Aspire Azure Queue Storage component](azure-storage-queues-component.md) component package to your _AspireStorage.Worker_ app: +The worker service handles pulling messages off of the Azure Storage queue for processing. Add the [.NET Aspire Azure Queue Storage component](azure-storage-queues-component.md) component package to your _AspireStorage.WorkerService_ app: ```dotnetcli dotnet add package Aspire.Azure.Storage.Queues ``` -In the _:::no-loc text="Program.cs":::_ file of the _AspireStorage.Worker_ project, add a call to the extension method after the creation of the `builder` but before the call to `AddServiceDefaults`: +In the _:::no-loc text="Program.cs":::_ file of the _AspireStorage.WorkerService_ project, add a call to the extension method after the creation of the `builder` but before the call to `AddServiceDefaults`: -:::code source="snippets/tutorial/AspireStorage/AspireStorage.Worker/Program.cs" highlight="5"::: +:::code source="snippets/tutorial/AspireStorage/AspireStorage.WorkerService/Program.cs" highlight="5"::: This method handles the following tasks: @@ -260,9 +255,9 @@ This method handles the following tasks: The app requires a form for the user to be able to submit support ticket information and upload an attachment. The app uploads the attached file on the `Document` () property to Azure Blob Storage using the injected . The sends a message composed of the `Title` and `Description` to the Azure Storage Queue. -Use the following Razor markup to create a basic form, replacing the contents of the _Home.razor_ file in the _AspireStorage/Components/Pages_ directory: +Use the following Razor markup to create a basic form, replacing the contents of the _Home.razor_ file in the _AspireStorage.Web/Components/Pages_ directory: -:::code language="razor" source="snippets/tutorial/AspireStorage/AspireStorage/Components/Pages/Home.razor"::: +:::code language="razor" source="snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Pages/Home.razor"::: For more information about creating forms in Blazor, see [ASP.NET Core Blazor forms overview](/aspnet/core/blazor/forms). @@ -298,7 +293,7 @@ The preceding code adds Azure storage, blobs, and queues, and when in developmen :::zone-end :::zone pivot="azure-portal,azure-cli" -:::code source="snippets/tutorial/AspireStorage/AspireStorage.AppHost/Program.cs" range="1-5,11-23"::: +:::code source="snippets/tutorial/AspireStorage/AspireStorage.AppHost/Program.cs" range="1-6,12-27"::: The preceding code adds Azure storage, blobs, and queues, and defines references for these resources within each project that depend on them. @@ -310,14 +305,14 @@ When a new message is placed on the `tickets` queue, the worker service should r :::zone pivot="azurite" -:::code source="snippets/tutorial/AspireStorage/AspireStorage.Worker/Worker.cs"::: +:::code source="snippets/tutorial/AspireStorage/AspireStorage.WorkerService/Worker.cs"::: Before the worker service can process messages, it needs to be able to connect to the Azure Storage queue. With Azurite, you need to ensure that the queue is available before the worker service starts executing message queue processing. :::zone-end :::zone pivot="azure-portal,azure-cli" -:::code source="snippets/tutorial/AspireStorage/AspireStorage.Worker/Worker.cs" range="1-12,15-37"::: +:::code source="snippets/tutorial/AspireStorage/AspireStorage.WorkerService/Worker.cs" range="1-12,15-37"::: The worker service processes messages by connecting to the Azure Storage queue, and pulling messages off the queue. @@ -357,7 +352,7 @@ The sample app is now ready for testing. Verify that the submitted form data is ## [Visual Studio](#tab/visual-studio) 1. Press the run button at the top of Visual Studio to launch your .NET Aspire app dashboard in the browser. -1. On the resources page, in the **aspirestorage** row, click the link in the **Endpoints** column to open the UI of your app. +1. On the resources page, in the **aspirestorage.web** row, click the link in the **Endpoints** column to open the UI of your app. :::image type="content" source="media/support-app.png" lightbox="media/support-app.png" alt-text="A screenshot showing the home page of the .NET Aspire support application."::: @@ -365,7 +360,7 @@ The sample app is now ready for testing. Verify that the submitted form data is 1. Select the **Submit** button, and the form submits the support ticket for processing — and clears the form. 1. In a separate browser tab, use the Azure portal to navigate to the **Storage browser** in your Azure Storage Account. 1. Select **Containers** and then navigate into the **Documents** container to see the uploaded file. -1. You can verify the message on the queue was processed by looking at the **Project logs** of the [.NET Aspire dashboard](../fundamentals/dashboard/overview.md), and selecting the **aspirestorage.worker** from the dropdown. +1. You can verify the message on the queue was processed by looking at the **Project logs** of the [.NET Aspire dashboard](../fundamentals/dashboard/overview.md), and selecting the **aspirestorage.workerservice** from the dropdown. :::image type="content" source="media/queue-output.png" lightbox="media/queue-output.png" alt-text="A screenshot showing the console output of the Worker app."::: @@ -373,7 +368,7 @@ The sample app is now ready for testing. Verify that the submitted form data is 1. In a terminal window at the root of your project, use the `dotnet run` command to start the app: - ```csharp + ```dotnetcli dotnet run --project AspireStorage.AppHost ``` @@ -385,7 +380,7 @@ The sample app is now ready for testing. Verify that the submitted form data is 1. Select the **Submit** button, and the form submits the support ticket for processing — and clears the form. 1. In a separate browser tab, use the Azure portal to navigate to the **Storage browser** in your Azure Storage Account. 1. Select **Containers** and then navigate into the **Documents** container to see the uploaded file. -1. You can verify the message on the queue was processed by looking at the **Project logs** of the [.NET Aspire dashboard](../fundamentals/dashboard/overview.md), and selecting the **aspirestorage.worker** from the dropdown. +1. You can verify the message on the queue was processed by looking at the **Project logs** of the [.NET Aspire dashboard](../fundamentals/dashboard/overview.md), and selecting the **aspirestorage.workerservice** from the dropdown. :::image type="content" source="media/queue-output.png" lightbox="media/queue-output.png" alt-text="A screenshot showing the console output of the Worker app."::: diff --git a/docs/storage/media/queue-output.png b/docs/storage/media/queue-output.png index 1e96a61c17..2ce85057cf 100644 Binary files a/docs/storage/media/queue-output.png and b/docs/storage/media/queue-output.png differ diff --git a/docs/storage/media/storage-project.png b/docs/storage/media/storage-project.png index e762c4ee58..88478f802e 100644 Binary files a/docs/storage/media/storage-project.png and b/docs/storage/media/storage-project.png differ diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ApiService/AspireStorage.ApiService.csproj b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ApiService/AspireStorage.ApiService.csproj new file mode 100644 index 0000000000..035516bbd2 --- /dev/null +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ApiService/AspireStorage.ApiService.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ApiService/Program.cs b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ApiService/Program.cs new file mode 100644 index 0000000000..a93ae74197 --- /dev/null +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ApiService/Program.cs @@ -0,0 +1,39 @@ +var builder = WebApplication.CreateBuilder(args); + +// Add service defaults & Aspire components. +builder.AddServiceDefaults(); + +// Add services to the container. +builder.Services.AddProblemDetails(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +app.UseExceptionHandler(); + +var summaries = new[] +{ + "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; +}); + +app.MapDefaultEndpoints(); + +app.Run(); + +record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) +{ + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); +} diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ApiService/Properties/launchSettings.json b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ApiService/Properties/launchSettings.json new file mode 100644 index 0000000000..91e2d58dea --- /dev/null +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ApiService/Properties/launchSettings.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "weatherforecast", + "applicationUrl": "http://localhost:5592", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "weatherforecast", + "applicationUrl": "https://localhost:7377;http://localhost:5592", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/appsettings.Development.json b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ApiService/appsettings.Development.json similarity index 100% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage/appsettings.Development.json rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ApiService/appsettings.Development.json diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ApiService/appsettings.json b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ApiService/appsettings.json new file mode 100644 index 0000000000..10f68b8c8b --- /dev/null +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ApiService/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/AspireStorage.AppHost.csproj b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/AspireStorage.AppHost.csproj index 6a178fbd44..769d5c273f 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/AspireStorage.AppHost.csproj +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/AspireStorage.AppHost.csproj @@ -1,4 +1,4 @@ - + Exe @@ -6,17 +6,18 @@ enable enable true + 90b8925f-9539-4074-b384-2172e0b8354a - - - + + + - - + + diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/Program.cs b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/Program.cs index 271eaf0d85..fad079afa8 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/Program.cs +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/Program.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Hosting; var builder = DistributedApplication.CreateBuilder(args); @@ -12,12 +12,15 @@ var blobs = storage.AddBlobs("BlobConnection"); var queues = storage.AddQueues("QueueConnection"); -builder.AddProject("aspirestorage") +var apiService = builder.AddProject("apiservice"); + +builder.AddProject("webfrontend") + .WithExternalHttpEndpoints() + .WithReference(apiService) .WithReference(blobs) - .WithReference(queues); + .WithReference(queues); -builder.AddProject("aspirestorage-worker") +builder.AddProject("aspirestorage-workerservice") .WithReference(queues); -var app = builder.Build(); -app.Run(); +builder.Build().Run(); diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/Properties/launchSettings.json b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/Properties/launchSettings.json index 33ebd749d7..f35d1583e4 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/Properties/launchSettings.json +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/Properties/launchSettings.json @@ -1,15 +1,28 @@ { - "$schema": "http://json.schemastore.org/launchsettings.json", + "$schema": "https://json.schemastore.org/launchsettings.json", "profiles": { + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:17111;http://localhost:15240", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "DOTNET_ENVIRONMENT": "Development", + "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21170", + "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22000" + } + }, "http": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - "applicationUrl": "http://localhost:15044", + "applicationUrl": "http://localhost:15240", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development", "DOTNET_ENVIRONMENT": "Development", - "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:16009" + "DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19116", + "DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20100" } } } diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/appsettings.json b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/appsettings.json index 27a39347d7..31c092aa45 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/appsettings.json +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/appsettings.json @@ -1,9 +1,9 @@ { - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning", - "Aspire.Hosting.Dcp": "Warning" - } + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning", + "Aspire.Hosting.Dcp": "Warning" } + } } diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ServiceDefaults/AspireStorage.ServiceDefaults.csproj b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ServiceDefaults/AspireStorage.ServiceDefaults.csproj index 73896fdeed..51ceffa121 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ServiceDefaults/AspireStorage.ServiceDefaults.csproj +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ServiceDefaults/AspireStorage.ServiceDefaults.csproj @@ -10,13 +10,13 @@ - - + + - + diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ServiceDefaults/Extensions.cs b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ServiceDefaults/Extensions.cs index 090aca54f7..ce94dc2c43 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ServiceDefaults/Extensions.cs +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.ServiceDefaults/Extensions.cs @@ -3,13 +3,15 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Diagnostics.HealthChecks; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.ServiceDiscovery; -using OpenTelemetry.Logs; +using OpenTelemetry; using OpenTelemetry.Metrics; using OpenTelemetry.Trace; namespace Microsoft.Extensions.Hosting; +// Adds common .NET Aspire services: service discovery, resilience, health checks, and OpenTelemetry. +// This project should be referenced by each service project in your solution. +// To learn more about using this project, see https://aka.ms/dotnet/aspire/service-defaults public static class Extensions { public static IHostApplicationBuilder AddServiceDefaults(this IHostApplicationBuilder builder) @@ -29,12 +31,6 @@ public static IHostApplicationBuilder AddServiceDefaults(this IHostApplicationBu http.AddServiceDiscovery(); }); - // Uncomment the following to restrict the allowed schemes for service discovery. - // builder.Services.Configure(options => - // { - // options.AllowedSchemes = ["https"]; - // }); - return builder; } @@ -55,12 +51,6 @@ public static IHostApplicationBuilder ConfigureOpenTelemetry(this IHostApplicati }) .WithTracing(tracing => { - if (builder.Environment.IsDevelopment()) - { - // We want to view all traces in development - tracing.SetSampler(new AlwaysOnSampler()); - } - tracing.AddAspNetCoreInstrumentation() // Uncomment the following line to enable gRPC instrumentation (requires the OpenTelemetry.Instrumentation.GrpcNetClient package) //.AddGrpcClientInstrumentation() @@ -78,15 +68,9 @@ private static IHostApplicationBuilder AddOpenTelemetryExporters(this IHostAppli if (useOtlpExporter) { - builder.Services.Configure(logging => logging.AddOtlpExporter()); - builder.Services.ConfigureOpenTelemetryMeterProvider(metrics => metrics.AddOtlpExporter()); - builder.Services.ConfigureOpenTelemetryTracerProvider(tracing => tracing.AddOtlpExporter()); + builder.Services.AddOpenTelemetry().UseOtlpExporter(); } - // Uncomment the following lines to enable the Prometheus exporter (requires the OpenTelemetry.Exporter.Prometheus.AspNetCore package) - // builder.Services.AddOpenTelemetry() - // .WithMetrics(metrics => metrics.AddPrometheusExporter()); - // Uncomment the following lines to enable the Azure Monitor exporter (requires the Azure.Monitor.OpenTelemetry.AspNetCore package) //if (!string.IsNullOrEmpty(builder.Configuration["APPLICATIONINSIGHTS_CONNECTION_STRING"])) //{ @@ -108,9 +92,6 @@ public static IHostApplicationBuilder AddDefaultHealthChecks(this IHostApplicati public static WebApplication MapDefaultEndpoints(this WebApplication app) { - // Uncomment the following line to enable the Prometheus endpoint (requires the OpenTelemetry.Exporter.Prometheus.AspNetCore package) - // app.MapPrometheusScrapingEndpoint(); - // Adding health checks endpoints to applications in non-development environments has security implications. // See https://aka.ms/dotnet/aspire/healthchecks for details before enabling these endpoints in non-development environments. if (app.Environment.IsDevelopment()) @@ -127,4 +108,4 @@ public static WebApplication MapDefaultEndpoints(this WebApplication app) return app; } -} \ No newline at end of file +} diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/AspireStorage.csproj b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/AspireStorage.Web.csproj similarity index 64% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage/AspireStorage.csproj rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/AspireStorage.Web.csproj index 9fdb81b17b..ca35c36acf 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/AspireStorage.csproj +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/AspireStorage.Web.csproj @@ -2,19 +2,17 @@ net8.0 - enable enable + enable - - + - + - + + diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/App.razor b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/App.razor similarity index 87% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/App.razor rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/App.razor index 7eaeb934f4..f4eb29288d 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/App.razor +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/App.razor @@ -7,7 +7,7 @@ - + diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Layout/MainLayout.razor b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Layout/MainLayout.razor similarity index 71% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Layout/MainLayout.razor rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Layout/MainLayout.razor index 7cd63fe1c0..5a24bb1371 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Layout/MainLayout.razor +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Layout/MainLayout.razor @@ -15,3 +15,9 @@ + +
+ An unhandled error has occurred. + Reload + 🗙 +
diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Layout/MainLayout.razor.css b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Layout/MainLayout.razor.css similarity index 100% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Layout/MainLayout.razor.css rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Layout/MainLayout.razor.css diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Layout/NavMenu.razor b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Layout/NavMenu.razor similarity index 62% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Layout/NavMenu.razor rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Layout/NavMenu.razor index d79986c085..cdb76a56d2 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Layout/NavMenu.razor +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Layout/NavMenu.razor @@ -10,15 +10,20 @@ - diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Layout/NavMenu.razor.css b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Layout/NavMenu.razor.css similarity index 93% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Layout/NavMenu.razor.css rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Layout/NavMenu.razor.css index 4e15395e09..95fcc36e0b 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Layout/NavMenu.razor.css +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Layout/NavMenu.razor.css @@ -34,15 +34,15 @@ background-size: cover; } -.bi-house-door-fill-nav-menu { +.bi-house-door-fill { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E"); } -.bi-plus-square-fill-nav-menu { +.bi-plus-square-fill { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-plus-square-fill' viewBox='0 0 16 16'%3E%3Cpath d='M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z'/%3E%3C/svg%3E"); } -.bi-list-nested-nav-menu { +.bi-list-nested { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E"); } @@ -59,16 +59,13 @@ padding-bottom: 1rem; } - .nav-item ::deep .nav-link { + .nav-item ::deep a { color: #d7d7d7; - background: none; - border: none; border-radius: 4px; height: 3rem; display: flex; align-items: center; line-height: 3rem; - width: 100%; } .nav-item ::deep a.active { @@ -76,7 +73,7 @@ color: white; } -.nav-item ::deep .nav-link:hover { +.nav-item ::deep a:hover { background-color: rgba(255,255,255,0.1); color: white; } diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Pages/Counter.razor b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Pages/Counter.razor new file mode 100644 index 0000000000..1a4f8e7553 --- /dev/null +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Pages/Counter.razor @@ -0,0 +1,19 @@ +@page "/counter" +@rendermode InteractiveServer + +Counter + +

Counter

+ +

Current count: @currentCount

+ + + +@code { + private int currentCount = 0; + + private void IncrementCount() + { + currentCount++; + } +} diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Pages/Error.razor b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Pages/Error.razor similarity index 71% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Pages/Error.razor rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Pages/Error.razor index 576cc2d2f4..fcaa7c6ef6 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Pages/Error.razor +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Pages/Error.razor @@ -9,7 +9,7 @@ @if (ShowRequestId) {

- Request ID: @RequestId + Request ID: @requestId

} @@ -26,11 +26,13 @@ @code{ [CascadingParameter] - private HttpContext? HttpContext { get; set; } + public HttpContext? HttpContext { get; set; } - private string? RequestId { get; set; } - private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + private string? requestId; + private bool ShowRequestId => !string.IsNullOrEmpty(requestId); - protected override void OnInitialized() => - RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; + protected override void OnInitialized() + { + requestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; + } } diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Pages/Home.razor b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Pages/Home.razor similarity index 98% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Pages/Home.razor rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Pages/Home.razor index 47e0275b51..41ae67d2a7 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Pages/Home.razor +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Pages/Home.razor @@ -55,6 +55,8 @@ await queueClient.SendMessageAsync( $"{Ticket.Title} - {Ticket.Description}"); + + ClearForm(); } private void ClearForm() => Ticket = new(); @@ -65,4 +67,4 @@ [Required] public string Description { get; set; } = default!; [Required] public IFormFile Document { get; set; } = default!; } -} +} \ No newline at end of file diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Pages/Weather.razor b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Pages/Weather.razor new file mode 100644 index 0000000000..77e18cde47 --- /dev/null +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Pages/Weather.razor @@ -0,0 +1,49 @@ +@page "/weather" +@attribute [StreamRendering(true)] +@attribute [OutputCache(Duration = 5)] + +@inject WeatherApiClient WeatherApi + +Weather + +

Weather

+ +

This component demonstrates showing data loaded from a backend API service.

+ +@if (forecasts == null) +{ +

Loading...

+} +else +{ + + + + + + + + + + + @foreach (var forecast in forecasts) + { + + + + + + + } + +
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
+} + +@code { + private WeatherForecast[]? forecasts; + + protected override async Task OnInitializedAsync() + { + forecasts = await WeatherApi.GetWeatherAsync(); + } +} diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Routes.razor b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Routes.razor similarity index 100% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Routes.razor rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/Routes.razor diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/_Imports.razor b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/_Imports.razor similarity index 76% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/_Imports.razor rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/_Imports.razor index 0713d60c0f..92fbfbfb95 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/_Imports.razor +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Components/_Imports.razor @@ -5,6 +5,7 @@ @using Microsoft.AspNetCore.Components.Web @using static Microsoft.AspNetCore.Components.Web.RenderMode @using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.AspNetCore.OutputCaching @using Microsoft.JSInterop -@using AspireStorage -@using AspireStorage.Components +@using AspireStorage.Web +@using AspireStorage.Web.Components diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Program.cs b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Program.cs similarity index 60% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Program.cs rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Program.cs index 27cbc758b9..3e776634da 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Program.cs +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Program.cs @@ -1,4 +1,6 @@ -using AspireStorage.Components; +using AspireStorage.Web; +using AspireStorage.Web.Components; + using Azure.Storage.Blobs; using Azure.Storage.Queues; @@ -7,21 +9,28 @@ builder.AddAzureBlobClient("BlobConnection"); builder.AddAzureQueueClient("QueueConnection"); +// Add service defaults & Aspire components. builder.AddServiceDefaults(); // Add services to the container. -builder.Services.AddRazorComponents(); +builder.Services.AddRazorComponents() + .AddInteractiveServerComponents(); -var app = builder.Build(); +builder.Services.AddOutputCache(); -app.MapDefaultEndpoints(); +builder.Services.AddHttpClient(client => + { + // This URL uses "https+http://" to indicate HTTPS is preferred over HTTP. + // Learn more about service discovery scheme resolution at https://aka.ms/dotnet/sdschemes. + client.BaseAddress = new("https+http://apiservice"); + }); + +var app = builder.Build(); -// Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Error", createScopeForErrors: true); - // The default HSTS value is 30 days. You may want to change this for production - // scenarios, see https://aka.ms/aspnetcore-hsts. + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } else @@ -43,6 +52,11 @@ app.UseStaticFiles(); app.UseAntiforgery(); -app.MapRazorComponents(); +app.UseOutputCache(); + +app.MapRazorComponents() + .AddInteractiveServerRenderMode(); + +app.MapDefaultEndpoints(); app.Run(); diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Properties/launchSettings.json b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Properties/launchSettings.json new file mode 100644 index 0000000000..dae1097df1 --- /dev/null +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/Properties/launchSettings.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:5006", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:7120;http://localhost:5006", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/WeatherApiClient.cs b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/WeatherApiClient.cs new file mode 100644 index 0000000000..33cf06c900 --- /dev/null +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/WeatherApiClient.cs @@ -0,0 +1,29 @@ +namespace AspireStorage.Web; + +public class WeatherApiClient(HttpClient httpClient) +{ + public async Task GetWeatherAsync(int maxItems = 10, CancellationToken cancellationToken = default) + { + List? forecasts = null; + + await foreach (var forecast in httpClient.GetFromJsonAsAsyncEnumerable("/weatherforecast", cancellationToken)) + { + if (forecasts?.Count >= maxItems) + { + break; + } + if (forecast is not null) + { + forecasts ??= []; + forecasts.Add(forecast); + } + } + + return forecasts?.ToArray() ?? []; + } +} + +public record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) +{ + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); +} diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/appsettings.Development.json b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/appsettings.Development.json new file mode 100644 index 0000000000..0c208ae918 --- /dev/null +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/appsettings.json b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/appsettings.json new file mode 100644 index 0000000000..10f68b8c8b --- /dev/null +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/wwwroot/app.css b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/wwwroot/app.css similarity index 78% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage/wwwroot/app.css rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/wwwroot/app.css index 2bd9b7896d..e7cfc678a1 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/wwwroot/app.css +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/wwwroot/app.css @@ -1,25 +1,3 @@ -html, body { - font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; -} - -a, .btn-link { - color: #006bb7; -} - -.btn-primary { - color: #fff; - background-color: #1b6ec2; - border-color: #1861ac; -} - -.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { - box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; -} - -.content { - padding-top: 1.1rem; -} - h1:focus { outline: none; } @@ -29,11 +7,11 @@ h1:focus { } .invalid { - outline: 1px solid #e50000; + outline: 1px solid #e50060; } .validation-message { - color: #e50000; + color: #e50060; } .blazor-error-boundary { @@ -45,7 +23,3 @@ h1:focus { .blazor-error-boundary::after { content: "An error has occurred." } - -.darker-border-checkbox.form-check-input { - border-color: #929292; -} diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/wwwroot/bootstrap/bootstrap.min.css b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/wwwroot/bootstrap/bootstrap.min.css similarity index 100% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage/wwwroot/bootstrap/bootstrap.min.css rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/wwwroot/bootstrap/bootstrap.min.css diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/wwwroot/bootstrap/bootstrap.min.css.map b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/wwwroot/bootstrap/bootstrap.min.css.map similarity index 100% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage/wwwroot/bootstrap/bootstrap.min.css.map rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/wwwroot/bootstrap/bootstrap.min.css.map diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/wwwroot/favicon.png b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/wwwroot/favicon.png similarity index 100% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage/wwwroot/favicon.png rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Web/wwwroot/favicon.png diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/Properties/serviceDependencies.json b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/Properties/serviceDependencies.json deleted file mode 100644 index 33703d5822..0000000000 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/Properties/serviceDependencies.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "dependencies": {} -} \ No newline at end of file diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/Properties/serviceDependencies.local.json b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/Properties/serviceDependencies.local.json deleted file mode 100644 index 33703d5822..0000000000 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/Properties/serviceDependencies.local.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "dependencies": {} -} \ No newline at end of file diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/appsettings.json b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/appsettings.json deleted file mode 100644 index 88a9ac01d8..0000000000 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/appsettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.Hosting.Lifetime": "Information" - } - } -} diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/AspireStorage.Worker.csproj b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.WorkerService/AspireStorage.WorkerService.csproj similarity index 81% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/AspireStorage.Worker.csproj rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.WorkerService/AspireStorage.WorkerService.csproj index 74a6d79330..1faf6595b7 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/AspireStorage.Worker.csproj +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.WorkerService/AspireStorage.WorkerService.csproj @@ -4,11 +4,12 @@ net8.0 enable enable + dotnet-AspireStorage.Worker-054a373f-b657-4f55-8eef-6c9468765679 - + diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/Program.cs b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.WorkerService/Program.cs similarity index 62% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/Program.cs rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.WorkerService/Program.cs index 0ac97b521b..faa71bd979 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/Program.cs +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.WorkerService/Program.cs @@ -1,11 +1,11 @@ -using AspireStorage.Worker; +using AspireStorage.WorkerService; var builder = Host.CreateApplicationBuilder(args); builder.AddAzureQueueClient("QueueConnection"); builder.AddServiceDefaults(); -builder.Services.AddHostedService(); +builder.Services.AddHostedService(); var host = builder.Build(); -host.Run(); +host.Run(); \ No newline at end of file diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/Properties/launchSettings.json b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.WorkerService/Properties/launchSettings.json similarity index 100% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/Properties/launchSettings.json rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.WorkerService/Properties/launchSettings.json diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/Worker.cs b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.WorkerService/Worker.cs similarity index 87% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/Worker.cs rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.WorkerService/Worker.cs index 66f9cb1fcb..d407aee115 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/Worker.cs +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.WorkerService/Worker.cs @@ -1,11 +1,11 @@ -using Azure.Storage.Queues; +using Azure.Storage.Queues; using Azure.Storage.Queues.Models; -namespace AspireStorage.Worker; +namespace AspireStorage.WorkerService; -public sealed class Worker( +public sealed class WorkerService( QueueServiceClient client, - ILogger logger) : BackgroundService + ILogger logger) : BackgroundService { protected override async Task ExecuteAsync(CancellationToken stoppingToken) { @@ -34,4 +34,4 @@ await queueClient.DeleteMessageAsync( await Task.Delay(TimeSpan.FromSeconds(15), stoppingToken); } } -} +} \ No newline at end of file diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/appsettings.Development.json b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.WorkerService/appsettings.Development.json similarity index 100% rename from docs/storage/snippets/tutorial/AspireStorage/AspireStorage.Worker/appsettings.Development.json rename to docs/storage/snippets/tutorial/AspireStorage/AspireStorage.WorkerService/appsettings.Development.json diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.WorkerService/appsettings.json b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.WorkerService/appsettings.json new file mode 100644 index 0000000000..b2dcdb6742 --- /dev/null +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.WorkerService/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.Hosting.Lifetime": "Information" + } + } +} diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.sln b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.sln index 4c261cf283..3c5a18b1bb 100644 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.sln +++ b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage.sln @@ -1,15 +1,16 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.9.34328.292 +VisualStudioVersion = 17.10.34902.84 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspireStorage.AppHost", "AspireStorage.AppHost\AspireStorage.AppHost.csproj", "{E5B83CBB-999F-49B3-9EB6-73FCAACA87D0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspireStorage.AppHost", "AspireStorage.AppHost\AspireStorage.AppHost.csproj", "{2F227180-C03F-45FB-B3F3-20694B0C3799}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspireStorage.ServiceDefaults", "AspireStorage.ServiceDefaults\AspireStorage.ServiceDefaults.csproj", "{571E3346-34B6-464A-9A90-B8EAC9F914D5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspireStorage.ServiceDefaults", "AspireStorage.ServiceDefaults\AspireStorage.ServiceDefaults.csproj", "{5BFF02B4-36A0-4572-A9E0-6B887F80F644}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspireStorage.Worker", "AspireStorage.Worker\AspireStorage.Worker.csproj", "{E9CE3EB7-E021-407A-ACA7-785E5A7D968C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspireStorage.ApiService", "AspireStorage.ApiService\AspireStorage.ApiService.csproj", "{09715261-E752-4DCD-8DAD-E67C987BBFB7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspireStorage", "AspireStorage\AspireStorage.csproj", "{E323D2AB-6A80-47B8-8F55-BD3CBDFCD63D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspireStorage.Web", "AspireStorage.Web\AspireStorage.Web.csproj", "{B1146C63-B702-40A9-89A8-692BBCA6A5DB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspireStorage.WorkerService", "AspireStorage.WorkerService\AspireStorage.WorkerService.csproj", "{CBD8B1E9-DA19-4D13-BF4F-50556F8D55A5}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -17,27 +18,31 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E5B83CBB-999F-49B3-9EB6-73FCAACA87D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E5B83CBB-999F-49B3-9EB6-73FCAACA87D0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E5B83CBB-999F-49B3-9EB6-73FCAACA87D0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E5B83CBB-999F-49B3-9EB6-73FCAACA87D0}.Release|Any CPU.Build.0 = Release|Any CPU - {571E3346-34B6-464A-9A90-B8EAC9F914D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {571E3346-34B6-464A-9A90-B8EAC9F914D5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {571E3346-34B6-464A-9A90-B8EAC9F914D5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {571E3346-34B6-464A-9A90-B8EAC9F914D5}.Release|Any CPU.Build.0 = Release|Any CPU - {E9CE3EB7-E021-407A-ACA7-785E5A7D968C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E9CE3EB7-E021-407A-ACA7-785E5A7D968C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E9CE3EB7-E021-407A-ACA7-785E5A7D968C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E9CE3EB7-E021-407A-ACA7-785E5A7D968C}.Release|Any CPU.Build.0 = Release|Any CPU - {E323D2AB-6A80-47B8-8F55-BD3CBDFCD63D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E323D2AB-6A80-47B8-8F55-BD3CBDFCD63D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E323D2AB-6A80-47B8-8F55-BD3CBDFCD63D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E323D2AB-6A80-47B8-8F55-BD3CBDFCD63D}.Release|Any CPU.Build.0 = Release|Any CPU + {2F227180-C03F-45FB-B3F3-20694B0C3799}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2F227180-C03F-45FB-B3F3-20694B0C3799}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2F227180-C03F-45FB-B3F3-20694B0C3799}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2F227180-C03F-45FB-B3F3-20694B0C3799}.Release|Any CPU.Build.0 = Release|Any CPU + {5BFF02B4-36A0-4572-A9E0-6B887F80F644}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5BFF02B4-36A0-4572-A9E0-6B887F80F644}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5BFF02B4-36A0-4572-A9E0-6B887F80F644}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5BFF02B4-36A0-4572-A9E0-6B887F80F644}.Release|Any CPU.Build.0 = Release|Any CPU + {09715261-E752-4DCD-8DAD-E67C987BBFB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {09715261-E752-4DCD-8DAD-E67C987BBFB7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {09715261-E752-4DCD-8DAD-E67C987BBFB7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {09715261-E752-4DCD-8DAD-E67C987BBFB7}.Release|Any CPU.Build.0 = Release|Any CPU + {B1146C63-B702-40A9-89A8-692BBCA6A5DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B1146C63-B702-40A9-89A8-692BBCA6A5DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B1146C63-B702-40A9-89A8-692BBCA6A5DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B1146C63-B702-40A9-89A8-692BBCA6A5DB}.Release|Any CPU.Build.0 = Release|Any CPU + {CBD8B1E9-DA19-4D13-BF4F-50556F8D55A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CBD8B1E9-DA19-4D13-BF4F-50556F8D55A5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CBD8B1E9-DA19-4D13-BF4F-50556F8D55A5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CBD8B1E9-DA19-4D13-BF4F-50556F8D55A5}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {4A2686A1-69AB-451E-8463-51D39F1F20F8} + SolutionGuid = {1A7D4B18-02CC-40C7-885F-BE1A87D651A7} EndGlobalSection EndGlobal diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Pages/Weather.razor b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Pages/Weather.razor deleted file mode 100644 index 43a1ecbe9c..0000000000 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Pages/Weather.razor +++ /dev/null @@ -1,64 +0,0 @@ -@page "/weather" -@attribute [StreamRendering] - -Weather - -

Weather

- -

This component demonstrates showing data.

- -@if (forecasts == null) -{ -

Loading...

-} -else -{ - - - - - - - - - - - @foreach (var forecast in forecasts) - { - - - - - - - } - -
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
-} - -@code { - private WeatherForecast[]? forecasts; - - protected override async Task OnInitializedAsync() - { - // Simulate asynchronous loading to demonstrate streaming rendering - await Task.Delay(500); - - var startDate = DateOnly.FromDateTime(DateTime.Now); - var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; - forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = startDate.AddDays(index), - TemperatureC = Random.Shared.Next(-20, 55), - Summary = summaries[Random.Shared.Next(summaries.Length)] - }).ToArray(); - } - - private class WeatherForecast - { - public DateOnly Date { get; set; } - public int TemperatureC { get; set; } - public string? Summary { get; set; } - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - } -} diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Properties/launchSettings.json b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Properties/launchSettings.json deleted file mode 100644 index 97df901cff..0000000000 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Properties/launchSettings.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:60364", - "sslPort": 44317 - } - }, - "profiles": { - "http": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "applicationUrl": "http://localhost:5125", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "https": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "applicationUrl": "https://localhost:7106;http://localhost:5125", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } - } diff --git a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/appsettings.json b/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/appsettings.json deleted file mode 100644 index 23160a4d56..0000000000 --- a/docs/storage/snippets/tutorial/AspireStorage/AspireStorage/appsettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*" -}