API for MySql Database in Azure

Awais Muhammed 1 Reputation point
2022-10-28T12:25:25.207+00:00

Background: For my Backend in Mobile Xamarin Project, I am trying to set up so that all my database related query calls made from this mobile app are sent via GET request which so far appears to be the safest way of requesting information via web. We as a company already have MySQL in Azure that we use everyday to run reports out of in Excel and PowerBI locally. This mobile app will only be distributed internally to staff members.

Problem: Within Azure portal, how can I expose this MySQL database to API so that it is first testable at least in Postman client before moving in to Visual Studio IDE?

What have I tried so far?: Within Azure Portal, I have created an API app and under its configuration contains connections string from MySQL database. Registered this app in Azure AD and set some permission levels. Don't exactly know where to go from here.

Your help will be much appreciated as have been stuck on this for a long time.

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
711 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 27,012 Reputation points Microsoft Employee
    2022-10-30T14:01:53.867+00:00

    Hi, @Awais Muhammed Welcome to the Microsoft Q&A platform, thanks for posting the question
    As I understand correctly the ask here is how to use Azure API App with MySQL
    Unfortunately, there are not any tutorials in API App docs, here is the generic API app to understand how to write code and deploy to the API app You can try checking this doc here,

    For this "how can I expose this MySQL database to API so that it is first testable at least in Postman client before moving into Visual Studio IDE?",
    --API app can connect to the database using a driver like MySQL .NET connector if building a .NET app. There is no other way today to connect to the database directly without a driver.
    you may need to install Azure SDK in that runtime language for doing any management operation on the server such as updating firewall rules, updating the configuration of the server, etc programmatically.
    you may not need the SDK if you are using a single database and plan to only connect and query from the API app.

    You can also refer to this StackOverflow that shows how to use Xamarin app using the .NET connector for MySQL

    I have updated my comments.
    I hope this information helps. please let me know if you have any additional questions.
    Regards
    Geetha