Azure / azure-dev

A developer CLI that reduces the time it takes for you to get started on Azure. The Azure Developer CLI (azd) provides a set of developer-friendly commands that map to key stages in your workflow - code, build, deploy, monitor, repeat.
https://aka.ms/azd
MIT License
377 stars 173 forks source link

OneAuth integration on Windows #3216

Closed chlowell closed 3 months ago

chlowell commented 4 months ago

This adds a build tag (oneauth) that replaces browser auth on Windows with OneAuth i.e., when this tag is set, azd will open OneAuth's login window instead of a browser. Other platforms and auth flows aren't affected. OneAuth is a C++ library, so calling into it from Go requires cgo and a C ABI. cgo requires a gcc compiler; I've used MSYS2 to install and configure MinGW. OneAuth doesn't have a C ABI, so this PR includes a bridge library that does. Building OneAuth for Windows (and hence the bridge library) requires MSVC. The go link tool can't link MSVC objects, so static linking is out of the question and distribution is awkward. I have azd embed the bridge DLL and write it to %LocalAppData%/azd at runtime when needed.

vhvb1989 commented 4 months ago

This is awesome!

IMHO, I would rather see the OneAuth as an external binary (instead of embedded library). Is there a reason why that approach wouldn't work?

Probably a tool on azure-sdk-tools repo (or its own repo) which publishes a 64-binary and a 64-arm binary on github. Then azd would just pull it into ~/.azd/bin the same way it does for bicep and gh-cli.

The tool would become beneficial for other cli as well, like az. And we could let azd to chose interactive-browser or OneAuth with app-configuration, instead of build-arg...

ellismg commented 4 months ago

Thanks @chlowell,

This is some work that Charles did to get azd to use a centralized auth library from an internal Microsoft team which handles some new features we might want. Part of the exercise was to figure out how we could integrate with this existing C++ library from a Go app which had challenging deployment characteristics (i.e. we can't statically link it, there's no stable C ABI).

Charles is going to take these learnings back to the OneAuth team and see if we can make some improvements to their library to make it easier for tools like us to consume.

I asked @chlowell to open this PR because the stuff is behind a build flag so there should be no impact to the standard AZD builds. I think we will want to take and merge this code (still behind a flag) and maintain it because we might need to integrate with OneAuth at one point (for one thing, it gives us an answer for WAM support, something people mention from time to time internally).

vhvb1989 commented 4 months ago

Thanks for the context @ellismg

Still curious about the "why" around making azd to consume a C++ library instead of creating a C++ binary which azd can consume as external dependency.

chlowell commented 4 months ago

Thanks for adding context @ellismg. To add some more, this is part of an effort to unify DevDiv tools on a single authentication stack to reduce duplicate effort, unify UX, and make single sign-on possible.

Still curious about the "why" around making azd to consume a C++ library instead of creating a C++ binary which azd can consume as external dependency.

The OneAuth team doesn't ship binaries because the project is for first-party use only.

vhvb1989 commented 4 months ago

The OneAuth team doesn't ship binaries because the project is for first-party use only.

@chlowell , if I understand correctly, we are introducing a go-layer to azd to call the C++ library (think we call it the bridge). So, instead of maintaining such bridge, can we maintain a C++ binary that calls the C++ library based on input args?

Either way, looks like we would be signing to maintain the bridge, either with the go-to-dll strategy (in-process) or by calling an external app (external-process). I would vote for an external app and stay away from the insecure packages and manual memory management with go. From a C++ binary, we can use smart-pointers and keep it idiomatic.

Let me pull @JeffreyRichter and ask for advising here.

chlowell commented 4 months ago

if I understand correctly, we are introducing a go-layer to azd to call the C++ library (think we call it the bridge). So, instead of maintaining such bridge, can we maintain a C++ binary that calls the C++ library based on input args?

Sorry, I don't understand. oneauth/bridge is a C++ binary that calls OneAuth based on input args. What other binary should we maintain?

vhvb1989 commented 4 months ago

if I understand correctly, we are introducing a go-layer to azd to call the C++ library (think we call it the bridge). So, instead of maintaining such bridge, can we maintain a C++ binary that calls the C++ library based on input args?

Sorry, I don't understand. oneauth/bridge is a C++ binary that calls OneAuth based on input args. What other binary should we maintain?

