From c66c80e420f83d7046e310358d166021219878fe Mon Sep 17 00:00:00 2001 From: Aaron Powell Date: Fri, 11 Jul 2025 13:37:49 +1000 Subject: [PATCH] Removing the SWA docs --- .../hosting-azure-static-web-apps.md | 70 ------------------- docs/community-toolkit/overview.md | 3 - docs/fundamentals/integrations-overview.md | 1 - docs/toc.yml | 2 - 4 files changed, 76 deletions(-) delete mode 100644 docs/community-toolkit/hosting-azure-static-web-apps.md diff --git a/docs/community-toolkit/hosting-azure-static-web-apps.md b/docs/community-toolkit/hosting-azure-static-web-apps.md deleted file mode 100644 index 0335bbc376..0000000000 --- a/docs/community-toolkit/hosting-azure-static-web-apps.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: Azure Static Web Apps emulator -description: Learn how to use the .NET Aspire Azure Static Web Apps emulator integration to run Azure Static Web Apps locally using the emulator. -ms.date: 10/11/2024 ---- - -# .NET Aspire Azure Static Web Apps emulator integration - -[!INCLUDE [includes-hosting](../includes/includes-hosting.md)] - -[!INCLUDE [banner](includes/banner.md)] - -In this article, you learn how to use the .NET Aspire [Azure Static Web Apps emulator](/azure/static-web-apps/local-development) hosting integration to run Azure Static Web Apps locally using the emulator. The emulator provides support for proxying both the static frontend and the API backend using resources defined in the app host. - -This integration requires the [Azure Static Web Apps CLI](/azure/static-web-apps/local-development#get-started) to run, and only supports hosting the emulator for local development, not deploying to Azure Static Web Apps. - -## Hosting integration - -To get started with the .NET Aspire Azure Static Web Apps emulator hosting integration, install the [📦 CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps](https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps) NuGet package in the AppHost project. - -### [.NET CLI](#tab/dotnet-cli) - -```dotnetcli -dotnet add package CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps -``` - -### [PackageReference](#tab/package-reference) - -```xml - -``` - ---- - -For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies). - -## Example usage - -In the _:::no-loc text="Program.cs":::_ file of your app host project, define the backend and frontend resources. Then, call the `AddSwaEmulator` method to create the emulator and pass the resources using the `WithAppResource` and `WithApiResource` methods. - -```csharp -var builder = DistributedApplication.CreateBuilder(args); - -// Define the API resource -var api = builder.AddProject("api"); - -// Define the frontend resource -var web = builder - .AddNpmApp("web", Path.Combine("..", "CommunityToolkit.Aspire.StaticWebApps.WebApp"), "dev") - .WithHttpEndpoint(env: "PORT") - .WithExternalHttpEndpoints(); - -// Create a SWA emulator with the frontend and API resources -_ = builder - .AddSwaEmulator("swa") - .WithAppResource(web) - .WithApiResource(api); - -builder.Build().Run(); -``` - -The preceding code defines the API and frontend resources and creates an emulator with the resources. The emulator is then started using the `Run` method. - -## See also - -- [Azure Static Web Apps emulator](/azure/static-web-apps/local-development) -- [Azure Static Web Apps](/azure/static-web-apps/) -- [.NET Aspire Community Toolkit GitHub repo](https://github.com/CommunityToolkit/Aspire) -- [Sample app source code](https://github.com/CommunityToolkit/Aspire/tree/main/examples/swa) diff --git a/docs/community-toolkit/overview.md b/docs/community-toolkit/overview.md index b4948b7774..4cb6891689 100644 --- a/docs/community-toolkit/overview.md +++ b/docs/community-toolkit/overview.md @@ -18,9 +18,6 @@ The community toolkit is a growing project, publishing a set of NuGet packages. ### Hosting integrations -- The [Azure Static Web Apps](/azure/static-web-apps/static-web-apps-cli-overview) integration enables local emulator support: - - [📄 .NET Aspire Azure Static Web Apps emulator integration](hosting-azure-static-web-apps.md). - - [📦 CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps](https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps). - The [Azure Data API Builder](/azure/data-api-builder/overview) integration enables seamless API creation for your data: - [📄 .NET Aspire Azure Data API Builder integration](https://github.com/CommunityToolkit/Aspire/tree/main/src/CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder). - [📦 CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder](https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder). diff --git a/docs/fundamentals/integrations-overview.md b/docs/fundamentals/integrations-overview.md index a2d58bc6d8..c292cf9552 100644 --- a/docs/fundamentals/integrations-overview.md +++ b/docs/fundamentals/integrations-overview.md @@ -143,7 +143,6 @@ For more information, see [GitHub: Aspire.Hosting.AWS library](https://github.co | Integration docs and NuGet packages | Description | |--|--| -| - **Learn More**: [📄 Azure Static Web Apps emulator](../community-toolkit/hosting-azure-static-web-apps.md)
- **Hosting**: [📦 CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps](https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.Azure.StaticWebApps)
- **Client**: N/A | A hosting integration for the [Azure Static Web Apps emulator](/azure/static-web-apps/static-web-apps-cli-overview) (Note: this does not support deployment of a project to Azure Static Web Apps). | | - **Learn More**: [📄 Bun hosting](../community-toolkit/hosting-bun.md)
- **Hosting**: [📦 CommunityToolkit.Aspire.Hosting.Bun](https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.Bun)
- **Client**: N/A | A hosting integration for Bun apps. | | - **Learn More**: [📄 Deno hosting](../community-toolkit/hosting-deno.md)
- **Hosting**: [📦 CommunityToolkit.Aspire.Hosting.Deno](https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.Deno)
- **Client**: N/A | A hosting integration for Deno apps. | | - **Learn More**: [📄 Go hosting](../community-toolkit/hosting-golang.md)
- **Hosting**: [📦 CommunityToolkit.Aspire.Hosting.Golang](https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.Golang)
- **Client**: N/A | A hosting integration for Go apps. | diff --git a/docs/toc.yml b/docs/toc.yml index ce9c3d7145..3adbb73e58 100644 --- a/docs/toc.yml +++ b/docs/toc.yml @@ -333,8 +333,6 @@ items: items: - name: Overview href: community-toolkit/overview.md - - name: Azure Static Web Apps - href: community-toolkit/hosting-azure-static-web-apps.md - name: Bun apps href: community-toolkit/hosting-bun.md - name: Dapr