Skip to content

Multiple AI Foundry resources, Read-Host not working (on MacOS) #6

@Jandev

Description

@Jandev

I'm trying to run azd up and made the change I described in #5

Running this shows me the following output:

Discovering Azure AI Foundry resources...
Searching for AI Foundry resources (kind=AIServices) in subscription...
Found 6 AI Foundry resources:

  [1] ai1
      Resource Group: rg1
      Location: westeurope
  [2] ai2
      Resource Group: rg2
      Location: westeurope
  [3] ai3
      Resource Group: rg3
      Location: swedencentral
  [4] ai4
      Resource Group: rg3
      Location: swedencentral
  [5] ai5
      Resource Group: rg3
      Location: swedencentral
  [6] ai6
      Resource Group: rg4
      Location: swedencentral

Please select which resource to use (1-6): : 
, stderr: Write-Error: Invalid selection. Please run 'azd up' again and select a number between 1 and 6

In the code I see $selection = Read-Host " " is being #invoked.
However, the script finishes with an error. Based on what I'm reading it's caused by running the script in a non-interactive terminal, as it's invoked by azd up.

Not sure how to solve, so I've hardcoded my selection in the script for now.

Setting environment variables will probably work too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions