Skip to content

Updated init steps and up workflow #930

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 5 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
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
31 changes: 2 additions & 29 deletions docs/database/sql-server-component-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,36 +111,9 @@ The preceding code adds a SQL Server Container resource to your app and configur

Tools such as the [Azure Developer CLI](/azure/developer/azure-developer-cli/overview) (`azd`) support .NET Aspire SQL Server 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?branch=pr-en-us-532&tabs=visual-studio%2Clinux%2Cpowershell&pivots=azure-cli) or [Bicep](/dotnet/aspire/deployment/azure/aca-deployment?branch=pr-en-us-532&tabs=visual-studio%2Clinux%2Cpowershell&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 databases hosted on other services through manual configurations.

1. Open a terminal window in the root of your .NET Aspire project.

1. Run the `azd init` command to initialize the project with `azd`.

```azdeveloper
azd init
```

1. When prompted for an environment name, enter *docs-aspiresql*.

1. Run the `azd up` command to begin the deployment process:

```azdeveloper
azd up
```

1. When prompted, choose to expose the **webfrontend** service to the internet.

1. Select the Azure subscription that should host your app resources.

1. Select the Azure location to use.

The Azure Developer CLI provisions and deploys your app resources. The process may take a few minutes to complete.

[!INCLUDE [azd-up-output](../deployment/azure/includes/azd-up-output.md)]
[!INCLUDE [init-workflow](../deployment/azure/includes/init-workflow.md)]

1. When the deployment finishes, click the resource group link in the output to view the created resources in the Azure portal.
[!INCLUDE [azd-up-workflow](../deployment/azure/includes/azd-up-workflow.md)]

## [Azure SQL Database](#tab/azure-sql)

Expand Down
12 changes: 1 addition & 11 deletions docs/deployment/azure/aca-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,7 @@ The process for installing `azd` varies based on your operating system, but it i

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

## Deploy the app

Once `azd` is initialized, the provisioning and deployment process can be executed as a single command from the _AppHost_ project directory, [azd up](/azure/developer/azure-developer-cli/reference#azd-up).

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

First, the projects will be packaged into containers during the `azd package` phase, followed by the `azd provision` phase during which all of the Azure resources the app will need are provisioned.

Once `provision` is complete, `azd deploy` will take place. During this phase, the projects are pushed as containers into an Azure Container Registry instance, and then used to create new revisions of Azure Container Apps in which the code will be hosted.

At this point the app has been deployed and configured, and you can open the Azure portal and explore the resources.
[!INCLUDE [azd-up-workflow](includes/azd-up-workflow.md)]

[!INCLUDE [test-deployed-app](includes/test-deployed-app.md)]

Expand Down
38 changes: 38 additions & 0 deletions docs/deployment/azure/includes/azd-up-workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## Deploy the template

1. Once an `azd` template is initialized, the provisioning and deployment process can be executed as a single command from the _AppHost_ project directory using [azd up](/azure/developer/azure-developer-cli/reference#azd-up):

```azdeveloper
azd up
```

1. Select the subscription you'd like to deploy to from the list of available options:

```output
Select an Azure Subscription to use: [Use arrows to move, type to filter]
1. SampleSubscription01 (xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx)
2. SamepleSubscription02 (xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx)
```

1. Select the desired Azure location to use from the list of available options:

```output
Select an Azure location to use: [Use arrows to move, type to filter]
42. (US) Central US (centralus)
43. (US) East US (eastus)
> 44. (US) East US 2 (eastus2)
46. (US) North Central US (northcentralus)
47. (US) South Central US (southcentralus)
```

After you make your selections, `azd` executes the provisioning and deployment process.

[!INCLUDE [azd-up-output](azd-up-output.md)]

The `azd up` command acts as wrapper for the following individual `azd` commands to provision and deploy your resources in a single step:

1. [`azd package`](/azure/developer/azure-developer-cli/reference#azd-package): The app projects and their dependencies are packaged into containers.
1. [`azd provision`](/azure/developer/azure-developer-cli/reference#azd-provision): The Azure resources the app will need are provisioned.
1. [`azd deploy`](/azure/developer/azure-developer-cli/reference#azd-deploy): The projects are pushed as containers into an Azure Container Registry instance, and then used to create new revisions of Azure Container Apps in which the code will be hosted.

When the `azd up` stages complete, your app will be available on Azure, and you can open the Azure portal to explore the resources. `azd` also outputs URLs to access the deployed apps directly.
22 changes: 1 addition & 21 deletions docs/deployment/azure/includes/init-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@

For more information on the `azd init` command, see [azd init](/azure/developer/azure-developer-cli/reference#azd-init).

1. If this is the first time you've initialized the app, `azd` prompts you for the environment name:

```azdeveloper
Initializing an app to run on Azure (azd init)

? Enter a new environment name: [? for help]
```

Enter the desired environment name to continue. For more information on managing environments with `azd`, see [azd env](/azure/developer/azure-developer-cli/reference#azd-env).

1. Select **Use code in the current directory** when `azd` prompts you with two app initialization options.

```Output
Expand All @@ -43,17 +33,7 @@
Cancel and exit
```

1. `azd` presents each of the projects in the .NET Aspire solution and prompts you to identify which to deploy with HTTP ingress open publicly to all internet traffic. Select only the `webfrontend` (using the <kbd>↓</kbd> and <kbd>Space</kbd> keys), since you want the API to be private to the Azure Container Apps environment and *not* available publicly.

```Output
? Select an option Confirm and continue initializing my app
By default, a service can only be reached from inside the Azure Container Apps environment it is running in. Selecting a service here will also allow it to be reached from the Internet.
? Select which services to expose to the Internet [Use arrows to move, space to select, <right> to all, <left> to none, type to filter]
[ ] apiservice
> [x] webfrontend
```

1. Finally, specify the the environment name, which is used to name provisioned resources in Azure and managing different environments such as `dev` and `prod`.
1. Enter an environment name, which is used to name provisioned resources in Azure and managing different environments such as `dev` and `prod`.

```Output
Generating files to run your app on Azure:
Expand Down
Loading