logo
search
Others

Fix .NET Aspire Azure Container Apps Missing Bicep File Deployment Error

Natalie TaylorNatalie Taylor Oct 1, 2026 868 views

Question details

The user needs to resolve an Azure pipeline deployment failure where a .NET Aspire application cannot provision due to a missing main.bicep file.

How to Fix .NET Aspire Azure Container Apps Deployment Missing Bicep File
Product
.NET Aspire and Azure Container Apps
Device & OS
not provided
Scenario
Deploying a .NET Aspire application with custom domain configurations via Azure Pipelines.
Observed behavior
The pipeline fails during the provisioning stage with an error stating that Bicep cannot find the /home/vsts/work/1/s/infra/main.bicep file.
Before you start

Ensure you have access to your Azure DevOps pipeline deployment logs and your source code repository to verify file paths and deployment configurations.

Solution 1Recommended

Verify Repository Structure and Pipeline Configuration

Ensure the required main.bicep file is actually committed to the repository and the pipeline working directory is correctly mapped.

Azure pipelines often fail to find Bicep files if the infrastructure folder is missing from the branch triggering the deployment, or if the pipeline's working directory context is slightly off.

1
Check Source Control

Navigate to your Git repository in Azure DevOps or GitHub and verify that the infra/main.bicep file is committed and pushed to the deployment branch.

2
Verify Pipeline Working Directory

Open your pipeline YAML configuration file and check the workingDirectory parameter for the Bicep deployment task to ensure it correctly points to $(System.DefaultWorkingDirectory)/infra or the appropriate relative path.

3
Review Pipeline Checkout Logs

Download the raw pipeline deployment logs and inspect the source checkout step to confirm that the infra folder is being successfully downloaded into /home/vsts/work/1/s/.

Verify Repository Structure and Pipeline Configuration
Custom Domain Configurations: If you are deploying custom domains alongside the container apps, ensure any referenced parameter files, certificates, or environment variables are also present in the expected Azure pipeline paths.
Free Microsoft Office alternative

Need a Lightweight Office Suite for Your Developer Documentation?

While troubleshooting Azure DevOps and .NET Aspire deployments requires specialized Microsoft tools, managing your project documentation shouldn't be a hassle. WPS Office is a highly compatible, free alternative to Microsoft Office, perfect for writing technical specifications, analyzing exported CSV deployment logs, and collaborating on DevOps architectures.

  1. 1. Download the Software: Visit the official WPS Office website and download the free installer for Windows, Mac, or Linux.
  2. 2. Manage Technical Specs: Use WPS Writer to draft and edit your Azure architecture documentation with full Microsoft Word compatibility.
  3. 3. Analyze Pipeline Logs: Open exported Azure pipeline CSV logs in WPS Spreadsheet to filter and diagnose deployment errors efficiently.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx) for seamless documentation migration.Lightweight and fast, consuming minimal system resources while you compile code or run local .NET environments.Ideal for writing structured DevOps technical requirements and analyzing pipeline data locally.Free to use with a familiar, easy-to-navigate tabbed interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the Azure pipeline say main.bicep cannot be found?

This usually happens if the file was not committed to the source repository, the pipeline checkout step is configured incorrectly, or the working directory path in the deployment YAML task does not accurately match the cloned repository structure.

Where should the infra/main.bicep file be located in a .NET Aspire project?

In a typical .NET Aspire project, the Bicep files generated for Azure deployment are located in the infrastructure or .azure directories, depending on how azd (Azure Developer CLI) or your custom deployment scripts are configured.

How do I verify the working directory structure in Azure DevOps pipelines?

You can verify the pipeline's working directory by adding a temporary Bash or PowerShell script task with the command 'ls -la $(System.DefaultWorkingDirectory)' or 'tree' before your deployment task to output the actual file structure into the pipeline logs.