For what I'm reading in the code, we are not creating an exe to be executed on Windows. We are creating a library (dll) and using go-code to run the code from that dll (https://github.com/Azure/azure-dev/pull/3216/files#diff-5ed96b12f86a7dea76bf70a95444375063fbcd2733842f070beccf892a9ac1caR156). That is what I am trying to understand the why.

I am wondering if we can move the c++ code to its own repo and update the code to create an exe file (having a main() entry point for the OS to init :).
From that repo, we can produce static build (exe alone) and dynamic build (exe + dll). Or any other configuration.

Then, from azd, we would use the commandRunner ( the one we use to run external tools like bicep, dotnet, npm, etc) to invoke the c++ binary (the exe).

ellismg commented 4 months ago

I will admit I encouraged @chlowell a bit down the path he went down (embedding the DLL) because I think in both of our minds where were thinking: "In an ideal world we'd have some OneAuth library we could statically link against with Cgo but the library today does not support static linking so we'll do this other thing that looks sort of like static linking if you squint and then try to push the team that owns OneAuth into building a stable C ABI and providing a library we can statically link against".

I also like the idea of azd carrying with it everything it needs to have for auth instead of requiring it to download other binaries to do it.

That said, I could imagine that we embed a exe instead of a dll and then use some mechanism to invoke it (either via our command runner and a set of flags) or some other strategy like JSON-RPC but I'd want to know what we really gain by doing that. I guess azd itself can remain pure go on Windows, which is quite nice, but I'm not actually sure it's worth it. We'd get to remove some of the interop code, but it feels like the overall architecture ends up being more complex an harder to evovle.

I also don't know if having it be a sperate process is going to be a bad idea long term, for example in cases where the component has to pop UI to log in. That UI not being associated with the azd process (and instead some azd-auth-helper-one-auth process) may be probmatic?

chlowell commented 4 months ago

Thanks for all the feedback. I'll mark this ready to review when I think it's ready to merge. I'm still debugging MSA authentication, which looks like it should work but doesn't.

I'm still not sure I want to enable this by default in azd but having the code here for when we are ready to turn it on makes sense.

👍 I agree, today this is a lot of complexity for not much benefit. How would you feel about shipping it in a beta?

It would be nice to get at least some coverage of the build (I don't think we need to run tests - and also, I think running these tests in CI would be "hard"). Maybe @danieljurek can help get another leg of our pipeline that passes a path to the msys2 shell and skips the tests.

Once you've got build automation the tests should just work in CI--they don't require user interaction--provided the agent can write %LocalAppData%. Setting up the build is hard though 😞

weikanglim commented 4 months ago

Late to the train here :) But I'd +1 to OneAuth either exposing static linking via C ABI or an out-of-proc execution model. This would also benefit Rust programs as well for FFI (which seems to have increasing adoption).

ellismg commented 4 months ago

How would you feel about shipping it in a beta?

I would be fine with this - just nervous about making it the default on windows right away, but happy to let folks opt into the world. I'd also be happy with us flighting it to say 20% of our windows users for the default interactive login mode and doing a progressive rollout that way. We have the technology now to do such things (and we did it for some earlier work) so happy to do that here as well.

rajeshkamal5050 commented 4 months ago

@chlowell curious, what are the file sizes of these dependencies?

chlowell commented 4 months ago

@chlowell curious, what are the file sizes of these dependencies?

Their release builds add up to ~4.3 MB.

chlowell commented 4 months ago

I made a few changes to better support MSA scenarios:

azure-sdk commented 3 months ago

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/3216/uninstall-azd.sh | bash;
curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3216/install-azd.sh | bash -s -- --base-url https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3216 --version '' --verbose --skip-verify

pwsh:

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

Windows

PowerShell install

powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3216/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/3216/install-azd.ps1' > install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3216' -Version '' -SkipVerify -Verbose;"

MSI install

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

Standalone Binary

MSI

Container

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

Documentation

learn.microsoft.com documentation --- title: Azure Developer CLI reference description: This article explains the syntax and parameters for the various Azure Developer CLI commands. author: alexwolfmsft ms.author: alexwolf ms.date: 02/29/2024 ms.service: azure-dev-cli ms.topic: conceptual ms.custom: devx-track-azdevcli --- # Azure Developer CLI reference This article explains the syntax and parameters for the various Azure Developer CLI commands. ## azd The Azure Developer CLI (`azd`) is an open-source tool that helps onboard and manage your application on Azure ### Options ```azdeveloper -C, --cwd string Sets the current working directory. --debug Enables debugging and diagnostics logging. --docs Opens the documentation for azd in your web browser. -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 auth](#azd-auth): Authenticate with Azure. * [azd config](#azd-config): Manage azd configurations (ex: default Azure subscription, location). * [azd deploy](#azd-deploy): Deploy the application's code to Azure. * [azd down](#azd-down): Delete Azure resources for an application. * [azd env](#azd-env): Manage environments. * [azd hooks](#azd-hooks): Develop, test and run hooks for an application. (Beta) * [azd init](#azd-init): Initialize a new application. * [azd monitor](#azd-monitor): Monitor a deployed application. (Beta) * [azd package](#azd-package): Packages the application's code to be deployed to Azure. (Beta) * [azd pipeline](#azd-pipeline): Manage and configure your deployment pipelines. (Beta) * [azd provision](#azd-provision): Provision the Azure resources for an application. * [azd restore](#azd-restore): Restores the application's dependencies. (Beta) * [azd show](#azd-show): Display information about your app and its resources. * [azd template](#azd-template): Find and view template details. (Beta) * [azd up](#azd-up): Provision Azure resources, and deploy your project with a single command. * [azd version](#azd-version): Print the version number of Azure Developer CLI. ## azd auth Authenticate with Azure. ### Options ```azdeveloper --docs Opens the documentation for azd auth in your web browser. -h, --help Gets help for auth. ``` ### Options inherited from parent commands ```azdeveloper -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 auth login](#azd-auth-login): Log in to Azure. * [azd auth logout](#azd-auth-logout): Log out of Azure. * [Back to top](#azd) ## azd auth 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, or --federated-credential-provider. ```azdeveloper azd auth login [flags] ``` ### Options ```azdeveloper --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. --docs Opens the documentation for azd auth login in your web browser. --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[=true] When true, log in by using a device code instead of a browser. ``` ### Options inherited from parent commands ```azdeveloper -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 auth](#azd-auth): Authenticate with Azure. * [Back to top](#azd) ## azd auth logout Log out of Azure. ### Synopsis Log out of Azure ```azdeveloper azd auth logout [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd auth logout in your web browser. -h, --help Gets help for logout. ``` ### Options inherited from parent commands ```azdeveloper -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 auth](#azd-auth): Authenticate with Azure. * [Back to top](#azd) ## 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`](#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`](#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 ```azdeveloper --docs Opens the documentation for azd config in your web browser. -h, --help Gets help for config. ``` ### Options inherited from parent commands ```azdeveloper -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](#azd-config-get): Gets a configuration. * [azd config list-alpha](#azd-config-list-alpha): Display the list of available features in alpha stage. * [azd config reset](#azd-config-reset): Resets configuration to default. * [azd config set](#azd-config-set): Sets a configuration. * [azd config show](#azd-config-show): Show all the configuration values. * [azd config unset](#azd-config-unset): Unsets a configuration. * [Back to top](#azd) ## 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. ```azdeveloper azd config get [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd config get in your web browser. -h, --help Gets help for get. ``` ### Options inherited from parent commands ```azdeveloper -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](#azd-config): Manage azd configurations (ex: default Azure subscription, location). * [Back to top](#azd) ## azd config list-alpha Display the list of available features in alpha stage. ```azdeveloper azd config list-alpha [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd config list-alpha in your web browser. -h, --help Gets help for list-alpha. ``` ### Options inherited from parent commands ```azdeveloper -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](#azd-config): Manage azd configurations (ex: default Azure subscription, location). * [Back to top](#azd) ## 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. ```azdeveloper azd config reset [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd config reset in your web browser. -f, --force Force reset without confirmation. -h, --help Gets help for reset. ``` ### Options inherited from parent commands ```azdeveloper -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](#azd-config): Manage azd configurations (ex: default Azure subscription, location). * [Back to top](#azd) ## 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. ```azdeveloper azd config set [flags] ``` ### Examples ```azdeveloper azd config set defaults.subscription azd config set defaults.location eastus ``` ### Options ```azdeveloper --docs Opens the documentation for azd config set in your web browser. -h, --help Gets help for set. ``` ### Options inherited from parent commands ```azdeveloper -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](#azd-config): Manage azd configurations (ex: default Azure subscription, location). * [Back to top](#azd) ## azd config show Show all the configuration values. ### Synopsis Show 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. ```azdeveloper azd config show [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd config show in your web browser. -h, --help Gets help for show. ``` ### Options inherited from parent commands ```azdeveloper -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](#azd-config): Manage azd configurations (ex: default Azure subscription, location). * [Back to top](#azd) ## 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. ```azdeveloper azd config unset [flags] ``` ### Examples ```azdeveloper azd config unset defaults.location ``` ### Options ```azdeveloper --docs Opens the documentation for azd config unset in your web browser. -h, --help Gets help for unset. ``` ### Options inherited from parent commands ```azdeveloper -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](#azd-config): Manage azd configurations (ex: default Azure subscription, location). * [Back to top](#azd) ## azd deploy Deploy the application's code to Azure. ```azdeveloper azd deploy [flags] ``` ### Options ```azdeveloper --all Deploys all services that are listed in azure.yaml --docs Opens the documentation for azd deploy in your web browser. -e, --environment string The name of the environment to use. --from-package string Deploys the application from an existing package. -h, --help Gets help for deploy. ``` ### Options inherited from parent commands ```azdeveloper -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) ## azd down Delete Azure resources for an application. ```azdeveloper azd down [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd down in your web browser. -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 ```azdeveloper -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) ## azd env Manage environments. ### Options ```azdeveloper --docs Opens the documentation for azd env in your web browser. -h, --help Gets help for env. ``` ### Options inherited from parent commands ```azdeveloper -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](#azd-env-get-values): Get all environment values. * [azd env list](#azd-env-list): List environments. * [azd env new](#azd-env-new): Create a new environment and set it as the default. * [azd env refresh](#azd-env-refresh): Refresh environment settings by using information from a previous infrastructure provision. * [azd env select](#azd-env-select): Set the default environment. * [azd env set](#azd-env-set): Manage your environment settings. * [Back to top](#azd) ## azd env get-values Get all environment values. ```azdeveloper azd env get-values [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd env get-values in your web browser. -e, --environment string The name of the environment to use. -h, --help Gets help for get-values. ``` ### Options inherited from parent commands ```azdeveloper -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](#azd-env): Manage environments. * [Back to top](#azd) ## azd env list List environments. ```azdeveloper azd env list [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd env list in your web browser. -h, --help Gets help for list. ``` ### Options inherited from parent commands ```azdeveloper -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](#azd-env): Manage environments. * [Back to top](#azd) ## azd env new Create a new environment and set it as the default. ```azdeveloper azd env new [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd env new in your web browser. -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 ```azdeveloper -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](#azd-env): Manage environments. * [Back to top](#azd) ## azd env refresh Refresh environment settings by using information from a previous infrastructure provision. ```azdeveloper azd env refresh [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd env refresh in your web browser. -e, --environment string The name of the environment to use. -h, --help Gets help for refresh. --hint string Hint to help identify the environment to refresh ``` ### Options inherited from parent commands ```azdeveloper -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](#azd-env): Manage environments. * [Back to top](#azd) ## azd env select Set the default environment. ```azdeveloper azd env select [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd env select in your web browser. -h, --help Gets help for select. ``` ### Options inherited from parent commands ```azdeveloper -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](#azd-env): Manage environments. * [Back to top](#azd) ## azd env set Manage your environment settings. ```azdeveloper azd env set [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd env set in your web browser. -e, --environment string The name of the environment to use. -h, --help Gets help for set. ``` ### Options inherited from parent commands ```azdeveloper -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](#azd-env): Manage environments. * [Back to top](#azd) ## azd hooks Develop, test and run hooks for an application. (Beta) ### Options ```azdeveloper --docs Opens the documentation for azd hooks in your web browser. -h, --help Gets help for hooks. ``` ### Options inherited from parent commands ```azdeveloper -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 hooks run](#azd-hooks-run): Runs the specified hook for the project and services * [Back to top](#azd) ## azd hooks run Runs the specified hook for the project and services ```azdeveloper azd hooks run [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd hooks run in your web browser. -e, --environment string The name of the environment to use. -h, --help Gets help for run. --platform string Forces hooks to run for the specified platform. --service string Only runs hooks for the specified service. ``` ### Options inherited from parent commands ```azdeveloper -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 hooks](#azd-hooks): Develop, test and run hooks for an application. (Beta) * [Back to top](#azd) ## azd init Initialize a new application. ```azdeveloper azd init [flags] ``` ### Options ```azdeveloper -b, --branch string The template branch to initialize from. Must be used with a template argument (--template or -t). --docs Opens the documentation for azd init in your web browser. -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 -s, --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, /, or if it's part of the azure-samples organization. ``` ### Options inherited from parent commands ```azdeveloper -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) ## azd monitor Monitor a deployed application. (Beta) ```azdeveloper azd monitor [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd monitor in your web browser. -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 ```azdeveloper -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) ## azd package Packages the application's code to be deployed to Azure. (Beta) ```azdeveloper azd package [flags] ``` ### Options ```azdeveloper --all Packages all services that are listed in azure.yaml --docs Opens the documentation for azd package in your web browser. -e, --environment string The name of the environment to use. -h, --help Gets help for package. --output-path string File or folder path where the generated packages will be saved. ``` ### Options inherited from parent commands ```azdeveloper -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) ## azd pipeline Manage and configure your deployment pipelines. (Beta) ### Options ```azdeveloper --docs Opens the documentation for azd pipeline in your web browser. -h, --help Gets help for pipeline. ``` ### Options inherited from parent commands ```azdeveloper -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](#azd-pipeline-config): Configure your deployment pipeline to connect securely to Azure. (Beta) * [Back to top](#azd) ## azd pipeline config Configure your deployment pipeline to connect securely to Azure. (Beta) ```azdeveloper azd pipeline config [flags] ``` ### Options ```azdeveloper --auth-type string The authentication type used between the pipeline provider and Azure for deployment (Only valid for GitHub provider). Valid values: federated, client-credentials. --docs Opens the documentation for azd pipeline config in your web browser. -e, --environment string The name of the environment to use. -h, --help Gets help for config. --principal-id string The client id of the service principal to use to grant access to Azure resources as part of the pipeline. --principal-name string The name of the service principal to use to grant access to Azure resources as part of the pipeline. --principal-role stringArray The roles to assign to the service principal. By default the service principal will be granted the Contributor and User Access Administrator roles. (default [Contributor,User Access Administrator]) --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 ```azdeveloper -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](#azd-pipeline): Manage and configure your deployment pipelines. (Beta) * [Back to top](#azd) ## azd provision Provision the Azure resources for an application. ```azdeveloper azd provision [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd provision in your web browser. -e, --environment string The name of the environment to use. -h, --help Gets help for provision. --no-state Do not use latest Deployment State (bicep only). --preview Preview changes to Azure resources. ``` ### Options inherited from parent commands ```azdeveloper -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) ## azd restore Restores the application's dependencies. (Beta) ```azdeveloper azd restore [flags] ``` ### Options ```azdeveloper --all Restores all services that are listed in azure.yaml --docs Opens the documentation for azd restore in your web browser. -e, --environment string The name of the environment to use. -h, --help Gets help for restore. ``` ### Options inherited from parent commands ```azdeveloper -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) ## azd show Display information about your app and its resources. ```azdeveloper azd show [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd show in your web browser. -e, --environment string The name of the environment to use. -h, --help Gets help for show. ``` ### Options inherited from parent commands ```azdeveloper -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) ## azd template Find and view template details. (Beta) ### Options ```azdeveloper --docs Opens the documentation for azd template in your web browser. -h, --help Gets help for template. ``` ### Options inherited from parent commands ```azdeveloper -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](#azd-template-list): Show list of sample azd templates. (Beta) * [azd template show](#azd-template-show): Show details for a given template. (Beta) * [azd template source](#azd-template-source): View and manage template sources. (Beta) * [Back to top](#azd) ## azd template list Show list of sample azd templates. (Beta) ```azdeveloper azd template list [flags] ``` ### Options ```azdeveloper --docs Opens the documentation for azd template list in your web browser. -h, --help Gets help for list. -s, --source string Filters templates by source. ``` ### Options inherited from parent commands ```azdeveloper -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](#azd-template): Find and view template details. (Beta) * [Back to top](#azd) ## azd template show Show details for a given template. (Beta) ```azdeveloper azd template show