Skip to content
Draft
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
13 changes: 5 additions & 8 deletions cli/azd/docs/design/azd-update.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Design: `azd update`, Auto-Update & Channel Management

**Epic**: [#6721](https://github.com/Azure/azure-dev/issues/6721)
**Status**: Draft
**Status**: Beta

---

Expand All @@ -13,7 +13,7 @@ Today, when a new version of `azd` is available, users see a warning message wit
2. **Auto-update** — opt-in background updates applied at next startup
3. **Channel management** — ability to switch between `stable` and `daily` builds

The feature ships as a hidden command behind an alpha feature toggle (`alpha.update`) for safe rollout. When the toggle is off, there are zero changes to existing behavior — `azd version`, update notifications, everything stays exactly as it is today.
The feature previously shipped as an alpha command behind the `alpha.update` feature toggle. As of `1.24.0`, `azd update` is promoted to **Beta** and is available by default — no feature toggle required.

---

Expand Down Expand Up @@ -361,14 +361,11 @@ Uses the existing azd telemetry infrastructure (OpenTelemetry). New telemetry fi

These codes are integrated into azd's `MapError` pipeline, so update failures show up properly in telemetry dashboards alongside other command errors.

### 8. Feature Toggle (Alpha Gate)
### 8. Feature Stage (Beta)

The entire update feature ships behind `alpha.update` (default: off). This means:
`azd update` is promoted to **Beta** as of `1.24.0` and is available by default without any feature flag. Users will see a one-time Beta notice on first use, and a default update channel (`stable`) is persisted to config so the notice is only shown once.

- **Toggle off** (default): Zero behavior changes. `azd version` output is the same. Update notification shows the existing platform-specific install instructions. `azd update` returns an error telling the user to enable the feature.
- **Toggle on** (`azd config set alpha.update on`): All update features are active — `azd update` works, auto-update stages/applies, `azd version` shows the channel suffix, notifications say "run `azd update`."

This lets us roll out to internal users first, gather feedback, and fix issues before broader availability. Once stable, the toggle can be removed and the feature enabled by default.
Previously, the feature shipped behind the `alpha.update` flag. All references to that flag have been removed.

### 9. Update Banner Suppression

Expand Down
1 change: 1 addition & 0 deletions cli/azd/docs/feature-stages.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ As of `1.21.1`, each Azure Developer CLI feature has been evaluated and assigned
| Command | package | Beta |
| Command | add | Beta |
| Command | infra generate | Beta |
| Command | update | Beta |
| Language | Python | Stable |
| Language | JavaScript/TypeScript | Stable |
| Language | Java | Stable |
Expand Down
79 changes: 79 additions & 0 deletions cli/azd/docs/layer-hooks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Hooks for Provisioning Layers

The Azure Developer CLI supports running lifecycle hooks at the individual provisioning layer level when using [Layered Provisioning](../docs/feature-stages.md).

## Overview

In addition to project-level and service-level hooks, you can define `preprovision` and `postprovision` hooks directly on each entry in `infra.layers[]` inside `azure.yaml`. These layer hooks run in the context of the layer's own directory, making it easy to run layer-specific scripts without sharing infrastructure.

## Configuring Layer Hooks

Add a `hooks` block to any layer under `infra.layers` in your `azure.yaml`:

```yaml
infra:
layers:
- name: shared
path: infra/shared
hooks:
preprovision:
shell: sh
run: ./scripts/prepare-shared.sh
postprovision:
shell: sh
run: ./scripts/notify-shared-done.sh

- name: app
path: infra/app
hooks:
preprovision:
shell: sh
run: ./scripts/prepare-app.sh
```

### Supported hook events

| Hook name | When it runs |
| --------------- | -------------------------------------- |
| `preprovision` | Before the layer's resources are deployed |
| `postprovision` | After the layer's resources are deployed |

### Hook paths

All paths specified in layer hooks are resolved **relative to the layer's `path`** directory (not the project root).

## Running Layer Hooks Manually

Use `azd hooks run` with the new `--layer` flag to run hooks for a specific provisioning layer:

```bash
# Run the 'preprovision' hook for the 'shared' layer only
azd hooks run preprovision --layer shared

# Run the 'postprovision' hook for the 'app' layer only
azd hooks run postprovision --layer app
```

> **Note**: `--layer` and `--service` are mutually exclusive. You cannot specify both in the same command.

## Multi-hook format

Each hook event accepts either a single hook object or an array of hook objects:

```yaml
infra:
layers:
- name: shared
path: infra/shared
hooks:
preprovision:
- shell: sh
run: ./scripts/step1.sh
- shell: sh
run: ./scripts/step2.sh
```

## Related

- [Layered Provisioning](../docs/feature-stages.md)
- [Hooks (project and service level)](https://learn.microsoft.com/azure/developer/azure-developer-cli/azd-schema#hooks)