text:
Restructuring specific command flags

Hide specific flags that are being deprecated or hidden for preview. Issue warning messages for deprecated usage.
Changes:

Remove azd init from azd up (flags and execution)
azd deploy and azd restore now accepts a positional arg. azd deploy <web> instead of azd deploy --service <web>.
Hide --no-progress flag from azd provision and azd up
Hide --output flag from all commands

Fixes: https://github.com/Azure/azure-dev-pr/issues/1495

Azure Dev CLI Install Instructions
Install scripts
MacOS/Linux

May elevate using sudo on some platforms and configurations

bash:
curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1801/uninstall-azd.sh | bash;
curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1801/install-azd.sh | bash -s -- --base-url https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1801 --version '' --verbose

pwsh:
Invoke-RestMethod 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1801/uninstall-azd.ps1' -OutFile uninstall-azd.ps1; ./uninstall-azd.ps1
Invoke-RestMethod 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1801/install-azd.ps1' -OutFile install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1801' -Version '' -Verbose

Windows
PowerShell install
powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1801/uninstall-azd.ps1' > uninstall-azd.ps1; ./uninstall-azd.ps1;"
powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1801/install-azd.ps1' > install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1801' -Version '' -Verbose;"

MSI install
powershell -c "irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1801/azd-windows-amd64.msi' -OutFile azd-windows-amd64.msi; msiexec /i azd-windows-amd64.msi /qn"

Standalone Binary

Linux -

x86_64 - https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1801/azd-linux-amd64.tar.gz
ARM64 - https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1801/azd-linux-arm64.tar.gz

MacOS -

x86_64 - https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1801/azd-darwin-amd64.zip
ARM64 - https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1801/azd-darwin-arm64.zip

Windows - https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1801/azd-windows-amd64.zip

MSI

https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/1801/azd-windows-amd64.msi

Container
docker run -it azdevcliextacr.azurecr.io/azure-dev:pr-1801

Documentation

learn.microsoft.com documentation

title: Azure Developer CLI reference (preview)
description: This article explains the syntax and parameters for the various Azure Developer CLI Preview commands.
author: hhunter-ms
ms.author: hannahhunter
ms.date: 03/27/2023
ms.service: azure-dev-cli
ms.topic: conceptual
ms.custom: devx-track-azdevcli
Azure Developer CLI reference (preview)
This article explains the syntax and parameters for the various Azure Developer CLI Preview commands.
azd
The Azure Developer CLI (azd) is an open-source tool that helps onboard and manage your application on Azure
Options
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
  -h, --help         Gets help for azd.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd config: Manage azd configurations (ex: default Azure subscription, location).
azd deploy: Deploy the application's code to Azure.
azd down: Delete Azure resources for an application.
azd env: Manage environments.
azd infra: Manage your Azure infrastructure.
azd init: Initialize a new application.
azd login: Log in to Azure.
azd logout: Log out of Azure.
azd monitor: Monitor a deployed application.
azd pipeline: Manage and configure your deployment pipelines.
azd provision: Provision the Azure resources for an application.
azd restore: Restore application dependencies.
azd template: Find and view template details.
azd up: Provision Azure resources, and deploy your project with a single command.
azd version: Print the version number of Azure Developer CLI.

azd config
Manage azd configurations (ex: default Azure subscription, location).
Synopsis
Manage the Azure Developer CLI user configuration, which includes your default Azure subscription and location.
Available since azure-dev-cli_0.4.0-beta.1.
The easiest way to configure azd for the first time is to run azd init. The subscription and location you select will be stored in the config.json file located in the config directory. To configure azd anytime afterwards, you'll use azd config set.
The default value of the config directory is:

$HOME/.azd on Linux and macOS
%USERPROFILE%.azd on Windows

The configuration directory can be overridden by specifying a path in the AZD_CONFIG_DIR environment variable.
Options
  -h, --help   Gets help for config.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd config get: Gets a configuration
