Skip to content

[Issue] "azd ai agent init" fails on second attempt #7286

@pamelafox

Description

@pamelafox
  • Make sure you've installed the latest version using instructions

Output from azd version
Run azd version and copy and paste the output here:
azd version 1.23.11 (commit 8a12ac2) (stable)

Describe the bug

I ran "azd ai agent init", and I had failure the first time, so I had to run again, and it error'ed. It also didn't remember any of my selections from the first time, which is non-ideal in my opinion.

Terminal:

  Logged in to Azure as pamelafox@microsoft.com
seattle-hotel-agent % azd ai agent init

v0.1.18-preview 
Visit the docs at https://aka.ms/azd-ai-agent-docs

? How do you want to initialize your agent?: Use the code in the current directory
? Enter a name for your agent: seattle-hotel-agent
? Set new environment 'seattle-hotel-agent-dev' as default environment? Yes

New environment 'seattle-hotel-agent-dev' created and set as default
  +  .azure/seattle-hotel-agent-dev/.env
? How would you like to configure a model for your agent?: Deploy a new model from the catalog
Select an Azure subscription to look up available models and provision your Foundry project resources.
? Select subscription: python (8077d4f9-d1b7-4c80-b6c2-cf9a2ec2d604)
Select an Azure location. This determines which models are available and where your Foundry project resources will be deployed.

ERROR: failed to prompt for location: failed getting next page of locations: AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '797f4846-ba00-4fd7-ba43-dac1f8f63013'. Trace ID: ee94c823-0e84-4825-bb8a-59c3e3b70800 Correlation ID: 9bdb1e95-2937-4a72-b280-8afadd2485b8 Timestamp: 2026-03-24 15:59:36Z
reauthentication required, run `azd auth login` to acquire a new token.

Suggestion: run `azd auth login` to authenticate

seattle-hotel-agent % azd auth login --tenant-id "d91aa5af-8c1e-442c-b77c-0b92988b387b"
  Logged in to Azure as pamelafox@microsoft.com
seattle-hotel-agent % azd ai agent init                                                

v0.1.18-preview 
Visit the docs at https://aka.ms/azd-ai-agent-docs

? How do you want to initialize your agent?: Use the code in the current directory
? Enter a name for your agent: seattle-hotel-agent

ERROR: failed to create new azd environment: rpc error: code = Internal desc = failed to run workflow: error executing step command 'env new seattle-hotel-agent-dev': creating new environment: environment 'seattle-hotel-agent-dev' already exists

Suggestion: run 'azd env new' manually to create an environment

Metadata

Metadata

Labels

ext-agentsazure.ai.agents extension

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions