How to host a game on Azure

Hi guys, I just started using playcanvas and wanna try it with azure.

I published my game(just a very simple scene) like,

  1. Go to publish/download
  2. Go to download
  3. Go to web download
  4. Download the zip file

After this, I unzipped the downloaded file, and uploaded all things(including index, config, logo and others ) from the zip file to my fps server on Azure. Then I checked the game on Azure with browser
(this is the url, http://playcanvascompatitytest.chinacloudsites.cn/). The playcanvas logo flashed once on the screen, and then nothing happened, all I could see is a black screen as below

I guess there should be mothing things I need to do to host playcanvas game on Azure, instead of just uploading all game fies to the Azure fps server. May anyone plz help me?

Thx

Problem Solution

This problem is caused by that Azure doesn’t load json files successfully for some unknown reasons. I checked the FTP wwwroot directory, and every needed file is just right there, but got this error (from max’s testing)

GET http://playcanvascompatitytest.chinacloudsites.cn/config.json 404 (Not Found)
GET http://playcanvascompatitytest.chinacloudsites.cn/514216.json 404 (Not Found)
Error requesting scene: 514216.json

This error tells Azure doesn’t load json files but is ok with others. For solving this, I ftp a config file called web.config into wwwroot, like,

<configuration>
  <system.webServer>
    <staticContent>
      <mimeMap fileExtension=".json" mimeType="application/json" />
    </staticContent>
  </system.webServer>
</configuration> 

It basically tells server to adds json files back. With this config file, my playcanvas game finally can run on Azure successfully.

Hope this can do something help if you got the same problem.
And Thx for max’s tip!

Please do some debugging. http://developer.playcanvas.com/en/user-manual/scripting/debugging/
Open dev tools and look into console to indicate source of problem.

And please, always share a simple project that replicates an issue, not only result of issue.

Hi max, thx for your quick reply.

I checked my game on Azure again with teh dev tool, and can’t see anything wrong with it so far. I successfully published it on playcanvas as this link https://playcanv.as/b/ACMKjtgv/

I just made the game scene pretty simple for testing. It only has a camera, a light and a cube, no js scripts. It failed on Azure, but worked on Playcanvas…

I guess probably I have to do something more to put it on Azure, which I don’t know currently.

When running published to Azure link, console prints this:

GET http://playcanvascompatitytest.chinacloudsites.cn/config.json 404 (Not Found)
GET http://playcanvascompatitytest.chinacloudsites.cn/514216.json 404 (Not Found)
Error requesting scene: 514216.json

As you can see it is failing to load relevant files. You have to verify if they are actually in place, and then verify if they are publicly accessible from those URL’s. Then it will work.

It did load other files, but not JSON’s. So it could be some settings of what files can be accessed that way.

Hi, max, thx for your tip, and my problem has been sorted out.

Could you plz tell me with which way or tools you tested my Azure website, and got those error messages?

I wanna learn it and use it next time

I’ve used in-build debugging tools of the browser, I use Chrome.
There are many tools, like code breakpoints and inspecting it’s execution; console to write live-js; console to look at errors (which is always first thing to look at); network tab to inspect all network requests and their response statuses; profiling memory and js performance; and many others.
Link is what I’ve provided in first reply: http://developer.playcanvas.com/en/user-manual/scripting/debugging/

When we host on Amazon we had to enable a number of mime types, DDS files and that sort of thing on the server configuration