Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure AspNetCoreModuleV2 in process for multiple virtual apps in Azure App Services

I have ASP.NET Core applications hosted on Azure App Services as two virtual applications in the same App Services instance. The main site app is hosted at / and the blog application at /blog. I would like to use AspNetCoreModuleV2 with the InProcess hosting model. However, it fails to start up and I see this error in the event log:

<Event>
<System>
<Provider Name="IIS AspNetCore Module V2"/>
<EventID>1008</EventID>
<Level>1</Level>
<Task>0</Task>
<Channel>Application</Channel>
...
</System>
<EventData>
<Data>
Only one inprocess application is allowed per IIS application pool. Please assign the application '/LM/W3SVC/170746742/ROOT/api' to a different IIS application pool.
</Data>
<Data>Process Id: 20236.</Data>
<Data>
File Version: 12.2.18296.0. Description: IIS ASP.NET Core Module V2. Commit: 61f1a70784dc0a32cf98f8ddd169c0293b0390ab
</Data>
</EventData>
</Event>

How can I run multiple virtual applications in App Services using the InProcess hosting model?

like image 939
Jeremy Avatar asked Jan 18 '19 04:01

Jeremy


People also ask

How do I deploy multiple apps on Azure Web App?

You can deploy multiple separate 'WebApps' under an 'App Service Plan'. All those WebApps (/websites) will have their own separate default domain (FQDN) and also you can set custom domain for each of those WebApps.

Does Azure App Service use IIS or kestrel?

Azure App Service on Windows Server uses Internet Information Services (IIS).

In which of the app configuration settings categories below would you set the language and SDK version?

In the app's left menu, select Configuration > General settings. Here, you can configure some common settings for the app. Some settings require you to scale up to higher pricing tiers. Stack settings: The software stack to run the app, including the language and SDK versions.

What is the first step of deploying the ASP NET core web app on Azure?

Open Visual Studio and then select Create a new project. In Create a new project, find, and select ASP.NET Core Web App, then select Next. In Configure your new project, name the application MyFirstAzureWebApp, and then select Next.


1 Answers

Nope. The error info in the event log has answered,

<EventData> <Data> Only one inprocess application is allowed per IIS application pool. Please assign the application '/LM/W3SVC/170746742/ROOT/api' to a different IIS application pool. </Data>

In your scenario for running multiple virtual applications in the same Azure WebApp, only one app can run in the hosting model as in-process, others can be configured in web.config file as out-of-process via Kestrel , as below, please see more details at here ASP.NET Core Module.

Note: hostingModel="OutOfProcess"

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" 
                  arguments=".\MyApp.dll" 
                  stdoutLogEnabled="false" 
                  stdoutLogFile=".\logs\stdout" 
                  hostingModel="OutOfProcess" />
    </system.webServer>
  </location>
</configuration>
like image 88
Peter Pan Avatar answered Sep 21 '22 23:09

Peter Pan