Azure / azure-dev

A developer CLI that reduces the time it takes for you to get started on Azure. The Azure Developer CLI (azd) provides a set of developer-friendly commands that map to key stages in your workflow - code, build, deploy, monitor, repeat.
https://aka.ms/azd
MIT License
369 stars 166 forks source link

[Issue] azd doesn't seem to like certain characters in the path to bicep.exe #3810

Open mip1983 opened 2 weeks ago

mip1983 commented 2 weeks ago

Output from azd version azd version 1.8.1 (commit 88369c36ce2a0d60794389aad9b10de938f587e1)

Describe the bug 'azd up' fails and throws an error, seems to object to an opening bracket in the path to bicep.exe

This is the output I get:

azd up --debug
2024/04/29 13:25:09 main.go:59: azd version: 1.8.1 (commit 88369c36ce2a0d60794389aad9b10de938f587e1)
2024/04/29 13:25:09 main.go:229: using cached latest version: 1.8.1 (expires on: 2024-04-30T11:15:17Z)
2024/04/29 13:25:09 project.go:120: Reading project from file 'D:\source\ecoDriverAdmin_UI\azure.yaml'
2024/04/29 13:25:09 project.go:120: Reading project from file 'D:\source\ecoDriverAdmin_UI\azure.yaml'
2024/04/29 13:25:10 middleware.go:106: running middleware 'debug'
2024/04/29 13:25:10 middleware.go:106: running middleware 'experimentation'
2024/04/29 13:25:10 experimentation.go:42: assignment context: 0g5ad841:76970;
2024/04/29 13:25:10 middleware.go:106: running middleware 'telemetry'
2024/04/29 13:25:10 telemetry.go:38: TraceID: 1510f4431422cfb165e7c07b8129e06c
2024/04/29 13:25:10 middleware.go:106: running middleware 'hooks'
2024/04/29 13:25:10 command_runner.go:307: Run exec: 'dotnet msbuild D:\source\ecoDriverAdmin_UI\ecoDriverAdmin.AppHost\ecoDriverAdmin.AppHost.csproj --getProperty:IsAspireHost' , exit code: 0
Additional env:
   DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE=<redacted>
-------------------------------------stdout-------------------------------------------
true
  |==     | Analyzing Aspire Application (this might take a moment...)2024/04/29 13:25:14 command_runner.go:307: Run exec: 'dotnet run --project ecoDriverAdmin.AppHost.csproj --publisher manifest --output-path C:\Users\MATTHE~1\AppData\Local\Temp\azd-provision431053839\apphost-manifest.json' , exit code: 0
-------------------------------------stdout-------------------------------------------
Building...
info: Aspire.Hosting.DistributedApplication[0]
      Aspire version: 8.0.0-preview.6.24214.1+6596fdc41a8d419876a6bf4abc17b7c66b9ef63a
info: Aspire.Hosting.Publishing.ManifestPublisher[0]
      Published manifest to: C:\Users\MatthewPaul(ecoDrive\AppData\Local\Temp\azd-provision431053839\apphost-manifest.json
2024/04/29 13:25:14 hooks.go:143: service 'ecodriveradmin' does not require any command hooks.
2024/04/29 13:25:14 hooks.go:78: azd project is not available or does not contain any command hooks, skipping command hook registrations.
2024/04/29 13:25:14 command_runner.go:307: Run exec: 'C:\Users\MatthewPaul(ecoDrive\.azd\bin\bicep.exe --version' , exit code: 1
-------------------------------------stderr-------------------------------------------
'C:\Users\MatthewPaul' is not recognized as an internal or external command,
operable program or batch file.

ERROR: initializing infrastructure provider: failed resolving IaC provider 'bicep': checking bicep version: exit code: 1, stdout: , stderr: 'C:\Users\MatthewPaul' is not recognized as an internal or external command,
operable program or batch file.

To Reproduce Steps to reproduce the behavior...

Run 'azd up' on an account where the username contains a '('

Expected behavior

I expect it to work with allowed windows paths

Environment Information on your environment:

mip1983 commented 2 weeks ago

My work around for the moment, add a virtual folder i.e.

mklink /d C:\Bicep "C:\Users\.azure\bin"

Then add the following environment variable:

Name: AZD_BICEP_TOOL_PATH Value: C:\Bicep\bicep.exe