Azure / Azure/azure-dev

[EPIC] New feature: azd validate

Open
#6,866 3 comments 0 reactions 1 assignee Claimed by @vhvb1989 View on GitHub
area/error-handling area/provisioning developer-experience epic
Dominant language
Go
Stars
569
Forks
364
Avg merge
2d 19h
Merged PRs (30d)
136

Description

## Description

Introduce a validation that performs app-level checks against the user's Azure subscription, identity, and environment configuration before provisioning. The goal is to surface common blockers — like missing role assignments, expired credentials, or unregistered resource providers — upfront, before users invest time waiting on a provision that will fail.

## Motivation

Today, many provisioning failures are caused by conditions that are detectable before `azd provision` runs — things like insufficient permissions on the target subscription, authentication issues, or missing environment configuration. Users currently discover these problems mid-provision through error messages that don't always make the fix obvious, leading to repeated attempts or abandonment.

By validating the user's environment ahead of time and providing clear, actionable guidance, we can help more users succeed on their first attempt.

## Proposed behavior

`azd validate` checks the user's current environment against what the target template requires and reports any issues with suggested fixes. Initial focus areas:

- **Role assignments** — Does the signed-in identity have the roles required by the template's target resource types? (e.g., Contributor on the subscription, resource-specific roles for Key Vault, Cognitive Services, etc.)
- **Authentication state** — Is the current credential valid? Is the right tenant/subscription selected?
- **Environment configuration** — Are required environment variables set? Is the selected region supported for the required resource providers?

## Iterative approach

We plan to build this incrementally. Each iteration will target the most common provisioning error patterns, validate whether the checks meaningfully improve outcomes, and expand from there. Community feedback on which provisioning errors are most painful will directly inform what checks get added next.

## How you can help

If you've hit provisioning failures that felt like they could have been caught earlier, we'd love to hear about them. Specifically:

- What error did you see?
- What was the root cause?
- How did you figure out the fix?

This feedback will help us prioritize which validation checks to build first.

## Related

- Provisioning error handling improvements
- First-run developer experience

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.