As per documentation [https://azure.microsoft.com/en-us/documentation/articles/web-sites-java-custom-upload/], we can run a custom java app. With following setup, Wildfly runs fine but keeps getting restarted and hence I cannot access the website from [http://app-service.azurewebsites.net/].
Publishing source as "Local Git Repository"
1. git clone https://user#<app-service>.scm.azurewebsites.net:443/<app-service>.git
2. Copy Wildfly under bin folder
3. Create web.config under root folder
4. git add .
5. git commit -m "initial"
6. git push origin master
web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="%HOME%\site\wwwroot\bin\wildfly\bin\standalone.bat"
arguments="">
<environmentVariables>
<environmentVariable name="SERVER_OPTS" value="-Djboss.http.port=%HTTP_PLATFORM_PORT%" />
<environmentVariable name="JBOSS_HOME" value="%HOME%\site\wwwroot\bin\wildfly" />
<environmentVariable name="JAVA_OPTS" value="-Djava.net.preferIPv4Stack=true" />
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>
Log Files
1. Connect to ftp://<app-service>\user#waws-prod-sn1-033.ftp.azurewebsites.windows.net
2. Check Wildfly log at path: /site/wwwroot/bin/wildfly/standalon/log
Log snippet
2016-05-18 18:17:16,539 INFO [org.jboss.as] (MSC service thread 1-1) WFLYSRV0049: Keycloak 1.9.1.Final (WildFly Core 2.0.10.Final) starting
2016-05-18 18:17:16,539 DEBUG [org.jboss.as.config] (MSC service thread 1-1) Configured system properties:
awt.toolkit = sun.awt.windows.WToolkit
file.encoding = Cp1252
file.encoding.pkg = sun.io
...
2016-05-18 18:17:16,549 DEBUG [org.jboss.as.config] (MSC service thread 1-1) VM Arguments: -Dprogram.name=standalone.bat -Djava.net.preferIPv4Stack=true -Dorg.jboss.boot.log.file=D:\home\site\wwwroot\bin\keycloak\standalone\log\server.log -Dlogging.configuration=file:D:\home\site\wwwroot\bin\keycloak\standalone\configuration/logging.properties
2016-05-18 18:17:22,976 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
2016-05-18 18:17:23,095 INFO [org.xnio] (MSC service thread 1-2) XNIO version 3.3.4.Final
2016-05-18 18:17:23,193 INFO [org.xnio.nio] (MSC service thread 1-2) XNIO NIO Implementation Version 3.3.4.Final
2016-05-18 18:17:23,347 INFO [org.jboss.remoting] (MSC service thread 1-2) JBoss Remoting version 4.0.18.Final
...
2016-05-18 18:18:07,318 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 48) WFLYUT0021: Registered web context: /auth
2016-05-18 18:18:07,457 INFO [org.jboss.as.server] (ServerService Thread Pool -- 45) WFLYSRV0010: Deployed "keycloak-server.war" (runtime-name : "keycloak-server.war")
2016-05-18 18:18:07,799 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
2016-05-18 18:18:07,799 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
2016-05-18 18:18:07,799 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: Keycloak 1.9.1.Final (WildFly Core 2.0.10.Final) started in 53968ms - Started 416 of 782 services (526 services are lazy, passive or on-demand)
The issue was with dynamic port (not 8080). The correct configuration to work with dynamic port assignment is as follows. Please notice the change in arguments="-Djboss.http.port=%HTTP_PLATFORM_PORT%".
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="%HOME%\site\wwwroot\bin\wildfly\bin\standalone.bat"
arguments="-Djboss.http.port=%HTTP_PLATFORM_PORT%" startupTimeLimit="120" startupRetryCount="2" requestTimeout="00:10:00" stdoutLogEnabled="true">
<environmentVariables>
<environmentVariable name="JBOSS_HOME" value="%HOME%\site\wwwroot\bin\wildfly" />
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>
Related
I'm trying to deploy FastAPI app on IIS.
I followed this guide from Microsoft.
My web.config looks like
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="PythonHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="c:\Python\Python310\python.exe"
arguments="uvicorn main:app"
stdoutLogEnabled="true"
startupTimeLimit="60"
processesPerApplication="16">
<environmentVariables>
<environmentVariable name="TEMPLATE_STRING" value="some-random-string-text" />
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>
When I'm trying to browse the application, I'm getting an error
HTTP Error 502.3 - Bad Gateway
There was a connection error while trying to route the request.
Most likely causes:
1. The CGI application did not return a valid set of HTTP errors.
2. A server acting as a proxy or gateway was unable to process the request due to an error in a parent gateway.
Can someone point out to me in correct direction. It's my first time working with Windows Server (2019) and IIS (10).
I did not find any recent tutorial on DropWizard on Azure, the only one I found (https://github.com/AzureCAT-GSI/DropWizardOnAzure) is outdated. Something is missing.
web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="%JAVA_HOME%\bin\java.exe"
arguments="-Djava.net.preferIPv4Stack=true -jar "%HOME%\site\wwwroot\TestWebService-1.0-SNAPSHOT.jar" -Dserver.port=%HTTP_PLATFORM_PORT% "%HOME%\site\wwwroot\config.yml"">
</httpPlatform>
</system.webServer>
</configuration>
config.yml
logging:
level: INFO
loggers:
com.TestWebService: DEBUG
I have deployed web.config, config.yml and .jar into wwwroot.
The outcome is always 503.
How to even debug it? I have enabled and checked logs - nothing useful.
Linux appservice also returns error.
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?
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>
I'm getting an HTTP 502.5 error when trying to run my ASP.NET core 2.0 web app from IIS.
I've installed the .NET Core Windows Server Hosting Bundle and checked all my IIS settings as per this document https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/index?tabs=aspnetcore2x
The web.config looks like this.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\OscarWeb.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
The Windows event log produces the following errors.
It is IIS v6.2 running on Windows Server 2012 R2. The web application was built using ASP.NET Core 2.0.
When I run dotnet from the commandline as follows there are no errors:
dotnet oscarweb.dll
The first thing you have to do in this scenario is to create the logs folder if it is missing and check the stdout logs generated.
It can be several different things but from personal experience the most common issue i had was IIS not having enough permissions to run it. In IIS you can configure the Identity used in Advanced Settings. If it is using ApplicationPoolIdentity then change it to LocalSystem and see if it works. The logs in the stdtout file however will give you the answer.
The solution to this problem (in my case at least) was to reboot the web server. After installing the .NET Core Windows Server Hosting Bundle you need to reboot the server for them to be registered correctly.
Thanks to Chris Pratt (first comment underneath my question) for suggesting the answer :)
Not sure if your webconfig is complete. I believe aspnetcore tag needs to have the ASPNETCORE_ENVIRONMENT environment variable set as well.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\OscarWeb.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" >
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="YourRuntimeEnv" />
</environmentVariables>
</aspNetCore>
</system.webServer>
</configuration>
When I publish my .net Core 2.0 app to IIS I recieve a HTTP Error 502.5 Process Failure.
I have read the HOST ASP.NET Core... Several times without beeing able solving my problem.
I can start the app from cli "dotnet AppWebApi.dll" but i Can't access the app with the command "http://localhost:5000" Receive "WebPage cannot be found"
My best guess so far, is that the problem are related to hosting the .Net Core WebAPI as a SubWeb to an non .netCore WEB.
My web.config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<aspNetCore processPath="dotnet" arguments=".\AppWebAPI.dll" stdoutLogEnabled="true" stdoutLogFile=".\AppWebApi.log" forwardWindowsAuthToken="false" />
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
</system.webServer>
</configuration>
I Know similar questions has been asked before, but none of these has so far solved my problem, so I hope to get some new impulses.