azd config list: Lists all configuration values
azd config reset: Resets configuration to default
azd config set: Sets a configuration
azd config unset: Unsets a configuration
Back to top

azd config get
Gets a configuration
Synopsis
Gets a configuration in the configuration path.
The default value of the config directory is:

$HOME/.azd on Linux and macOS
%USERPROFILE%\.azd on Windows

The configuration directory can be overridden by specifying a path in the AZD_CONFIG_DIR environment variable.
azd config get <path> [flags]

Options
  -h, --help   Gets help for get.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd config: Manage azd configurations (ex: default Azure subscription, location).
Back to top

azd config list
Lists all configuration values
Synopsis
Lists all configuration values in the configuration path.
The default value of the config directory is:

$HOME/.azd on Linux and macOS
%USERPROFILE%\.azd on Windows

The configuration directory can be overridden by specifying a path in the AZD_CONFIG_DIR environment variable.
azd config list [flags]

Options
  -h, --help   Gets help for list.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd config: Manage azd configurations (ex: default Azure subscription, location).
Back to top

azd config reset
Resets configuration to default
Synopsis
Resets all configuration in the configuration path.
The default value of the config directory is:

$HOME/.azd on Linux and macOS
%USERPROFILE%\.azd on Windows

The configuration directory can be overridden by specifying a path in the AZD_CONFIG_DIR environment variable to the default.
azd config reset [flags]

Options
  -h, --help   Gets help for reset.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd config: Manage azd configurations (ex: default Azure subscription, location).
Back to top

azd config set
Sets a configuration
Synopsis
Sets a configuration in the configuration path.
The default value of the config directory is:

$HOME/.azd on Linux and macOS
%USERPROFILE%\.azd on Windows

The configuration directory can be overridden by specifying a path in the AZD_CONFIG_DIR environment variable.
azd config set <path> <value> [flags]

Examples
azd config set defaults.subscription <yourSubscriptionID>
azd config set defaults.location eastus

Options
  -h, --help   Gets help for set.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd config: Manage azd configurations (ex: default Azure subscription, location).
Back to top

azd config unset
Unsets a configuration
Synopsis
Removes a configuration in the configuration path.
The default value of the config directory is:

$HOME/.azd on Linux and macOS
%USERPROFILE%\.azd on Windows

The configuration directory can be overridden by specifying a path in the AZD_CONFIG_DIR environment variable.
azd config unset <path> [flags]

Examples
azd config unset defaults.location

Options
  -h, --help   Gets help for unset.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd config: Manage azd configurations (ex: default Azure subscription, location).
Back to top

azd deploy
Deploy the application's code to Azure.
azd deploy <service> [flags]

Options
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for deploy.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

Back to top

azd down
Delete Azure resources for an application.
azd down [flags]

Options
  -e, --environment string   The name of the environment to use.
      --force                Does not require confirmation before it deletes resources.
  -h, --help                 Gets help for down.
      --purge                Does not require confirmation before it permanently deletes resources that are soft-deleted by default (for example, key vaults).

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

Back to top

azd env
Manage environments.
Options
  -h, --help   Gets help for env.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd env get-values: Get all environment values.
azd env list: List environments.
azd env new: Create a new environment.
azd env refresh: Refresh environment settings by using information from a previous infrastructure provision.
azd env select: Set the default environment.
azd env set: Manage your environment settings.
Back to top

azd env get-values
Get all environment values.
azd env get-values [flags]

Options
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for get-values.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd env: Manage environments.
Back to top

azd env list
List environments.
azd env list [flags]

Options
  -h, --help   Gets help for list.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd env: Manage environments.
Back to top

azd env new
Create a new environment.
azd env new <environment> [flags]

Options
  -h, --help                  Gets help for new.
  -l, --location string       Azure location for the new environment
      --subscription string   Name or ID of an Azure subscription to use for the new environment

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd env: Manage environments.
Back to top

