Since Azure supports Jetty, a B4J server app can also run on azure.
1. Search jetty in the marketplace and create a web app service.
2. Use git to clone the repository. You can find the link in "Properties".
3. Place your .jar at someplace in the repository and edit web.config.
change this:
to this:
The server needs to set its port based on the argument. The b4j code:
4. Then use git push to make deployment.
Here is an example: https://b4jserver.azurewebsites.net/hello
More detailed instruction by tchart: https://www.b4x.com/android/forum/t...on-azure-as-an-app-service.98277/#post-638780
1. Search jetty in the marketplace and create a web app service.
2. Use git to clone the repository. You can find the link in "Properties".
3. Place your .jar at someplace in the repository and edit web.config.
change this:
B4X:
arguments="-Djava.net.preferIPv4Stack=true
-Djetty.port=%HTTP_PLATFORM_PORT%
-Djetty.base="d:\home\site\wwwroot\bin\jetty-distribution-9.1.2.v20140210"
-jar "d:\home\site\wwwroot\bin\jetty-distribution-9.1.2.v20140210\start.jar""
to this:
B4X:
arguments="-Djava.net.preferIPv4Stack=true
-jar "d:\home\site\wwwroot\bin\start.jar"
%HTTP_PLATFORM_PORT%"
The server needs to set its port based on the argument. The b4j code:
B4X:
Sub AppStart (Args() As String)
Dim port As Int
port=Args(0)
srvr.Initialize("srvr")
srvr.AddHandler("/hello","hello",False)
srvr.Port=port
srvr.Start
StartMessageLoop
End Sub
4. Then use git push to make deployment.
Here is an example: https://b4jserver.azurewebsites.net/hello
More detailed instruction by tchart: https://www.b4x.com/android/forum/t...on-azure-as-an-app-service.98277/#post-638780
Attachments
Last edited: