Setting up Azure SQL database for external authentication

Re: Setting up Azure SQL database for external authentication

by Leon Stringer -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers

Moodle's external database authentication relies on PHP having a supported extension for that database, and Moodle then supporting this extension. Is the Azure database a type of SQL Server instance? If so PHP on the Moodle server would need the sqlsrv extension which is available from Microsoft.

You'd need network connectivity from the Moodle server to the database server.

You'd need a single table returning all the information you need for the users in Moodle: at least username and password, and optionally first name, last name, email, etc. If the Azure database doesn't have such a table use a database view to emulate this.

Passwords can be either 1) stored in the external database using one of the supported encryption types, 2) stored in the external database unencrypted (not a good idea), or 3) stored in Moodle only and just use the external database for the user profile fields. You'll need to factor in any other requirements for these passwords, e.g. if there is another system you also want to authenticate with the Azure database then both this system and Moodle would have to understand the password format.