Skip to content

Update sql-server-component-deployment.md #1572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -44,7 +44,7 @@ Visual Studio creates a new ASP.NET Core solution that is structured to use .NET
In an empty directory, run the following command to create a new .NET Aspire project:

```dotnetcli
dotnet new aspire-starter --output AspireSql
dotnet new aspire-starter --output AspireSQL
```

The .NET CLI creates a new ASP.NET Core solution that is structured to use .NET Aspire. The solution consists of the following projects:
Expand Down Expand Up @@ -93,15 +93,15 @@ Configure the _AspireSQL.AppHost_ project for your desired SQL database service.

Replace the contents of the _:::no-loc text="Program.cs":::_ file in the _AspireSQL.AppHost_ project with the following code:

:::code language="csharp" source="snippets/tutorial/aspiresqldeployazure/AspireSql.AppHost/Program.cs":::
:::code language="csharp" source="snippets/tutorial/aspiresqldeployazure/AspireSQL.AppHost/Program.cs":::

The preceding code adds a SQL Server Container resource to your app and configures a connection to a database called `sqldata`. The `PublishAsAzureSqlDatabase` method ensures that tools such as the Azure Developer CLI or Visual Studio create an Azure SQL Database resource during the deployment process.

## [SQL Server Container](#tab/sql-container)

Replace the contents of the Program.cs file in the AspireSQL.AppHost project with the following code:

:::code language="csharp" source="snippets/tutorial/aspiresqldeploycontainer/AspireSql.AppHost/Program.cs":::
:::code language="csharp" source="snippets/tutorial/aspiresqldeploycontainer/AspireSQL.AppHost/Program.cs":::

The preceding code adds a SQL Server Container resource to your app and configures a connection to a database called `sqldata`. This configuration also ensures that tools such as the Azure Developer CLI or Visual Studio create a containerized SQL Server instance during the deployment process.

Expand Down
Loading