Customizing Your Dashboard
April 2, 2019
Writing a Basic Plugin
April 12, 2019
Customizing Your Dashboard
April 2, 2019
Writing a Basic Plugin
April 12, 2019

Connecting to Azure

Much appreciation to user stonez56 for this guide!

During install

Your credentials will look different than a typical mysql install.  Use your full hostname and username. Hostname will look like yoursystem.mysql.database.azure.com.  Username will look like mysqladm@yoursystem.

Download Certificate

You will need the certificate from <a href="https://www.digicert.com/CACerts/BaltimoreCyberTrustRoot.crt.pem" target="_blank" rel="noopener" class="mycode_url">CA certifications here</a> and it will need to be stored somewhere on your website's root.  Remember this path

Modify users/classes/DB.php

This is one of the few times that we will tell you to modify a file in users/*.  In fact, you will have to keep an eye out in case we update DB.php to make sure to copy your modification to the file.

Add these two lines to the construct function

   PDO::MYSQL_ATTR_SSL_CA => "d:\home\site\wwwroot\BaltimoreCyberTrustRoot.crt.pem",  //replace with your path
    PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false

It will look like this…

class DB {
    private static $_instance = null;
    private $_pdo, $_query, $_error = false, $_errorInfo, $_results=[], $_resultsArray=[], $_count = 0, $_lastId, $_queryCount=0;

    private function __construct($config = []){
        if (!$opts = Config::get('mysql/options'))
            $opts = array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET SESSION sql_mode = ''",

            PDO::MYSQL_ATTR_SSL_CA => "d:\home\site\wwwroot\BaltimoreCyberTrustRoot.crt.pem",
            PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false