Forum Discussion
AzureContainerApps@1 Multiple Projects
Hi All
I have a .Net Solution with multiple Projects. I am trying to use AzureContainerApps@1 to deploy via a Pipeline but I am struggling with the appSourcePath. If I leave as $(System.DefaultWorkingDirectory) I get an Ambiguous project error, if I specify the path to the project the build fails as cannot find the project references:
warning : The referenced project '../../../0.Build/xxxx/xxxx.csproj' does not exist. The code exist in a Github repo and all local builds etc work perfectly. Has anyone had similar issue and solved?
Thanks,
Rob
- RobTedTech I got these errors before but in Azure DevOps Pipelines not GitHub and not with ACA. I am guessing that your error might be cause by the ongoing issue I found, Please check it out and see if it helps https://github.com/microsoft/azure-pipelines-tasks/issues/19664 it might be the same cause for GitHub
- RobTedTechCopper Contributor
Thanks very much for the info. I managed to solve my issue by using a docker file. I have a a 'src' folder with the various projects, I created a 'dockerfiles' folder (both in the solution root directory) and used the following dockerfile:
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /appCOPY . ../
RUN dotnet restore ../src/PROJECT_NAME/*.csproj
RUN dotnet publish ../src/PROJECT_NAME/*.csproj -c Release -o out# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "PROJECT_NAME.dll"]Each Project will need a separate dockerfile in the folder but it builds perfectly with all dependencies.
Hope this helps somewhat.
Cheers,
Rob