Accessing SQL Server from mobile app remotely

relzerelze Member ✭✭

Hi, I have created different web services to access my sql server database from a mobile device. The thing is they both the mobile device and my laptop had to be in the same network(wifi). Now, I would like to know what do I need to do in order to using my mobile app from the outside access to a remote database.
Please be specific with your answer, I would like to know if a rest api is the best choice or not, and if it is then what's the procedure to implement remote access and what's the security configuration for sql server. thanks.
I using Xamarin Forms(cross platform) and SQL Server 2017.

Best Answer

  • JohnHJohnH GB ✭✭✭✭✭
    Accepted Answer

    Yes, by using a webapi that is hosted by your organisation that can access the on premise SQL Server instance.

    Or getting the organisations IT team to open the required access specifically for Azure. This is not a problem that can be solved just with software.

Answers

  • JohnHJohnH GBMember ✭✭✭✭✭

    @relze said:
    Hi, I have created different web services to access my sql server database from a mobile device. The thing is they both the mobile device and my laptop had to be in the same network(wifi). Now, I would like to know what do I need to do in order to using my mobile app from the outside access to a remote database.
    Please be specific with your answer, I would like to know if a rest api is the best choice or not, and if it is then what's the procedure to implement remote access and what's the security configuration for sql server. thanks.
    I using Xamarin Forms(cross platform) and SQL Server 2017.

    Your organisation has a public web server I presume? You need to host the webapi on a publicly available web server.
    You then update your mobile app to use the public address.

  • relzerelze Member ✭✭
    edited August 2018

    @JohnHair said:

    Your organisation has a public web server I presume? You need to host the webapi on a publicly available web server.
    You then update your mobile app to use the public address.

    I'm pretty sure the company I work for has an azure account, but i was also provided access to their remote database. So, if for testing purposes I use my personal azure account so I can publish my api there, then how would I do to connect that api to their remote database?

  • JohnHJohnH GBMember ✭✭✭✭✭

    You want to solve this using the webapi hosted in Azure accessing an on premises SQL Server?
    This isn't a Xamarin specific question, you will have firewall issues to resolve to allow Azure access to the db. if I were you I would ask that question on Azure related forums.

  • relzerelze Member ✭✭

    Yeah from what I tried the company's firewall wont allow azure to connect to their database. But then, using xamarin forms is there any way i can get a connection between a cross-platform mobile app to a remote database from anywhere and not only locally?

  • JohnHJohnH GBMember ✭✭✭✭✭
    Accepted Answer

    Yes, by using a webapi that is hosted by your organisation that can access the on premise SQL Server instance.

    Or getting the organisations IT team to open the required access specifically for Azure. This is not a problem that can be solved just with software.

  • relzerelze Member ✭✭

    So this is what i can say in the next meeting, because I got the connection working locally, but now if they want me to start working on making this connection work from the outside then either they will host the api somewhere in their server or I get access to their azure account.

  • JohnHJohnH GBMember ✭✭✭✭✭

    @relze said:
    So this is what i can say in the next meeting, because I got the connection working locally, but now if they want me to start working on making this connection work from the outside then either they will host the api somewhere in their server or I get access to their azure account.

    For the first point yes, for the 2nd they would need to allow access from their Azure account through the corporate firewall.
    It is up to them to decide of course, but you have at least given them options to consider.

Sign In or Register to comment.