Перейти к содержимому
Docs Try Aspire

Azure Developer CLI (azd)

Это содержимое пока не доступно на вашем языке.

The Azure Developer CLI (azd) is a developer-oriented command-line tool that can provision Azure resources and deploy applications from your local environment or CI/CD pipelines. It integrates with Aspire by consuming the deployment manifest format to understand your app model and automatically provision the corresponding Azure resources.

While aspire deploy is the recommended path, azd remains useful in several scenarios:

  • You have existing azd workflows and infrastructure templates you want to continue using.
  • You need azd pipeline config for automated CI/CD setup with GitHub Actions or Azure DevOps.
  • You want to use azd environment management features to manage multiple deployment environments.
  • You’re working with teams already familiar with azd conventions and tooling.
  1. Initialize your project — run azd init from your AppHost directory. When prompted, select Use code in the current directory so azd detects the Aspire app model.

    Initialize azd in the AppHost directory
    azd init
  2. Provision and deploy — run azd up to provision the required Azure resources and deploy your application in a single step. This combines the azd provision and azd deploy commands.

    Provision infrastructure and deploy
    azd up
  3. Redeploy without reprovisioning — after the initial deployment, use azd deploy to push code changes without reprovisioning infrastructure.

    Deploy updated code
    azd deploy
Featureaspire deployazd
Azure Container Apps
Azure App Service
Infrastructure provisioningBuilt-inBuilt-in
CI/CD pipeline setupManualazd pipeline config
Environment managementState cachingazd env
Manifest dependencyNoYes

The aspire deploy path and azd use different resource naming schemes by default. If you’re upgrading from an existing azd deployment to aspire deploy, use WithAzdResourceNaming() to preserve the original naming convention. This avoids creating duplicate Azure resources:

AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
builder.AddAzureContainerAppEnvironment("env")
.WithAzdResourceNaming();

The azd tool relies on the deployment manifest format to understand your application topology. The manifest is a JSON document generated from the AppHost that describes resources, bindings, and parameters. It’s produced automatically when azd invokes the AppHost during deployment.