Skip to content

Commit

Permalink
purge app except app host (#1105)
Browse files Browse the repository at this point in the history
* purge app except app host

* Apply suggestions from code review

Co-authored-by: David Pine <[email protected]>

---------

Co-authored-by: David Pine <[email protected]>
  • Loading branch information
jamesmontemagno and IEvangelist authored Jun 14, 2024
1 parent abde390 commit c42131c
Show file tree
Hide file tree
Showing 47 changed files with 194 additions and 194 deletions.
12 changes: 6 additions & 6 deletions docs/caching/caching-components-deployment.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: Deploy a .NET Aspire app that connects to Redis Cache to Azure
description: Learn how to deploy a .NET Aspire app that connects to Redis Cache to Azure
title: Deploy a .NET Aspire project that connects to Redis Cache to Azure
description: Learn how to deploy a .NET Aspire project that connects to Redis Cache to Azure
ms.date: 06/11/2024
ms.topic: how-to
---

# Tutorial: Deploy a .NET Aspire app with a Redis Cache to Azure
# Tutorial: Deploy a .NET Aspire project with a Redis Cache to Azure

In this tutorial, you learn to configure a .NET Aspire app with a Redis Cache for deployment to Azure. .NET Aspire provides multiple caching component configurations that provision different Redis services in Azure. You'll learn how to:
In this tutorial, you learn to configure a .NET Aspire project with a Redis Cache for deployment to Azure. .NET Aspire provides multiple caching component configurations that provision different Redis services in Azure. You'll learn how to:

> [!div class="checklist"]
>
Expand Down Expand Up @@ -108,7 +108,7 @@ The preceding code adds a Redis Container resource to your app and configures a
Tools such as the [Azure Developer CLI](/azure/developer/azure-developer-cli/overview) (`azd`) support .NET Aspire Redis component configurations to streamline deployments. `azd` consumes these settings and provisions properly configured resources for you.

> [!NOTE]
> You can also use the [Azure CLI](/dotnet/aspire/deployment/azure/aca-deployment?pivots=azure-cli) or [Bicep](/dotnet/aspire/deployment/azure/aca-deployment?pivots=azure-bicep) to provision and deploy .NET Aspire app resources. These options require more manual steps, but provide more granular control over your deployments. .NET Aspire apps can also connect to an existing Redis instance through manual configurations.
> You can also use the [Azure CLI](/dotnet/aspire/deployment/azure/aca-deployment?pivots=azure-cli) or [Bicep](/dotnet/aspire/deployment/azure/aca-deployment?pivots=azure-bicep) to provision and deploy .NET Aspire project resources. These options require more manual steps, but provide more granular control over your deployments. .NET Aspire projects can also connect to an existing Redis instance through manual configurations.
1. Open a terminal window in the root of your .NET Aspire project.

Expand Down Expand Up @@ -154,4 +154,4 @@ The deployment process created a Redis app container due to the **.AppHost** con

- [.NET Aspire deployment via Azure Container Apps](../deployment/azure/aca-deployment.md)
- [.NET Aspire Azure Container Apps deployment deep dive](../deployment/azure/aca-deployment-azd-in-depth.md)
- [Deploy a .NET Aspire app using GitHub Actions](../deployment/azure/aca-deployment-github-actions.md)
- [Deploy a .NET Aspire project using GitHub Actions](../deployment/azure/aca-deployment-github-actions.md)
2 changes: 1 addition & 1 deletion docs/caching/stackexchange-redis-caching-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ms.date: 06/11/2024

With .NET Aspire, there are several ways to use caching in your applications. One popular option is to use [Stack Exchange Redis](https://stackexchange.github.io/StackExchange.Redis), which is a high-performance data store that can be used to store frequently accessed data. This article provides an overview of Stack Exchange Redis caching and links to resources that help you use it in your applications.

To use multiple Redis caching components in your application, see [Tutorial: Implement caching with .NET Aspire components](caching-components.md). If you're interested in using the Redis Cache for Azure, see [Tutorial: Deploy a .NET Aspire app with a Redis Cache to Azure](caching-components-deployment.md).
To use multiple Redis caching components in your application, see [Tutorial: Implement caching with .NET Aspire components](caching-components.md). If you're interested in using the Redis Cache for Azure, see [Tutorial: Deploy a .NET Aspire project with a Redis Cache to Azure](caching-components-deployment.md).

## Caching

Expand Down
4 changes: 2 additions & 2 deletions docs/database/ef-core-migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ ms.topic: how-to

# Apply Entity Framework Core migrations in .NET Aspire

Since .NET Aspire apps use a containerized architecture, databases are ephemeral and can be recreated at any time. Entity Framework Core (EF Core) uses a feature called [migrations](/ef/core/managing-schemas/migrations) to create and update database schemas. Since databases are recreated when the app starts, you need to apply migrations to initialize the database schema each time your app starts. This is accomplished by registering a migration service project in your app that runs migrations during startup.
Since .NET Aspire projects use a containerized architecture, databases are ephemeral and can be recreated at any time. Entity Framework Core (EF Core) uses a feature called [migrations](/ef/core/managing-schemas/migrations) to create and update database schemas. Since databases are recreated when the app starts, you need to apply migrations to initialize the database schema each time your app starts. This is accomplished by registering a migration service project in your app that runs migrations during startup.

In this tutorial, you learn how to configure .NET Aspire apps to run EF Core migrations during app startup.
In this tutorial, you learn how to configure .NET Aspire projects to run EF Core migrations during app startup.

[!INCLUDE [aspire-prereqs](../includes/aspire-prereqs.md)]

Expand Down
6 changes: 3 additions & 3 deletions docs/database/seed-database-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ms.topic: how-to

# Seed data in a database using .NET Aspire

In this article, you learn how to configure .NET Aspire apps to seed data in a database during app startup. .NET Aspire enables you to seed data using database scripts or Entity Framework Core for common platforms such as SQL Server, PostgreSQL and MySQL.
In this article, you learn how to configure .NET Aspire projects to seed data in a database during app startup. .NET Aspire enables you to seed data using database scripts or Entity Framework Core for common platforms such as SQL Server, PostgreSQL and MySQL.

## When to seed data

Expand All @@ -16,7 +16,7 @@ Seeding data pre-populates database tables with rows of data so they're ready fo
- Manually develop and test different features of your app against a meaningful set of data, such as a product catalog or list of customers.
- Run test suites to verify that features behave a specific way with a given set of data.

Manually seeding data is tedious and time consuming, so you should automate the process when possible. Use volumes to run database scripts for .NET Aspire apps during startup. You can also seed your database using tools like Entity Framework Core, which handles many underlying concerns for you.
Manually seeding data is tedious and time consuming, so you should automate the process when possible. Use volumes to run database scripts for .NET Aspire projects during startup. You can also seed your database using tools like Entity Framework Core, which handles many underlying concerns for you.

## Understand containerized databases

Expand Down Expand Up @@ -121,7 +121,7 @@ Corresponding SQL script included in the app:

## Seed data using Entity Framework Core

You can also seed data in .NET Aspire apps using Entity Framework Core by explicitly running migrations during startup. Entity Framework Core handles underlying database connections and schema creation for you, which eliminates the need to use volumes or run SQL scripts during container startup.
You can also seed data in .NET Aspire projects using Entity Framework Core by explicitly running migrations during startup. Entity Framework Core handles underlying database connections and schema creation for you, which eliminates the need to use volumes or run SQL scripts during container startup.

> [!IMPORTANT]
> These types of configurations should only be done during development, so make sure to add a conditional that checks your current environment context.
Expand Down
6 changes: 3 additions & 3 deletions docs/database/sql-server-component-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ms.date: 05/14/2024
ms.topic: how-to
---

# Tutorial: Deploy a .NET Aspire app with a SQL Server Database to Azure
# Tutorial: Deploy a .NET Aspire project with a SQL Server Database to Azure

In this tutorial, you learn to configure an ASP.NET Core app with a SQL Server Database for deployment to Azure. .NET Aspire provides multiple SQL Server component configurations that provision different database services in Azure. You'll learn how to:

Expand Down Expand Up @@ -41,7 +41,7 @@ Visual Studio creates a new ASP.NET Core solution that is structured to use .NET

## [.NET CLI](#tab/cli)

In an empty directory, run the following command to create a new .NET Aspire app:
In an empty directory, run the following command to create a new .NET Aspire project:

```dotnetcli
dotnet new aspire-starter --output AspireSql
Expand Down Expand Up @@ -135,4 +135,4 @@ The deployment process created a SQL Server app container due to the **.AppHost*

- [.NET Aspire deployment via Azure Container Apps](../deployment/azure/aca-deployment.md)
- [.NET Aspire Azure Container Apps deployment deep dive](../deployment/azure/aca-deployment-azd-in-depth.md)
- [Deploy a .NET Aspire app using GitHub Actions](../deployment/azure/aca-deployment-github-actions.md)
- [Deploy a .NET Aspire project using GitHub Actions](../deployment/azure/aca-deployment-github-actions.md)
4 changes: 2 additions & 2 deletions docs/database/sql-server-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ The preceding code adds a SQL Server Container resource to your app and configur

The sample app is now ready for testing. Verify that the submitted form data is persisted to the database by completing the following steps:

1. Select the run button at the top of Visual Studio (or <kbd>F5</kbd>) to launch your .NET Aspire app dashboard in the browser.
1. Select the run button at the top of Visual Studio (or <kbd>F5</kbd>) to launch your .NET Aspire project dashboard in the browser.
1. On the projects page, in the **AspireSQLEFCore** row, click the link in the **Endpoints** column to open the UI of your app.

:::image type="content" source="media/app-home-screen.png" lightbox="media/app-home-screen.png" alt-text="A screenshot showing the home page of the .NET Aspire support application.":::
Expand All @@ -117,4 +117,4 @@ The sample app is now ready for testing. Verify that the submitted form data is

- [.NET Aspire with SQL Database deployment](sql-server-component-deployment.md)
- [.NET Aspire deployment via Azure Container Apps](../deployment/azure/aca-deployment.md)
- [Deploy a .NET Aspire app using GitHub Actions](../deployment/azure/aca-deployment-github-actions.md)
- [Deploy a .NET Aspire project using GitHub Actions](../deployment/azure/aca-deployment-github-actions.md)
36 changes: 18 additions & 18 deletions docs/deployment/azure/aca-deployment-azd-in-depth.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
title: Deploy a .NET Aspire app to Azure Container Apps using `azd` (in-depth guide)
description: Learn how to use `azd` to deploy .NET Aspire apps to Azure Container Apps.
title: Deploy a .NET Aspire project to Azure Container Apps using `azd` (in-depth guide)
description: Learn how to use `azd` to deploy .NET Aspire projects to Azure Container Apps.
ms.date: 03/08/2024
ms.custom: devx-track-extended-azdevcli
---

# Deploy a .NET Aspire app to Azure Container Apps using the Azure Developer CLI (in-depth guide)
# Deploy a .NET Aspire project to Azure Container Apps using the Azure Developer CLI (in-depth guide)

The Azure Developer CLI (`azd`) has been extended to support deploying .NET Aspire applications. Use this guide to walk through the process of creating and deploying a .NET Aspire application to Azure Container Apps using the Azure Developer CLI. In this tutorial, you'll learn the following concepts:
The Azure Developer CLI (`azd`) has been extended to support deploying .NET Aspire projects. Use this guide to walk through the process of creating and deploying a .NET Aspire project to Azure Container Apps using the Azure Developer CLI. In this tutorial, you'll learn the following concepts:

> [!div class="checklist"]
>
> - Explore how `azd` integration works with .NET Aspire apps
> - Provision and deploy resources on Azure for a .NET Aspire app using `azd`
> - Explore how `azd` integration works with .NET Aspire projects
> - Provision and deploy resources on Azure for a .NET Aspire project using `azd`
> - Generate Bicep infrastructure and other template files using `azd`
[!INCLUDE [aspire-prereqs](../../includes/aspire-prereqs.md)]
Expand Down Expand Up @@ -43,9 +43,9 @@ curl -fsSL https://aka.ms/install-azd.sh | bash

The `azd init` workflow provides customized supported for .NET Aspire projects. The following diagram illustrates how this flow works conceptually and how `azd` and .NET Aspire are integrated:

:::image type="content" source="media/azd-internals.png" alt-text="Illustration of internal processing of `azd` when deploying .NET Aspire application.":::
:::image type="content" source="media/azd-internals.png" alt-text="Illustration of internal processing of `azd` when deploying .NET Aspire project.":::

1. When `azd` targets a .NET Aspire application it starts the AppHost with a special command (`dotnet run --project AppHost.csproj --output-path manifest.json --publisher manifest`), which produces the Aspire [manifest file](../manifest-format.md).
1. When `azd` targets a .NET Aspire project it starts the AppHost with a special command (`dotnet run --project AppHost.csproj --output-path manifest.json --publisher manifest`), which produces the Aspire [manifest file](../manifest-format.md).
1. The manifest file is interrogated by the `azd provision` sub-command logic to generate Bicep files in-memory only (by default).
1. After generating the Bicep files, a deployment is triggered using Azure's ARM APIs targeting the subscription and resource group provided earlier.
1. Once the underlying Azure resources are configured, the `azd deploy` sub-command logic is executed which uses the same Aspire manifest file.
Expand All @@ -62,15 +62,15 @@ The steps in this section demonstrate how to create a .NET Aspire start app and

### Create the .NET Aspire starter app

Create a new .NET Aspire application using the `dotnet new` command. You can also create the project using Visual Studio.
Create a new .NET Aspire project using the `dotnet new` command. You can also create the project using Visual Studio.

```dotnetcli
dotnet new aspire-starter --use-redis-cache -o AspireSample
cd AspireSample
dotnet run --project AspireSample.AppHost\AspireSample.AppHost.csproj
```

The previous commands create a new .NET Aspire application based on the `aspire-starter` template which includes a dependency on Redis cache. It runs the .NET Aspire project which verifies that everything is working correctly.
The previous commands create a new .NET Aspire project based on the `aspire-starter` template which includes a dependency on Redis cache. It runs the .NET Aspire project which verifies that everything is working correctly.

[!INCLUDE [init workflow](includes/init-workflow.md)]

Expand All @@ -89,7 +89,7 @@ services:
### Initial deployment
1. In order to deploy the .NET Aspire application, authenticate to Azure AD to call the Azure resource management APIs.
1. In order to deploy the .NET Aspire project, authenticate to Azure AD to call the Azure resource management APIs.
```azdeveloper
azd auth login
Expand All @@ -106,7 +106,7 @@ services:
> [!IMPORTANT]
> To push container images to the Azure Container Registry (ACR), you need to have `Microsoft.Authorization/roleAssignments/write` access. This can be achieved by enabling an **Admin user** on the registry. Open the Azure Portal, navigate to the ACR resource / Settings / Access keys, and then select the **Admin user** checkbox. For more information, see [Enable admin user](/azure/container-registry/container-registry-authentication#admin-account).

1. When prompted, select the subscription and location the resources should be deployed to. Once these options are selected the .NET Aspire application
1. When prompted, select the subscription and location the resources should be deployed to. Once these options are selected the .NET Aspire project
will be deployed.

[!INCLUDE [azd-up-output](includes/azd-up-output.md)]
Expand All @@ -126,12 +126,12 @@ Just like in local development, the configuration of connection strings has been

:::image type="content" loc-scope="azure" source="media/azd-aca-variables.png" lightbox="media/azd-aca-variables.png" alt-text="A screenshot of environment variables in the webfrontend container app.":::

For more information on how .NET Aspire apps handle connection strings and service discovery, see
For more information on how .NET Aspire projects handle connection strings and service discovery, see
[.NET Aspire orchestration overview](../../fundamentals/app-host-overview.md).

### Deploy application updates

When the `azd up` command is executed the underlying Azure resources are _provisioned_ and a container image is built and _deployed_ to the container apps hosting the .NET Aspire app. Typically once development is underway and Azure resources are deployed it won't be necessary to provision Azure resources every time code is updated—this is especially true for the developer inner loop.
When the `azd up` command is executed the underlying Azure resources are _provisioned_ and a container image is built and _deployed_ to the container apps hosting the .NET Aspire project. Typically once development is underway and Azure resources are deployed it won't be necessary to provision Azure resources every time code is updated—this is especially true for the developer inner loop.

To speed up deployment of code changes, `azd` supports deploying code updates in the container image. This is done using the `azd deploy` command:

Expand All @@ -141,7 +141,7 @@ azd deploy

[!INCLUDE [azd-deploy-output](includes/azd-deploy-output.md)]

It's not necessary to deploy all services each time. `azd` understands the .NET Aspire app model, it's possible to deploy just one of the services specified using the following command:
It's not necessary to deploy all services each time. `azd` understands the .NET Aspire project model, it's possible to deploy just one of the services specified using the following command:

```azdeveloper
azd deploy webfrontend
Expand All @@ -151,7 +151,7 @@ For more information, see [Azure Developer CLI reference: azd deploy](/azure/dev

### Deploy infrastructure updates

Whenever the dependency structure within a .NET Aspire app changes, `azd` must re-provision the underlying Azure resources. The `azd provision` command is used to apply these changes to the infrastructure.
Whenever the dependency structure within a .NET Aspire project changes, `azd` must re-provision the underlying Azure resources. The `azd provision` command is used to apply these changes to the infrastructure.

To see this in action, update the _:::no-loc text="Program.cs":::_ file in the AppHost project to the following:

Expand Down Expand Up @@ -194,7 +194,7 @@ The previous command may take some time to execute, but when completed the resou

[!INCLUDE [azd-down-output](includes/azd-down-output.md)]

## Generate Bicep from .NET Aspire app model
## Generate Bicep from .NET Aspire project model

Although development teams are free to use `azd up` (or `azd provision` and `azd deploy`) commands for their deployments both for development and production purposes, some teams may choose to generate Bicep files that they can review and manage as part of version control (this also allows these Bicep files to be referenced as part of a larger more complex Azure deployment).

Expand All @@ -209,7 +209,7 @@ After this command is executed in the starter template example used in this guid

- _infra/main.bicep_: Represents the main entry point for the deployment.
- _infra/main.parameters.json_: Used as the parameters for main Bicep (maps to environment variables defined in _.azure_ folder).
- _infra/resoures.bicep_: Defines the Azure resources required to support the .NET Aspire app model.
- _infra/resoures.bicep_: Defines the Azure resources required to support the .NET Aspire project model.
- _AspireSample.Web/manifests/containerApp.tmpl.yaml_: The container app definition for `webfrontend`.
- _AspireSample.ApiService/manifests/containerApp.tmpl.yaml_: The container app definition for `apiservice`.

Expand Down
Loading

0 comments on commit c42131c

Please sign in to comment.