Blog Post

Nonprofit Techies
3 MIN READ

Unlock the Power of Azure Database for MySQL servers

Brandon_Antoine's avatar
Jun 09, 2025

Unlock the power of Azure Database for MySQL flexible server with our step-by-step guide tailored for nonprofits

After deploying your web app, you would want to access and manage your database in Azure. If you are unsure how to deploy a WebApp in Azure, follow this article: Building a Web App and Database in Azure for Nonprofits | Microsoft Community Hub. This guide provides step-by-step instructions for nonprofits to connect to their Azure MySQL Database.

Step-by-Step Instructions

  1. Log in to Azure Portal:
  2. Locate Your Database:
    • Navigate to Resource Groups and select the group where your database is hosted.

       

       

    • Click on your Azure SQL Database.

       

  3. Select Networking:
    • In the settings, select Networking.

       

In the image above, the MySQL database is situated within a Virtual Network (VNet). This configuration ensures the database is isolated from the internet, allowing communication solely between resources within the VNet. The most efficient method to access the database is via a virtual machine deployed within the same VNet. Additionally, ensure the virtual machine is deployed in the same region as the MySQL database.

Step-by-Step Guide to Deploying a VM in Azure

  1. Sign in to Azure Portal:
  2. Create a Virtual Machine:
    • In the search bar, type "Virtual machines" and select it from the services.

       

       

    • Click on "Create" and then "Azure virtual machine".

       

       

  3. Configure Instance Details:
    • Enter a name for your VM (e.g., myVM).
    • Choose the image (Ubuntu Server 24.04)
    • Select the size of the VM based on your requirements.

       

  4. Set Up Administrator Account:
    • Provide a username (e.g., azureuser) and a strong password.

       

  5. Configure Networking:
    • Under "Inbound port rules", select the ports you want to allow. Please allow port ssh (22).

       

  6. Select Networking:
    • Under Vnet, ensure that the virtual machine is still on the same Virtual network as the MySQL database.

  7. Review and Create:
    • Click on "Review + create" to validate your settings.
    • Once validation is complete, click "Create".
  8. Connect to Your VM:
    • After deployment, go to the resource and select "Connect" > SSH.

       

  9. Connect with ssh using Azure CLI:
    • Select configure + connect

       

  10. Download and install mysql-client tool to connect to the server. For this example the database is a MySQL database

    • sudo apt-get update

       

    • sudo apt-get install mysql-client

       

  11. Connect to the MySQL database
    • Go back to the MySQL resource

       

    • Click on reset password if you have forgotten the password.

       

    • Once the password is changed, select connect and select connect from browser or locally.

       

    • Copy the code that was displayed. You can see the example from the picture above.

    • Paste the connection code into the virtual machine to establish a connection to the MySQL database. Upon successful connection, a welcome message will be displayed. You can then proceed to use MySQL commands to create and manage your tables.

       

Conclusion

By following these steps, nonprofits can securely access and manage their Azure SQL Database. In the next part, we’ll explore how to deploy your web application codes.

Additional Resources

  1. Connect With Private Access in the Azure Portal - Azure Database for MySQL - Flexible Server | Microsoft Learn
  2. Networking Overview - Azure Database for MySQL - Flexible Server | Microsoft Learn
Updated Jun 05, 2025
Version 1.0
No CommentsBe the first to comment