Azure Devops release to IIS fails after AOT blazor wasm - iis

I have a .NET 7.0 blazor wasm app, that I deploy to a windows server running IIS. This has worked fine, until i added the following to my project (The client, and the project is .net core hosted):
<WasmEnableSIMD>true</WasmEnableSIMD>
<RunAOTCompilation>true</RunAOTCompilation>
First i got the following error in my build pipeline:
error NETSDK1147: To install these workloads, run the following command: dotnet workload restore
So i added a command line step to my build pipeline where i run the following command:
dotnet workload restore
So far so good. Now the project builds again. But my release now fails. I have 3 steps in my release pipeline for my IIS server:
Stop app pool
deploy my app
start my app pool
This worked fine before adding the two statements above. But now i get the following error:
Failed to deploy web package to IIS website.
Error: Unrecognized argument 'Files\IIS\Microsoft'. All arguments must begin with "-".
Error count: 1.
Error: The process 'C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe' failed
with exit code 4294967295
I can't seem to find a solution, so has anyone tried something similar?

Apparently i wasn't the only one with the issue:
https://github.com/microsoft/azure-pipelines-tasks/issues/17634
I ended up removing web deploy 4.0, and now it works again.
Maybe if I had waited longer, i wouldn't have to remove web deploy 4.0

Related

NextJS Deploy (Release) error on Task with Azure Web App Deploy

hope to get some help as I'm struggling to get a NextJS or any type of node project to successfully deploy on Azure with DevOps pipeline.
I have all the steps and configuration working on the Repo PR to then run a build and finally the triggered Release. It will pull down the zip artifact from the build, however I always get an error on the agent job for the task "Azure Web App Deploy".
In short the job appears to always run a yarn install command vs. the Startup Command setting.
My setup is as follows:
Task Settings
Azure Web App Deploy task error
Tried with different Startup commands, which none display in the task.
I added the following in the "Application and Configuration Settings" section of the task:
-SCM_DO_BUILD_DURING_DEPLOYMENT FALSE
-build-remote true

GenerateEFSQLScripts fails when trying to publish to IIS using Web Deploy from TeamCity

Running into a total dead-end here.
I've created a Publish Profile for a .net6 application that we want to publish to IIS with Web Deploy. In the Entity Framework Migration section, the option to "Apply this migration on publish" is selected.
When manually clicking publish, everything works. However, we want to automate this in TeamCity using the .NET build runner. The publish step fails at:
Generating Entity Framework SQL Scripts...
Executing command: dotnet ef migrations script --no-build --idempotent --configuration Release --output "C:\TeamCity\buildAgent\work\cbf95cc2b4413601\MySolution.Api\obj\Release\net6.0\PubTmp\EFSQLScripts\MySolution.Data.MyContext.sql" --context MySolution.Data.MyContext
C:\Program Files\dotnet\sdk\6.0.400\Sdks\Microsoft.NET.Sdk.Publish\targets\TransformTargets\Microsoft.NET.Sdk.Publish.TransformFiles.targets(221,5): error : Entity Framework SQL Script generation failed
Internal error message details: BuildMessage1 0 Text DefaultMessage ERROR 400682522803500 tags:'tc:parseServiceMessagesInside'
Error message is logged
Build FAILED.
I cannot find any specific error messages anywhere in any log. Looking in the Microsoft.NET.Sdk.Publish.TransformFiles.targets file shows that it's failing on GenerateEFSQLScripts - an MSBuild command that executes dotnet ef under the covers.
I thought this might be a case of dotnet ef not being installed on the build agent. But when I manually run the command myself from C:\TeamCity\buildAgent\work\cbf95cc2b4413601\MySolution.Api, it succeeds, and the SQL scripts are successfully created.
I also thought it might just be a case of the command being run in the wrong directory (i.e. in the root MySolution folder rather than the MySolution.Api folder), but explicitly setting the working directly fails at the same point, with the same error.
Has anyone seen this before? Or could point me to where an actual error might be located?

What means Range error on my Release pipelines?

When the release pipeline run end up with this error
RangeError [ERR_INVALID_OPT_VALUE]: The value "4294967295" is invalid for option "size".
I don't know what means this error
task failed
Log of the task failed when release run
Same issue for me using Web Deploy to a nodejs app service.
Web Deploy worked at first, until we added some packages in our package.json (e.g. "#fortawesome/free-brands-svg-icons")
Then our release pipeline suddenly outputs "64-bit = +" in the deployment log.
If we remove the packages, the "64-bit = +" is gone, and our Web Deploy works again.
Image of log from Release pipeline
Not sure how to resolve it, but in our case we used Zip Deploy instead like #Ari Gunawan recommended.
I had the same issue when trying to deploy a node app to Azure App Service from release pipeline. Not sure what the error means as there are no further details about it but I resolved it by using "Zip Deploy" deployment method and "Continue on error"

Site cannot be loaded when using Deploy to Web app from VS Code

At work I'm using Visual Studios 2019 to publish my ASP.Net Core 2.1 App to the Azure App Service. At home I run a linux maschine and use VS Code to work on the project. Now I'm having trouble to deploy the app to Azure using 'Deploy to Web App' in VS Code. The process finishes successfully but when I open the url I get an 'IIS 502.5 Error - Process Failure'. Using Visual Studio this does not happen.
Before deploying the app I tried to build it using
dotnet build -c Release
with no success. I also tried
dotnet publish -c Release -f netcoreapp2.1 --no-self-contained
with no success too. Both commands followed by 'Deploy to Web App'.
Am I doing something wrong or do I miss some build-option?
Got it myself. Found the solution here.
You just have to set the deploySubpath to the directory where dotnet publish puts the generated files. In my case I had to set it to project_1/bin/Release/netcoreapp2.1/publish, which will be created by the command dotnet publish -c Release.
You can set the deploySubpath value in Settings > Extensions > Azure App Service or by editing the file settings.json in the .vscode directory. This directory will be created in the root directory of your workspace.
Be careful to always set the deploySubpath relatively to your .vscode directory. In my case my workspace looks like this
-- .vscode
:- project_1
`- project_2
where project_1 is my ASP.Net Core project and project_2 is a nodejs project.

VSTS - Build a Docker Image

I have a .NET Core repo in VSTS. I'm trying to create a Build pipeline that builds a Docker image and adds it to my Azure Container Registry. My Build pipeline has a Docker task. This task has the "Build an image" action selected. This action relies on my Dockerfile, which looks like this:
FROM microsoft/dotnet:2.1.2-runtime-nanoserver-1803
# Install .NET Core
ENV DOTNET_VERSION 2.1.2
When my Build pipeline runs, I get an error that says:
failed to register layer: re-exec error: exit status 1: output: ProcessUtilityVMImage \\?\C:\ProgramData\docker\windowsfilter\82aba535faccd8bf0e5ce3c122247672fa671214000a12c5481972212c5e2ca0\UtilityVM: The system cannot find the path specified.
##[error]C:\Program Files\Docker\docker.exe failed with return code: 1
Why am I getting this error? How do I fix it?
It should be the same issue with this one : https://github.com/Microsoft/vsts-tasks/issues/6510
Seems it still have some issues with nanoserver-1803
Just try to setup and host a custom agent on Azure VM, then check it again.
https://github.com/Microsoft/vsts-tasks/issues/6510#issuecomment-370152300
I found maybe an explication about this error: VSTS agents seem not
support nanoserver-1709 actually. Maybe this will change with the next
version 1803.
See details here: Microsoft/vsts-agent#1393
When I setup and host a custom agent on a machine on Azure, it's
working. So it's not a bug with this task. I close this issue. Thanks!

Resources