netCore 3.0 Deploy Pipeline to Azure Error 500 AspNetCoreModule(V2) Handler: aspNetCore Error Cod: 0x00000000 - azure

Ran into an issue the other day that took me a few hours of head bashing to resolve. I hope if someone is having a similar issue I can save them some time. I have a new API i'm building and everything working as expected locally. Setup my dev and staging environments in azure then went about setting up my build and release pipelines. All of that is pretty straight forward as it's just a bunch of button clicking with a little yaml editing.
after the deploy I try to hit my API and bam! error 500. After a bunch of reading I see similar issues regarding AspNetCoreModule vs AspNetCoreModuleV2 and some issues with InProcess vs OutOfProcess.
I then deployed right from VS and amazingly everything worked. I can't do that EVERY time so went back to pipeline deploy and bam error 500 again.
"Detailed Error Information:
Module AspNetCoreModule
Notification ExecuteRequestHandler
Handler aspNetCore
Error Code 0x00000000"

And My Answer!
After comparing the output files from VS deploy and what's in the deploy artifact I realized my .xml comment files were missing in the artifact, the same comments used by swagger.... UGH...
Solution: Copy to Output Directory: Copy if newer - Lesson Learned!

Related

Cannot deploy Azure app service via GitHub Actions after upgrading from .NET Core 5 to 6

I updated my ASP.NET Core web application from .NET Core 5 to .NET Core 6. This seems to work fine locally.
I then checked my changes into GitHub, whereupon a GitHub action builds and deploy this to my App Service on Azure. This did not work the first time, because my YAML file still referenced .NET 5. I changed that and tried again. However, I then got a different error:
Error: EISDIR: illegal operation on a directory, open '/home/site/wwwroot/wwwroot/Identity/lib/bootstrap/LICENSE'
I found a post describing this very error and attempted to follow the instructions suggested by Trevor Davis (https://stackoverflow.com/a/70136206/98422), which was to delete the contents of the /home/site/wwwroot/ folder in my deployed App Service and re-deploy.
However, having done so, I now get a different error when trying to deploy the website:
Error: ENOENT: no such file or directory, open '/home/site/wwwroot/Azure.Storage.Blobs.dll'
An error has occurred during web site deployment.
Kudu Sync failed
...and now I've no idea how to fix it. And my website is down :-(
Can anyone please advise?
Well, I hope this helps someone else. I discovered that simply stopping the website while the deploy was in progress was enough to make it work again.
Two days needless downtime... :-(
I removed all references to identity as I wasn't using it, this got the deployment working. Not sure why..
I my situation, the underlying issue seemed to be updating Microsoft.AspNetCore.Identity.UI from version 5.* to version 6+. What worked for me was just reverting Microsoft.AspNetCore.Identity.UI to 5.0.17.

API deployed in Azure that doesn't work and i dont know why

PS: Found solution see below
i deployed my API to azure via bitbucket pipleine using FTP, but whehn i open the link of the API it displays "HTTP Error 500.30 - ASP.NET Core app failed to start"
Also when i make a request over postman or the frontend SPA it gives me ther same error.
Im realy lost within azure, becouse so many menus and i cant understand whats the problem. It works fine locally and the pipeline was sucessfully.
Can someone help me understand whats going on?
PS: after some diagnostic ( its menu is not intuitive at all) i found this:
: System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. The system cannot find the file specified. File name: 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
My instaled verson is 12.0.0.3 and version 12.0.0.0 dosent even exist on nuget packet manager. Any ideas?
PS: FOUND A SOLUTION
my pipeline is:
https://ibb.co/xC1tcFp
Before the solution the line " cp ./AzureFix/Newtonsoft.Json.dll ./publish" didnt existed and the problem was that the file "Newtonsoft.Json.dll" that bitbucket generated inside the "publish" folder was invalid and when i did "dotnet publish --output publish --configuration release" in my pc that same file was valid.
I found that by using an FTP software to transfer my local files of the "publish" folder to azure and it worked.
So i created a folder in the bitbucket repository with the valid file inside it and in the pipeline i added a line that copy that file to the "publish" folder generated by bitbucket folder and it works like a charm.
Why did that happen ( the generated file of the bitbucket "publish" was invalid) ?
500.30 errors are startup problems, and can stem from a lot of different things, so giving an exact answer is tough. Check your Startup.cs and Program.cs to ensure everything is correct. This could be various dependencies such as DB stuff, cache, KeyVault, etc. or issues with ASP.Net versions.
If you have App Insights running for this App Service, check to see if it reports any issues. Or turn on application logging (https://learn.microsoft.com/en-us/azure/app-service/troubleshoot-diagnostic-logs).
You can also use Kudo to do advanced debugging: https://zimmergren.net/solving-asp-net-core-3-on-azure-app-service-causing-500-30-in-process-startup-failure/
Please check if all the NuGet packages are updated -
I struggled with this error for four days and tried every possible suggestion on forum.
And finally after updating all NuGet packages the problem was resolved.

Vague error with Azure DevOps web app deploy

I am attempting to use an Azure App Service Deploy task in Azure DevOps to deploy a file to an app service in Azure. I have been able to use this release pipeline to deploy to the same app service in the past. Two things have changed: I had to re-make the build machine (which exists in Azure), and the source code moved from Azure DevOps to GitLab.
The error I am running into is:
Error: (3/21/2019 4:34:45 PM) An error occurred when the request was processed on the remote computer.
Error: The server experienced an issue processing the request. Contact the server administrator for more information.
Well, I'm the server admin, and I don't have a clue.
Is there some log file I can look at for more information? Can someone please offer some suggestions?
I'm happy to provide additional information, I'm just not sure what would help at this point.
Thank you Tom Sun for directing me to the system.debug variable. That was very helpful. When I turned on the debugging the release worked, witch really doesn't make sense. I started the build machine after it had automatically shut down the day before, but then I had also rebooted the machine eight or nine times before that.
I removed the debug variable and the release still works.
I have no satisfying answer to how this issue was resolved and I don't know how to get the system in a state to reproduce the error.
An additional finding I have is that the artifact produced by the original build was a corrupt war file. Perhaps that had something to do with it?

Newtonsoft.Json.JsonReaderException thrown when running Azure function(V2) locally

I created a queue trigger template of Azure function v2 in VS2017.
When I ran the project locally, the function runtime started successfully. But when I created a message in the queue, VS downloaded a JsonSerialization.cs file and pointed out the error.
Details of default Exception settings:
It's a template generated by VS, so there seems no code issue like what I have found in other posts.
What I have tried:
Publish the project to Azure, works.
Run the project with function core tool(Cli) installed by npm, also works.
I guess the problem is related to the function Cli used by VS. But its runtime version is 2.0.11651.0, same as the one installed by npm.
Have anyone met this before or got any idea? Thanks in advance.
This exception is internal and should be caught by the runtime. Feel free to ignore it in exception settings, and then everything should just work.

Why does my Umbraco installation from within the Azure Marketplace always fail?

I am trying to install Umbraco by using the Azure Marketplace. There they offer a template for it. I am always receiving the error below. I tried to install it a couple of times now but I always get the same error.
Does anybody know what this error message means? Is anybody able to install Umbraco by using the template in the Azure Marketplace?
]
You're asking 2 questions above.
Please see my answers and proposed troubleshooting guide/workaround below:
The error message means that the MSDeploy process failed due to some error which renders it unable to deploy the web deploy package for your Umbraco web app.
Yes I am able to provision a Umbraco web app from the Azure Market successfully (Location: Central US) and couldn't reproduce your issue
Troubleshooting Guide:
Append .scm in front of the azurewebsites.net of your Umbraco Web App as shown below and go to the Url.
Click on the Diagnostic Dump. You will be prompted to download a .zip file
Extract the zip file. You should see 2 folders at root level
Go into
LogFiles\SiteExtensions\MSDeploy
You should see the detail log files for MSDeploy
Detailed MSDeploy log messages are in the appManagerLog.xml file.
If it is related to client side issue which can be resolved by yourself, you can try to resolve it and try again.
If it is related to server side issue, you should create a support ticket for Microsoft to look into with the detailed MSDeploy log which pinpoints the root cause which will help them a lot.
Hope this is useful.
A Microsoft employee confirmed this is a bug in the application currently. I have to wait for a fix.
I have encountered numerous problems with the Azure installer of Umbraco, try setting it up in VS2015 then publishing it to Azure. I have found that this works well.

Resources