azd env refresh
Refresh environment settings by using information from a previous infrastructure provision.
azd env refresh [flags]

Options
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for refresh.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd env: Manage environments.
Back to top

azd env select
Set the default environment.
azd env select <environment> [flags]

Options
  -h, --help   Gets help for select.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd env: Manage environments.
Back to top

azd env set
Manage your environment settings.
azd env set <key> <value> [flags]

Options
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for set.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd env: Manage environments.
Back to top

azd infra
Manage your Azure infrastructure.
Options
  -h, --help   Gets help for infra.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd infra create: Provision the Azure resources for an app.
azd infra delete: Delete Azure resources for an app.
Back to top

azd infra create
Provision the Azure resources for an app.
Synopsis
Provision the Azure resources for an app.
The command prompts you for the following values:

Environment name: The name of your environment.
Azure location: The Azure location where your resources will be deployed.
Azure subscription: The Azure subscription where your resources will be deployed.

Depending on what Azure resources are created, running this command might take a while. To view progress, go to the Azure portal and search for the resource group that contains your environment name.
azd infra create [flags]

Options
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for create.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd infra: Manage your Azure infrastructure.
Back to top

azd infra delete
Delete Azure resources for an app.
azd infra delete [flags]

Options
  -e, --environment string   The name of the environment to use.
      --force                Does not require confirmation before it deletes resources.
  -h, --help                 Gets help for delete.
      --purge                Does not require confirmation before it permanently deletes resources that are soft-deleted by default (for example, key vaults).

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd infra: Manage your Azure infrastructure.
Back to top

azd init
Initialize a new application.
azd init [flags]

Options
  -b, --branch string         The template branch to initialize from.
  -e, --environment string    The name of the environment to use.
  -h, --help                  Gets help for init.
  -l, --location string       Azure location for the new environment
      --subscription string   Name or ID of an Azure subscription to use for the new environment
  -t, --template string       The template to use when you initialize the project. You can use Full URI, <owner>/<repository>, or <repository> if it's part of the azure-samples organization.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

Back to top

azd login
Log in to Azure.
Synopsis
Log in to Azure.
When run without any arguments, log in interactively using a browser. To log in using a device code, pass
--use-device-code.
To log in as a service principal, pass --client-id and --tenant-id as well as one of: --client-secret,
--client-certificate, --federated-credential, or --federated-credential-provider.
azd login [flags]

Options
      --check-status                           Checks the log-in status instead of logging in.
      --client-certificate string              The path to the client certificate for the service principal to authenticate with.
      --client-id string                       The client id for the service principal to authenticate with.
      --client-secret string                   The client secret for the service principal to authenticate with. Set to the empty string to read the value from the console.
      --federated-credential string            The federated token for the service principal to authenticate with. Set to the empty string to read the value from the console.
      --federated-credential-provider string   The provider to use to acquire a federated token to authenticate with.
  -h, --help                                   Gets help for login.
      --redirect-port int                      Choose the port to be used as part of the redirect URI during interactive login.
      --tenant-id string                       The tenant id or domain name to authenticate with.
      --use-device-code                        When true, log in by using a device code instead of a browser.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

Back to top

azd logout
Log out of Azure.
Synopsis
Log out of Azure
azd logout [flags]

Options
  -h, --help   Gets help for logout.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

Back to top

azd monitor
Monitor a deployed application.
azd monitor [flags]

Options
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for monitor.
      --live                 Open a browser to Application Insights Live Metrics. Live Metrics is currently not supported for Python apps.
      --logs                 Open a browser to Application Insights Logs.
      --overview             Open a browser to Application Insights Overview Dashboard.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

Back to top

azd pipeline
Manage and configure your deployment pipelines.
Options
  -h, --help   Gets help for pipeline.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd pipeline config: Create and configure your deployment pipeline by using GitHub or Azure Pipelines.
Back to top

azd pipeline config
Create and configure your deployment pipeline by using GitHub or Azure Pipelines.
azd pipeline config [flags]

