question

Error401-7025 avatar image
0 Votes"
Error401-7025 asked ryanchill commented

Issue with Azure App Service while deploying Web Service (PHP with MySQL)

I'm new to Azure App Service.

I want to run a WebPage, I'm using PHP and MySQL as backend. Everything is working fine for me when I'm running local but my task is to connect the database residing in a remote server. I have created a VM in Azure and installed XAMP, now I'm trying to connect the MySQL in that remote server with the Azure "MySQL in App" but every time I connect I get the error "MySQL in App import failed"

87678-image.png

NOTE - I'm not using the root account - a proper account with a password has been configured in MySQL, also note that XAMP uses port 3306 for MySQL and that is opened in the networking part of that VM so there is no issue in VM.

Please let me know if you need more information. I need a solution ASAP,

Thanks


azure-webappsazure-database-mysqlazure-webapps-development
image.png (6.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ryanchill avatar image
0 Votes"
ryanchill answered ryanchill commented

Hi @Error401-7025,

It sounds like your mixing IaaS, the deployed VM, with PaaS, Azure App Service. MySQL InApp; which you can read more about here, is an offering meant for quickly testing/troubleshooting your application before moving to production workloads. Since MySQL In-App is scaled down local database, connecting to it is done in the app service through various dynamically created application settings; it doesn't use 3306.

I can't speak on XAMPP, but you can follow https://docs.microsoft.com/en-us/azure/app-service/tutorial-php-mysql-app?pivots=platform-linux tutorial on creating a PHP app backed by MySQL Azure instance. You can leverage the MySQL In-App to perform all your testing and then export the schema to a MySQL Azure instance.

Regards,
Ryan

· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, then I have a question.
I'm basically trying to make a DMZ architecture where the front-end will be in the DMZ and the backend MySQL database will be in a private network.
'
How do I achieve this in Azure App-Service

Thanks

0 Votes 0 ·

Hi
I'm basically very new to Azure.
I think I have to create Azure MySQL database and somehow connect Azure App-Service with Azure MySQL database

Correct me if I'm wrong.

0 Votes 0 ·

You are correct. The tutorial I linked above walks you through creating the database and configuring to connect your application to it. Instead adding 0.0.0.0 for begin and end IP address in this step, you can either skip this step or add your client IP address so you can configure your database schema from your machine. You can also add the outbound IP address of app service. This will ensure your database server only accepts traffic from your client machine and app.


1 Vote 1 ·

Thank You @ryanchill for guiding me.
I finally made the architecture and it is working fine for me.

Can you help me with building SQL Clusters on the same architecture using MySQL in Azure.


This is what I made -
I defined an Azure database for MySQL, which I'm managing from MySQL Workbench
Azure App Service - Where I uploaded my PHP and HTML files, I'm managing the connection string from Diagnostics Console in KUDU, I actually configured the SQL_Connection String there and updated all the PHP files there with the connection.
I configured the firewall setting where Azure database for MySQL is accessible only by the Azure App Service and (Workbench console server only when required otherwise I have closed the connection)

Thanks

0 Votes 0 ·
Show more comments