Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] AZDO failure: Invalid use of relative path during infrastructure creation step of CI/CD pipeline #4189

Open
1 task done
WhitWaldo opened this issue Aug 8, 2024 · 2 comments
Assignees
Milestone

Comments

@WhitWaldo
Copy link

WhitWaldo commented Aug 8, 2024

Output from azd version
Run azd version and copy and paste the output here:
azd version 1.9.5 (commit cd2b7af)

Describe the bug
I've performed the following steps from the root solution directory:

  1. Run azd init
  2. Run azd pipeline config --provider azdo

Each of these worked fine. I modified the created pipelines file created at .azdo/pipelines/azure-dev.yml to use my own build server pool, but otherwise left the file untouched.

In the step titled "Provision Infrastructure", the script fails with the following relevant logging:

Provisioning Azure resources (azd provision)
Provisioning Azure resources can take some time.

ERROR: initializing service 'app', stat /home/xyz/devops-agent/_work/170/s/.\MyApp.AppHost\MyApp.AppHost.csproj: no such file or directory

The directory and file are present if I load up the build server and look at "/home/xyz/devops-agent/_work/170/s/MyApp.AppHost/MyApp.AppHost.csproj", but the problem appears to be that Azure DevOps expects an absolute path and will not automatically concatenate a relative path to it.

To Reproduce

  1. Create new project called "MyApp"
  2. With a terminal, 'cd' into the root solution directory
  3. Provision a PAT in AZDO with the necessary permissions
  4. In the terminal, run azd init and accept the default options and fill in the fields as you will
  5. Run azd pipeline config --provider azdo, accept the default options, provide your PAT and before the last step, change the pool to your private pool (so you can confirm the directory exists later - not otherwise necessary)
  6. Commit and push the changes. Observe that the operation fails in the Azure provisioning step because of the invalid path.

Expected behavior
I expected that the various Azure resources would be properly spun up because the path wouldn't start with a "." prefix and would instead properly concatenate to the source directory so the csproj file can be located.

Environment
Information on your environment:
* C# 12
* IDE and version : Visual Studio 17.10.5

Additional context
My build server is also running Ubuntu Linux as the introduced pipeline expects. The issue here simply seems to be that the value pointing to the apphost csproj expects to be able to drop in a relative path and doesn't expect the path to be concatenated to the current directory by azdo.

Further, azd provision works fine when running locally, so perhaps this is an issue with how AZDO itself handles pathing.

@rajeshkamal5050
Copy link
Contributor

@vhvb1989 can you triage this?

@rajeshkamal5050 rajeshkamal5050 added the needs-triage For new issues label Aug 13, 2024
@vhvb1989
Copy link
Member

same root cause as: #3891

@WhitWaldo . As a workaround, you can manually change the \ for / for the path of the AppHost in azure.yaml and push.

Also, make sure you are installing .NET Aspire workload in your pipeline definition and you are using: AZD_INITIAL_ENVIRONMENT_CONFIG:$(AZD_INITIAL_ENVIRONMENT_CONFIG) in your provision step environment (see more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants