After updating the Blazor app from .net5 to .net6 the pipeline no longer builds. I had to update because .net5 was no longer supported.
These are the variables for the pipeline, the deployment token is set up in Azure and Gitlab.
variables:
API_TOKEN: $DEPLOYMENT_TOKEN
APP_PATH: '$CI_PROJECT_DIR/App.WebApp'
OUTPUT_PATH: '/bin/staticsites/ss-oryx/app/wwwroot'
It looks like the Destination Directory has changed and now includes the deployment id. I’m not sure why it changed like this and don’t know how to fix it.
[32;1mSkipping Git submodules setup[0;m
section_end:1682626648:get_sources
[0Ksection_start:1682626648:step_script
[0K[0K[36;1mExecuting "step_script" stage of the job script[0;m[0;m
[0KUsing docker image sha256:50ce98efe7fa10fb56a726a6101cbc55c606f0940175fabc8474e0420bab62d6 for registry.gitlab.com/static-web-apps/azure-static-web-apps-deploy with digest registry.gitlab.com/static-web-apps/azure-static-web-apps-deploy@sha256:0eaf1aadc1d2067801287ed82241f053991c634299c03c9a7c6242d2418f0a26 ...[0;m
DeploymentId: a01ad955-5c79-40d0-a69d-40c19d278b3b
[37mApp Directory Location: '/builds/col/app/App.WebApp' was found.[0m
[37mLooking for event info[0m
[37mCould not get event info. Proceeding[0m
[37mStarting to build app with Oryx[0m
[33mAzure Static Web Apps utilizes Oryx to build both static applications and Azure Functions.
[37m---Oryx build logs---[0m
[37m[0m
[37m[0m
[37mOperation performed by Microsoft Oryx, [0m
[37mYou can report issues at [0m
[37m[0m
[37mOryx Version: 0.2.20221103.1, Commit: a2c65dde152b749fea395f4d1242ea9350942258, ReleaseTagName: 20221103.1[0m
[37m[0m
[37mBuild Operation ID: |SbsuUFHP0+o=.480389ce_[0m
[37mRepository Commit : a36842527773267cb1607a214e85c1ebb2c1b3f5[0m
[37m[0m
[37mDetecting platforms...[0m
[37mDetected following platforms:[0m
[37m dotnet: 6.0.16[0m
[37mVersion '6.0.16' of platform 'dotnet' is not installed. Generating script to install it...[0m
[37mDetected the following frameworks: blazor[0m
[37m[0m
[37m[0m
[37mSource directory : /builds/col/app/App.WebApp[0m
[37mDestination directory: /bin/staticsites/a01ad955-5c79-40d0-a69d-40c19d278b3b-swa-oryx/app[0m
[37m[0m
[37m[0m
[37mDownloading and extracting 'dotnet' version '6.0.408' to '/opt/dotnet/6.0.408'...[0m
[37mDetected image debian flavor: bullseye.[0m
[37mDownloaded in 1 sec(s).[0m
[37mVerifying checksum...[0m
[37mExtracting contents...[0m
[37mperforming sha512 checksum for: dotnet...[0m
[37mDone in 10 sec(s).[0m
[37m[0m
[37mimage detector file exists, platform is dotnet..[0m
[37m[0m
[37mUsing .NET Core SDK Version: 6.0.408[0m
[37m[0m
[37mRunning 'dotnet workload install wasm-tools'...[0m
[37m[0m
[37m[0m
[37mWelcome to .NET 6.0![0m
[37m---------------------[0m
[37mSDK Version: 6.0.408[0m
[37mInstalling pack Microsoft.NETCore.App.Runtime.Mono.browser-wasm version 6.0.16...[0m
[37mWriting workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.net6.browser-wasm version 6.0.16...[0m
[37mInstalling pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.browser-wasm version 6.0.16...[0m
[37mWriting workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.net6.browser-wasm version 6.0.16...[0m
[37mInstalling pack Microsoft.NET.Runtime.MonoAOTCompiler.Task version 6.0.16...[0m
[37mWriting workload pack installation record for Microsoft.NET.Runtime.MonoAOTCompiler.Task.net6 version 6.0.16...[0m
[37mInstalling pack Microsoft.NET.Runtime.MonoTargets.Sdk version 6.0.16...[0m
[37mWriting workload pack installation record for Microsoft.NET.Runtime.MonoTargets.Sdk.net6 version 6.0.16...[0m
[37mInstalling pack Microsoft.NET.Runtime.Emscripten.2.0.23.Node.linux-x64 version 6.0.16...[0m
[37mWriting workload pack installation record for Microsoft.NET.Runtime.Emscripten.Node.net6 version 6.0.16...[0m
[37mInstalling pack Microsoft.NET.Runtime.Emscripten.2.0.23.Sdk.linux-x64 version 6.0.16...[0m
[37mWriting workload pack installation record for Microsoft.NET.Runtime.Emscripten.Sdk.net6 version 6.0.16...[0m
[37mGarbage collecting for SDK feature band(s) 6.0.400...[0m
[37m[0m
[37mSuccessfully installed workload(s) wasm-tools.[0m
[37m[0m
[37m Determining projects to restore...[0m
[37m Restored /builds/col/app/App.Shared/App.Shared.csproj (in 1.04 min).[0m
[37m Restored /builds/col/app/App.WebApp/App.WebApp.csproj (in 23.46 sec).[0m
[37m[0m
[37mPublishing to directory /bin/staticsites/a01ad955-5c79-40d0-a69d-40c19d278b3b-swa-oryx/app...[0m
[37m[0m
[37mMSBuild version 17.3.2+561848881 for .NET[0m
[37m Determining projects to restore...[0m
[37m All projects are up-to-date for restore.[0m
[37m App.Shared -> /builds/col/app/App.Shared/bin/Release/netstandard2.1/App.Shared.dll[0m
[37m App.WebApp -> /builds/col/app/App.WebApp/bin/Release/net6.0/App.WebApp.dll[0m
[37m App.WebApp (Blazor output) -> /builds/col/app/App.WebApp/bin/Release/net6.0/wwwroot[0m
[37m Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink[0m
[37m App.Shared -> /builds/col/app/App.Shared/bin/Release/netstandard2.1/App.Shared.dll[0m
[37m Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink[0m
[37m Compiling native assets with emcc. This may take a while ...[0m
[37m [1/3] pinvoke.c -> pinvoke.o [took 1.00s][0m
[37m [2/3] driver.c -> driver.o [took 0.34s][0m
[37m [3/3] corebindings.c -> corebindings.o [took 0.19s][0m
[37m Linking with emcc. This may take a while ...[0m
[37m Optimizing dotnet.wasm ...[0m
[37m Compressing Blazor WebAssembly publish artifacts. This may take a while...[0m
[37m App.WebApp -> /bin/staticsites/a01ad955-5c79-40d0-a69d-40c19d278b3b-swa-oryx/app/[0m
[37mPreparing output...[0m
[37m[0m
[37mRemoving existing manifest file[0m
[37mCreating a manifest file...[0m
[37mManifest file created.[0m
[37mCopying .ostype to manifest output directory.[0m
[37m[0m
[37mDone in 366 sec(s).[0m
[37m[0m
[37m[0m
[37m---End of Oryx build logs---[0m
[31mThe app build failed to produce artifact folder: '/bin/staticsites/ss-oryx/app/wwwroot'. Please ensure this property is configured correctly in your deployment configuration file.[0m
[37m[0m
[33mFor further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/en-us/azure/static-web-apps/[0m
[33mIf you believe this behavior is unexpected, please raise a GitHub issue at https://github.com/azure/static-web-apps/issues/[0m
[33mExiting[0m
section_end:1682627020:step_script
[0Ksection_start:1682627020:cleanup_file_variables
[0K[0K[36;1mCleaning up project directory and file based variables[0;m[0;m
section_end:1682627020:cleanup_file_variables
[0K[31;1mERROR: Job failed: exit code 1
[0;m
I’ve tried changing the output path and outright removing it, but it doesn’t change the Destination Directory. I’ve looked around as much as I can but haven’t been able to find anything to help with this issue.
2
Answers
SiddheshDesai found an answer here. The OUTPUT_PATH should be set up like this.
Your output path is outside of the workspace. You need the path to be within
$CI_PROJECT_DIR
to be uploaded as an artifact. This will also help ensure you have appropriate permissions to the directory.As described in the docs, use this setting for Blazor apps: