From 5e391cb3d27faf681e60fdc6acdb9311cb7ce681 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 2 Apr 2026 19:58:40 +0000 Subject: [PATCH] docs: update documentation for features merged 2026-04-02 - Add AZD_NON_INTERACTIVE environment variable to environment-variables.md (--non-interactive flag alias and env var, PR #7392) - Add azd auth token usage section to external-authentication.md (raw token output by default, --output json for structured output, PR #7384) - Add Docker build network option to proxy-configuration.md (docker.network field in azure.yaml for builds behind corporate proxies, PR #7361) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- cli/azd/docs/environment-variables.md | 1 + cli/azd/docs/external-authentication.md | 28 +++++++++++++++++++++++++ cli/azd/docs/proxy-configuration.md | 13 ++++++++++++ 3 files changed, 42 insertions(+) diff --git a/cli/azd/docs/environment-variables.md b/cli/azd/docs/environment-variables.md index e96152a41be..2098aaaf9e2 100644 --- a/cli/azd/docs/environment-variables.md +++ b/cli/azd/docs/environment-variables.md @@ -12,6 +12,7 @@ Environment variables that can be used to configure `azd` behavior, usually set - `AZD_DEMO_MODE`: If true, enables demo mode. This hides personal output, such as subscription IDs, from being displayed in output. - `AZD_FORCE_TTY`: If true, forces `azd` to write terminal-style output. - `AZD_IN_CLOUDSHELL`: If true, `azd` runs with Azure Cloud Shell specific behavior. +- `AZD_NON_INTERACTIVE`: If set to a truthy value (`true`, `1`, `TRUE`, etc.), enables non-interactive (no-prompt) mode. This is equivalent to passing the `--no-prompt` or `--non-interactive` flag. Setting this variable (even to `false`) suppresses agent auto-detection, giving you explicit control over the mode. Priority order: explicit `--no-prompt`/`--non-interactive` flag (highest) > `AZD_NON_INTERACTIVE` env var > agent auto-detection (lowest). - `AZD_SKIP_UPDATE_CHECK`: If true, skips the out-of-date update check output that is typically printed at the end of the command. For tools that are auto-acquired by `azd`, you are able to configure the following environment variables to use a different version of the tool installed on the machine: diff --git a/cli/azd/docs/external-authentication.md b/cli/azd/docs/external-authentication.md index 2d20c63e384..534d136ee2a 100644 --- a/cli/azd/docs/external-authentication.md +++ b/cli/azd/docs/external-authentication.md @@ -1,5 +1,33 @@ # External Authentication +## Getting a Token via `azd auth token` + +The `azd auth token` command can be used to print an access token for the currently signed-in account. This is useful for scripts and tools that need to authenticate against Azure APIs. + +```bash +# Print the raw access token (default) +azd auth token + +# Print structured JSON with token and expiration time +azd auth token --output json +``` + +The default output is the raw token string, making it easy to capture in scripts: + +```bash +TOKEN=$(azd auth token) +curl -H "Authorization: Bearer $TOKEN" https://management.azure.com/subscriptions?api-version=2022-12-01 +``` + +Use `--output json` when you also need the token's expiration time: + +```json +{ + "token": "", + "expiresOn": "2024-01-01T00:00:00Z" +} +``` + ## Problem As part of its operation, `azd` needs to make calls to different Azure services. For example `azd provision` calls the ARM control plane to submit a deployment. `azd deploy` may need to make management or data plane calls to deploy the customer code that it has built. diff --git a/cli/azd/docs/proxy-configuration.md b/cli/azd/docs/proxy-configuration.md index 76c0bafc0ec..a9275c84676 100644 --- a/cli/azd/docs/proxy-configuration.md +++ b/cli/azd/docs/proxy-configuration.md @@ -30,3 +30,16 @@ export HTTPS_PROXY= Per Go `net/http` package docs > DefaultTransport is the default implementation of Transport and is used by DefaultClient. It establishes network connections as needed and caches them for reuse by subsequent calls. It uses HTTP proxies as directed by the environment variables HTTP_PROXY, HTTPS_PROXY and NO_PROXY (or the lowercase versions thereof). + +## Docker Build Network + +If your Docker builds require access to a network proxy or need host networking (for example, to resolve dependencies through a corporate proxy during `docker build`), you can configure the Docker network mode for a service in `azure.yaml`: + +```yaml +services: + web: + docker: + network: host +``` + +The `network` field maps to the `--network` flag of `docker build`. Common values are `host` (use the host's network stack) or `bridge` (default Docker bridge network). This is particularly useful when building containers in environments where internet access is only available through the host network.