Install Moodle LMS
In this article, you'll learn how to install the Moodle LMS.
Note
To help IT admins to easily set up Moodle and Teams integration, open-source Microsoft 365 Moodle Plugins is updated for the following:
Auto-registration of your Moodle server with Microsoft Entra ID.
One-click deployment of your Moodle Assistant bot to Azure.
Auto-provisioning of teams and auto-synchronization of team enrollments for all or select Moodle courses.
Auto-installation of the Moodle tab and the Moodle assistant bot into each synchronized team.
To learn more about the functionality this integration provides, see Microsoft Teams and Moodle.
Prerequisites
Following are the prerequisites to install Moodle:
Moodle administrator credentials.
Microsoft Entra administrator credentials.
An Azure subscription where you can create new resources.
Install the Microsoft 365 Moodle Plugins
Moodle integration in Microsoft Teams is powered by the open-source Microsoft 365 Moodle plugins set.
Requisite applications and plugins
Ensure to install and download the following before proceeding with the Microsoft 365 Moodle plugins installation:
Ensure to install a current stable version of Moodle.
Download and save the Moodle OpenID Connect and the Microsoft 365 Integration plugins to your local computer.
Note
Installing the OpenID Connect and Microsoft 365 Integration plugins are required for the Teams integration.
In addition, the Microsoft 365 Teams Theme plugin is highly recommended.
Microsoft 365 Moodle plugins
Download the plugins, extract them, and upload to their corresponding folders. For example, extract the OpenID Connect plugin (auth_oidc) to a folder called oidc, and upload to the auth folder of your Moodle document root.
Sign in to your Moodle server as an administrator and select Site administration.
After the detection of new plugins to be installed, Moodle should redirect you to the install new plugins page. If this doesn't happen, in the Site administration page, select Notifications in the General tab, this should trigger the installation of the plugins.
After the plugins are install, go to the Plugins tab in the Site administrator page, select Authentication section link, and enable OpenID Connect. It's OK to leave the plugin configuration blank - they'll be filled in later.
In the Site administrator page, scroll down to the Local plugins section and select the Microsoft 365 Integration link.
Important
Keep your Microsoft 365 Moodle Plugins configuration page open in a separate browser tab as you need to return to this set of pages throughout the process.
If you do not have an existing Moodle site, go to the Moodle on Azure repo, and quickly deploy a Moodle instance and customize it to your needs.
Configure the connection between the Microsoft 365 plugins and Microsoft Entra ID
You must configure the connection between the Microsoft 365 plugins and Microsoft Entra ID.
Requisites
Register Moodle as an application in your Microsoft Entra ID, using the PowerShell script. The script provisions the following:
- A new Microsoft Entra application for your Microsoft 365 tenant, which is used by the Microsoft 365 Moodle Plugins.
- The app for your Microsoft 365 tenant, set up the required reply URLs and permissions for the provisioned app, and returns the
AppID
andKey
.
Use the generated AppID
and Key
in your Microsoft 365 Moodle Plugins setup page to configure your Moodle server site with Microsoft Entra ID.
Important
- For more information on registering your Moodle instance manually, see Register your Moodle instance as an application.
The Moodle tab for Microsoft Teams information flow
From the Microsoft 365 Integration plugins page, select the Setup tab.
Select the Download PowerShell Script button and save it as a ZIP folder to your local computer.
Prepare the PowerShell script from the ZIP file as follows:
Download and extract the
Moodle-AzureAD-Powershell.zip
file.Open the extracted folder.
Right-click on the
Moodle-AzureAD-Script.ps1
file and select Properties.Under the General tab of the Properties window, select the
Unblock
checkbox next to the Security attribute located at the bottom of the window.Select OK.
Copy the directory path to the extracted folder.
Run PowerShell as an administrator:
Select Start.
Type PowerShell.
Right-click on Windows PowerShell.
Select Run as Administrator.
Go to the unzipped directory by typing
cd .../.../Moodle-AzureAD-Powershell
where.../...
is the path to the directory.Execute the PowerShell script:
Enter
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
.Enter
./Moodle-AzureAD-Script.ps1
.Sign in to your Microsoft 365 administrator account in the pop-up window.
Enter the name of the Microsoft Entra Application, for example, Moodle or Moodle plugins.
Enter the URL for your Moodle server.
Copy the Application ID (
AppID
) and Application Key (Key
) generated by the script and save them.
Next you must add the
AppID
andKey
to the Microsoft 365 Moodle Plugins. Return to the plugins administration page, Site administration > Plugins > Microsoft 365 Integration.On the Setup tab, add the
AppID
andKey
you copied previously, and then select Save changes. After the page refreshes, you can see a new section Choose connection method.In the Choose connection method, select the checkbox labeled Default, and then select Save changes again.
After the page refreshes you can see another new section Admin consent & additional information.
Select Provide Admin Consent link, enter your Microsoft 365 Global Administrator credentials, then Accept to grant the permissions.
Next to the Microsoft Entra tenant field, select the Detect button.
Next to the OneDrive for Business URL, select the Detect button.
After the fields populate, select the Save changes button again.
Select the Update button to verify the installation, and then select Save changes.
Synchronize users between your Moodle server and Microsoft Entra ID. To get started:
Note
Depending on your environment, you can select different options during this stage.
Switch to the Sync Settings tab.
In the Sync users with Microsoft Entra ID section, select the checkboxes that apply to your environment. You must select the following:
✔ Create accounts in Moodle for users in Microsoft Entra ID.
✔ Update all accounts in Moodle for users in Microsoft Entra ID.
In the User Creation Restriction section, you can set up a filter to limit the Microsoft Entra users that is synced to Moodle.
To validate cron jobs and run them manually for the first run, select the Scheduled tasks management page link in the Sync users with Microsoft Entra ID section. This takes you to the Scheduled Tasks page.
Scroll down and find the Sync users with Microsoft Entra ID job and select Run now.
If you select to create Groups based on existing courses, you can also run the Create user groups in Microsoft 365 job.
Note
The Moodle Cron runs according to the task schedule. The default schedule is once a day. However, the cron must run more frequently to keep everything in sync.
Return to the plugins administration page, Site administration > Plugins > Microsoft 365 Integration, and select the Teams Settings page.
On the Teams Settings page, configure the required settings to enable the Teams app integration. Click the Check Moodle settings link to update all required configurations for the Teams integration to work.
Deploy the Moodle Assistant Bot to Azure
The free Moodle assistant bot for Microsoft Teams helps teachers and students answer questions about their courses, assignments, grades, and other information in Moodle. The bot also sends Moodle notifications to students and teachers within Teams. The bot is an open-source project maintained by Microsoft, and is available on GitHub.
Note
Deploy resources to your Azure subscription. All resources were configured using the free tier. Depending on the usage of your bot, you may have to scale these resources.
To use the Moodle tab without the bot, skip to Deploy your Microsoft Teams app.
Moodle bot information flow
To install the bot, you must register it on the Microsoft identity platform. This allows your bot to authenticate against your Microsoft endpoints.
To register your bot:
Go to the plugins administration page, and then select Plugins. Under Microsoft 365 Integration, select the Teams Settings tab.
Select the Microsoft Application Registration Portal link and sign in with your Microsoft ID.
Enter a name for your app, such as MoodleBot and select the Create button.
Copy the Application ID and paste it into the Bot Application ID field on the Team Settings page.
Select the Generate New Password button. Copy the generated password and paste it into the Bot Application Password field on the Team Settings page.
Scroll to the bottom of the form and select Save Changes.
After generating your application ID and password, deploy your bot to Azure:
Select Deploy to Azure and complete the form with the necessary information, such as the Bot Application ID, Bot Application Password, and the Moodle Secret on the Teams Settings page. The Azure information is on the Setup page.
After completing the form, select the checkbox to agree to the terms and conditions.
Select Purchase. All Azure resources are deployed to the free tier.
After the resources have completed deploying to Azure, you must configure the Microsoft 365 Moodle plugins with a messaging endpoint. You must get the endpoint from your bot in Azure:
Sign in to the Microsoft Azure portal.
In the left pane, select Resource groups and select the resource group you used or created, while deploying your bot.
Select the WebApp Bot resource from the list of resources in the group.
Copy the Messaging Endpoint from the Overview section.
In Moodle, open the Team Settings page of your Microsoft 365 Moodle Plugins.
In the Bot Endpoint field paste the URL you copied and change the word messages to webhook. The URL must appear as follows:
https://botname.azurewebsites.net/api/webhook
Select Save Changes.
After saving the changes, go back to the Team Settings tab, select the Download manifest file button, and save the app manifest package to your computer for further use.
Deploy your Microsoft Teams app
After your bot is deployed to Azure and configured to talk to your Moodle server, you must deploy your Microsoft Teams app. To do this you must load the app manifest file that you downloaded from the Microsoft 365 Moodle Plugins Team Settings page in the previous step.
Before you install the app, you must ensure to enable external apps and uploading of apps. For more information, see Prepare your Microsoft 365 tenant.
To deploy your app:
Open Microsoft Teams.
Select the Apps icon on the lower-left area of the navigation bar.
Select the Manage your apps link in the navigation menu.
Select Upload an app and select Upload an app to your org's app catalog.
Note
If you are logged in as a global administrator, you must have the option of uploading the app to your organization's app catalog, otherwise you can only load the app for a team in which you are a member.
Select the
manifest.zip
package you downloaded previously and select Save. If you haven't downloaded the app manifest package, you can download from the Team Settings tab of the plugins configuration page in Moodle.
Now that you have the app installed, you can add the tab to any channel that you have access to. To do so, go to the channel, select the plus (➕) symbol and select your app from the list. Follow the prompts to finish adding your Moodle course tab to a channel.
Allow automatic creation of Moodle tabs in Microsoft Teams
Although the Moodle tabs are created manually in Microsoft Teams, you can decide to create them automatically when teams are created from course synchronization. To do this, you must configure the ID of the uploaded Microsoft Teams app in Moodle.
To allow automatic creation of Moodle tabs:
In Moodle, open the Teams Moodle app tab from your Microsoft 365 Moodle Plugins configuration page.
If the Azure app has the recommended permission, for the Moodle app ID setting, it should show an Automatically detected value, copy this value to the setting.
If the automatically detected value doesn't present, follow the instruction on the page to find the Moodle app ID and fill in the setting.
When a Moodle course is synced, Teams automatically installs the Moodle app in the team, creates a Moodle tab in the General channel of Teams, and configures it to contain the course page for the Moodle course from which it's synced. You can now start working with your Moodle courses directly from Teams.
Note
To share any feature requests or feedback with us, visit our User Voice page.
See also
Platform Docs