microsoft / microsoft/GitHub-Copilot-for-Azure

azure-prepare skill sets incorrect project path in azure.yaml for multi-stage Dockerfiles

Open
#878 0 comments 0 reactions 0 assignees View on GitHub
skills untriaged
Dominant language
Python
Stars
250
Forks
204
Avg merge
1d 12h
Merged PRs (30d)
67

Description

## Problem

When preparing an application for Azure deployment using the `azure-prepare` skill, the generated `azure.yaml` set `project: ./app` (pointing to the Python service subdirectory) even though the Dockerfile is a multi-stage build at the project root that copies from multiple subdirectories (`./app/` and `./frontend/`).

This caused `azd up` to fail on the first attempt with:

```
ERROR: failed to read dockerfile: open Dockerfile: no such file or directory
```

The `project` field in `azure.yaml` controls the Docker build context, so it needed to be `.` (the project root) rather than `./app`.

## Steps to Reproduce

1. Clone the [aspire-with-python](https://github.com/dotnet/aspire-samples/tree/main/samples/aspire-with-python) sample from `dotnet/aspire-samples`
2. Use the `azure-prepare` skill to prepare the app for Azure deployment
3. Run `azd up`
4. Build fails because the Dockerfile is not found in the `./app/` build context

## Expected Behavior

The skill should detect that the Dockerfile is at the project root and references multiple subdirectories, and set `project: .` in `azure.yaml` accordingly.

## Actual Behavior

The skill generated `project: ./app` because the Python source code lives there, without considering that the Dockerfile's build context needs access to both `./app/` and `./frontend/`.

## Fix Applied

Changed `project: ./app` to `project: .` in `azure.yaml`. After this fix, `azd up` succeeded.

## Notes

- Sample used: `aspire-with-python` from [dotnet/aspire-samples](https://github.com/dotnet/aspire-samples)
- The Dockerfile is a multi-stage build (Node.js frontend build + Python backend) that copies from both `./app/` and `./frontend/` directories
- The skill guidance in `azure-yaml.md` and `docker.md` should emphasize verifying that the `project` path matches the Dockerfile's expected build context, especially for multi-stage builds

Contributor guide

Open the contributing guide

Research direction

Read the azure-prepare skill guidance in azure-yaml.md and docker.md, then compare it with the aspire-with-python sample's root multi-stage Dockerfile. Run azd up using the generated azure.yaml and verify that the project path provides both app and frontend to the Docker build; done means the deployment succeeds with project: ..

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, docker, python
Domain
cloud, devops, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.