Forum Discussion
RobTedTech
Mar 25, 2024Copper Contributor
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.DefaultWo...
Mar 27, 2024
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
RobTedTech
Apr 03, 2024Copper 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 /app
COPY . ../
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