Unity3dAzure / AppServicesDemo

Azure App Services demos for Unity
https://www.deadlyfingers.net/tutorial/azure-app-services-for-unity3d
MIT License
27 stars 13 forks source link

Specific instructions on how to create the HighScore table with a Mobile App Service #17

Closed punkouter2021 closed 7 years ago

punkouter2021 commented 8 years ago

I created an easy table and a database.

Not sure if that is what I do or something else. Where exactly do I past in the js script?

How would an example that uses a API App Service be different ?

I imagine in the long run I would want to create Azure API App Service since you have swagger and can then easily expose that endpoint to other things like LOGIC APPS

deadlyfingers commented 8 years ago

@punkouter everything shown in the Highscore Azure Mobile Service demo will work with an Azure App Service. I will publish a detailed blog post about setting up Azure App Service as part of issue #14. But here's some pointers to go with for now -

  1. Using Azure App's 'Easy Tables' create a new 'Highscores' table - (incase case sensitive type name exactly as shown) 1-easytables
  2. Set all table permissions to allow anonymous access to start with. 2-tablepermissions
  3. Manage schema to add Number column for 'score' and String column for 'userId' 3-manageschema
  4. Set CORs to '*' to allow all origins to start with cors

Finally you can also replicate custom API feature of Mobile Services using Azure App Service's 'Easy APIs'. In this demo I created an API called 'hello' to return some helloworld text. easyapis

punkouter2021 commented 8 years ago

How are you writing the custom API ? Do I do it all in azure? Do I create the Mobile App starting from VS2015 and write it there? If I do it within azure then how do I get that .csproj file with the code? OR is it meant to only be done in Azure?

deadlyfingers commented 8 years ago

@punkouter You can write it all in Azure App Services if that makes things easier. I used the Javascript (Node) backend (but if you are using C# is might be easier using VS as you mention). Add a new API using Easy API and name it 'hello'. Then select the API and Edit Script to make live changes -

editscript hello js

Copy of demo 'hello' script

module.exports = {
    "get": function (req, res, next) {
        res.send(200, { message : 'Hello App :)' });
    }
}
punkouter2021 commented 8 years ago

I am used to c# and API App so maybe that what confuses me. What I would like is to have everything in a VS project I can run locally and then Publish is Azure as needed..

I think they are converging API APP/MOBILE APP/WEB APP.. since they are all pretty much the same ?

Ill try the .js way for now and paste in what you did above

deadlyfingers commented 8 years ago

Yes Mobile Services can be migrated to an Azure App Service now. Both give you a backend but App Service is newer and has a lot more things to play with! Yeah I should prob do a separate tutorial guide for JS and C# backends so people can use what they prefer to code in. But I presume most Unity coders would prefer C#...

punkouter2021 commented 8 years ago

It feels strange coding in the cloud and not having everything local ... Since eventually Id want to write unit tests to test out the APIs Unity will call.. And testing in VS is a lot quicker than doing it in Unity I think

deadlyfingers commented 7 years ago

Will be closing this issue as I have added developer guide link on creating a Highscore table using Easy Tables. http://www.deadlyfingers.net/azure/azure-app-services-for-unity3d/

Please reopen if still an issue.