How can I wire up Azure App Service logging in nopCommerce?
I've tried following this blog post: ASP.NET Core Logging with Azure App Service and Serilog but I don't see where loggerFactory is used in nopCommerce.
If you're looking into version 4.0 or older, then yes! loggerFactory has not been used in that version. However, newer version (i.e version 4.1) is using it at few places.
Check current development branch at here.
Related
I am trying to deploy a .NET 6 WebJob to an existing Azure App Service using Azure DevOps. I updated the App Service from ASP.NET V4.8 to the .NET 6 (LTS) version.
I installed the ASP.NET Core 6.0 (x64) Runtime extension
I also verified the .net version in the Azure CLI console:
Using the Azure App service deploy task in Azure DevOps, I get the following error message
The application pool that you are trying to use has the 'managedRuntimeVersion' property set to 'v4.0'. This application requires 'v6.0'. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_APPPOOL_VERSION_MISMATCH. Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_APPPOOL_VERSION_MISMATCH.
Can anyone help me understand what I need to do to update the managedRuntimeVersion? My applicationhost.config file does have v4.0, but I don't have the rights, nor does it seem like the correct fix to modify this directly. Any ideas how I can update the managedRuntimeVersion, or what else I'm missing here?
I've deployed my code to an app service using Azure Devops CI release agent. Once I browse to the App service, it shows this error, stating that .net 5 isn't installed, and lists what is.
'The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.'
This is what I have selected in the app service configuration, as it looks to be the only .Net 5 option.
Based on my test, the Azure App Service could support the .Net 5.
From the error message, it is indeed show that .net 5 hasn't been installed in the app service.
I could reproduce this issue too.
But when I select the .Net5 (Early Access) in Configuration and Save it, it will update the web app settings. Then the website could run successfully.
From your screenshot, you already selected this option. You could try to restart the App service and check if it could work.
On the other hand, you could try to create a new App Service with .Net5 (Early Access). Then you could directly use the App service with .Net 5.
Here is a ticket with the detailed introduction, you could refer to it.
We have a .NET Core 2.1 Web App on Azure as an App Service. We deploy it to Azure via Visual Studio 2017's publish option (though it is also in a Git repo). It has a bunch of custom domains and SSL on all of them provided by Azure.
We've written a new version of the web app in .NET Core 3.1, in VS 2019. Identical functionality but written from the ground up rather than trying to upgrade the existing 2.1 version.
There's no staging version online as such - instead we develop on local machines and then just use test domains online that use the same service but where the environment is switched to use dev DBs and bucket locations etc, which is one of the reasons to write a new app rather than upgrade it, also, it just seemed cleaner and I saw that people had some issues when doing upgrades...
Is there an easy way to switch/publish the new web app/code into the current Azure App Service, to replace the old one? Or will I need to create a new App Service and then create all the custom domains, SSL etc there after removing them from the old one?
Or could I perhaps switch to git deployment and push the entire new project in over the old one - would that work or just create some kind of disaster?
There is usually no issue when pushing a new application version to your app service, even if it uses a new version of .NET Core.
You have to consider two things:
Windows AppService Plan: .NET Core 3.1 runtime has been rolled out worldwide, while the SDK has not (yet). When in doubt, use self-contained deployment.
Linux AppService Plan: You need to select the desired runtime version in the portal. Using e.g. Azure Pipelines you can set the runtime version at the same time as you publish the new version. Not sure how VisualStudio handles this.
As a general recommendation, you should follow silents suggestion of using slot deployments to have as little impact for your customers as possible. Each slot can have e.g. a different .NET runtime version, so you can test everything on the staging slots.
Problem
After upgrading a .Net Core 2.2 Linux Web App to .Net Core 3.1 in Azure, the application is down with a Specified framework 'Microsoft.AspNetCore.App', version '3.1.0' was not found error. I even went as far to create a new Linux Web App with .Net Core 3.1, and after the bash command prompt is still outputting dotnet --list-runtimes as 2.2.7.
Details
Website Down
Logstream
reporting application is down because it can't find .net core 3.1.
Created new .net core web app
3.1 linux webapp in North Central, same problem
Ensured it was running in North Central US
According to https://aspnetcoreon.azurewebsites.net/, should have full .netCore 3.1 support
Still .net core 2.2.7
opt/dotnet/runtimes lists 3, 3.0 and 3.0.0, but no 3.1`
Environment variables
My environment variables in Azure list FRAMEWORK_VERSION = lts, instead of 3.1
Publishing
This was published from an azure devops ci pipeline using an Azure AppService Deploy task. 3.1 wasn't available here, so I chose LTS
Update 1
It seems the culprit is 3.1 missing from the framework stack in Azure Devops Web App / Web Service tasks.
Whenever I publish from CI, the web app framework is updated to whatever is selected in this dropdown. If I manually go change the framework to 3.1 on the Azure Web App, the site comes up. But then the next publish it goes back down because it reverts the framework back to the settings in the ci.
New Question
How can I get the Azure Devops Release pipeline to publish a .net core 3.1 task?
Update 2
Related Azure Devops forum post
Currently being investigated as of 2/23/2020
.Net Core 3.1 deploy pipeline to Linux App Service
Suggested Workarounds
Use YML for release pipeline and manually change the version from 3.0 to 3.1, noted by answer and this thread
Upgrade from a framework dependent release to a self contained. Reference
Downgrade to .NetCore 3.0
I've run into the same situation, using the information you provided I've been able to fix the issue by setting the value manually in the Devops Pipelines Build .yml file. It seems like they are just missing the value from RunTime Stack drop down. If you manually update the build processes .yml file as seen here:
This will select the proper framework version. Hopefully this will fix your issue with the Azure Devops CI Pipeline deployment.
An easier solution is to type DOTNETCORE|3.1 into the Runtime Stack dropdown in devops. (Thanks rdavisau!)
i have an asp.net core app who works correctly on my computer but not on azure app service:
In one of my api, i return a dynamic type.
from the api runed on my computer i got (with .net core version : 1.0.1):
{"id":2,"color":"#3da1e8 ","logo":"","name":"...","companySecurities":[]}
from the api runed on azure app service i got (with .net core version : 1.1.0-preview1-001100-00):
{"id":2,"color":"#3da1e8 ","logo":"","name":"...","companySecurities":[]
You can see the the last bracket disapear on azure app service.
I want to know if there is a way to change the .net core version of azure app service to 1.0.1 .