Options
      --auth-type string        The authentication type used between the pipeline provider and Azure for deployment (Only valid for GitHub provider)
  -e, --environment string      The name of the environment to use.
  -h, --help                    Gets help for config.
      --principal-name string   The name of the service principal to use to grant access to Azure resources as part of the pipeline.
      --principal-role string   The role to assign to the service principal. (default "contributor")
      --provider string         The pipeline provider to use (github for Github Actions and azdo for Azure Pipelines).
      --remote-name string      The name of the git remote to configure the pipeline to run on. (default "origin")

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd pipeline: Manage and configure your deployment pipelines.
Back to top

azd provision
Provision the Azure resources for an application.
azd provision [flags]

Options
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for provision.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

Back to top

azd restore
Restore application dependencies.
azd restore <service> [flags]

Options
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for restore.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

Back to top

azd template
Find and view template details.
Options
  -h, --help   Gets help for template.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd template list: Show list of sample azd templates.
azd template show: Show details for a given template.
Back to top

azd template list
Show list of sample azd templates.
azd template list [flags]

Options
  -h, --help   Gets help for list.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd template: Find and view template details.
Back to top

azd template show
Show details for a given template.
azd template show <template> [flags]

Options
  -h, --help   Gets help for show.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

azd template: Find and view template details.
Back to top

azd up
Provision Azure resources, and deploy your project with a single command.
azd up [flags]

Options
  -e, --environment string   The name of the environment to use.
  -h, --help                 Gets help for up.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

Back to top

azd version
Print the version number of Azure Developer CLI.
azd version [flags]

Options
  -h, --help   Gets help for version.

Options inherited from parent commands
  -C, --cwd string   Sets the current working directory.
      --debug        Enables debugging and diagnostics logging.
      --no-prompt    Accepts the default value instead of prompting, or it fails if there is no default.

See also

Back to top

authors: azure-sdk weikanglim


text:
Allow Connect-AzureAD's session to have an unique identifier which can be used to disconnect via Disconnect-AzureAD

In the Az.Accounts module, there are two cmdlets: Connect-AzAccount and Disconnect-AzAccount. I'm using them as follows:
$contextName = (New-Guid).Guid
$result = Connect-AzAccount -Subscription $SubscriptionId -Credential $credential -ContextName $contextName -Scope Process
# ...
# code
# ...
Disconnect-AzAccount -ContextName $contextName

This allows me to be connected to Azure in multiple contexts with different accounts. I would like to have the same feature with Connect-AzureAD and Disconnect-AzureAD. I saw that Disconnect-AzureAD takes no parameters, so I assumed that it removes all contexts created by Connect-AzureAD.
What would be the usage for this feature?
I have a Jenkins Job used for automation, and that job gets triggered a lot of times. If there are two or more jobs running at the same time, a scenario where one build connects and the other disconnects thus causing the build that just connected to fail, can happen.
Is there a way to scope the Context to the current PowerShell session or to have the same workflow as Az.Accounts?

Hello @psignoret, could you please help to answer this query?

@msewaweru I'm not familiar with the details for how Connect-AzureAD or Disconnect-AzureAD work with regards to PowerShell sessions.

@msewaweru I'm not familiar with the details for how Connect-AzureAD or Disconnect-AzureAD work with regards to PowerShell sessions.

Thanks @psignoret. I will try get the owner of this cmdlet to address it.

@DerrickJKimani, could you direct me to the owner of this cmdlet?

Hello @vivere-dally , apologies for the delay in getting you a response to this issue.
I would recommend that you try Microsoft Graph PowerShell as Azure AD PowerShell is planned for deprecation and all investments are currently in this new module.
I will proceed to close this issue. Feel free to reopen it with any follow-up feedback.

source: gharchive/issue

authors: msewaweru psignoret vivere-dally

repo: Azure/azure-docs-powershell-azuread

license_type: permissive

license_source: github-api