How To Host Laravel 5 Web App To Azure Along With Its Database?
I've tried to host the Laravel 5 web app by following this tutorial,
It successes and I can access my web apps URL, but I cannot access some elements of my web apps because some of them need database.
Before hosting it, I've test the web apps using
mySQL, and it works perfectly by using the ability from
Laravel5 to migrate the database to
My question is, how to configure the database in azure so it will work with our web apps? I've heard that some people telling about the .env file, but I don't know what to do with it to make the database works. Thanks.
ClearDB provides MySQL database Services in Azure, you can leverage it to create and host your MySQL database, then set the MySQL connection info in your laravel application configuration files.
You can follow the steps below to create a MySQL database on Azure:
- Login Azure Manage portal, click NEW button, write "Mysql" in search bar, select the "MySQL Database" service and click "create".
Fill the basic information of your MySQL database:
- In the manage page of your MySQL server, you can find all connection info in Properties section:
- Then you can set the connection info in your laravel app, at
'mysql' => array( 'driver' => 'mysql', 'host' => 'xx-xxxx-azure-xxxx-c.cloudapp.net', 'database' => '<your_database_name>', 'username' => '<your_user_name>', 'password' => '<your_password>', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', ),And the database setting should be modified in .env file as well.
Additionally, you can leverage your MySQL workbench to connect to MySQL database on Azure to manage your data.
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?