Moodle Office 365



-->

Microsoft 365 and Azure Active Directory Plugins for Moodle includes support for Microsoft 365 Education, Microsoft 365 Enterprise, Azure Active Directory and Microsoft School Data Sync This repo is where development on all Microsoft 365 and Azure Active Directory plugins for Moodle takes place. Apr 25, 2016 Office 365 Repository. The Office 365 repository allows users using the Office 365 integration plugins to connect to various file stores within Office 365, including their personal OneDrive for Business, as a Moodle repository. Downloading and linking files. When using a filepicker anywhere in Moodle, you'll see a list of repositories on the.

Moodle, a popular open-source Learning Management System (LMS), is now integrated with Microsoft Teams. This integration helps educators and teachers collaborate around Moodle courses, ask questions about grades and assignments, and stay updated with notifications directly within Teams.

To help IT admins easily set this integration up, we have updated our open-source Microsoft 365 Moodle Plugin with the following capabilities:

  • Auto-registration of your Moodle server with Azure Active Directory (Azure AD).
  • 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, please seeMicrosoft Teams and Moodle.

Microsoft Office 365 with Teams Moodle™ learning management system. Version 3.5 is required and version 3.8 is recommended to utilize all services offered.

Prerequisites

In order to install and configure this application you'll need:

  1. Moodle administrator credentials.

  2. Azure AD administrator credentials.

  3. An Azure subscription where you can create new resources.

Step 1: Install the Microsoft 365 Moodle Plugins

The Moodle integration in Microsoft Teams is powered by the open source Microsoft 365 Moodle plugin set. To install the plugin in your Moodle server you need to have the following installed:

  1. A current stable version of Moodle.

  2. The Moodle OpenID Connect and the Microsoft 365 Integration plugins downloaded and saved to your local computer.

Note

Installing the OpenID Connect and Microsoft 365 Integration plugins are required for the Teams integration. Additionally the Microsoft 365 Teams Theme plugin is highly recommended.

  1. Login to your Moodle server as an administrator and select Site administration from the Settings block located in the left navigation panel.

  2. Select the Plugins tab, and then choose Install plugins.

  3. Under the Install plugin from ZIP file section select the Choose a file button.

  4. Select the Upload a file options from the left navigation, browse for the file you downloaded above, and choose Upload this file.

  5. Select the Site administration option from the left navigation panel to return to your admin dashboard. Scroll down to the Local plugins and select the Microsoft 365 Integration link. Keep this configuration page open in a separate browser tab throughout the installation process.

You can find more information on how to install Moodle plugins in the Moodle documentation.

Important

  • Keep your Microsoft 365 Moodle Plugin configuration page open in a separate browser tab — you'll be returning to this set of pages throughout the process.
  • If you don't have an existing Moodle site, you can check out Moodle on Azure repo where you can quickly deploy a Moodle instance and customize it to your needs.

Step 2: Configure the connection between the Microsoft 365 plugin and Azure Active Directory (Azure AD)

Next, you'll need to register Moodle as an application in your Azure AD. We've provided a PowerShell script to help you complete this process. The PowerShell script provisions a new Azure AD application for your Microsoft 365 tenant, which will be used by the Microsoft 365 Moodle Plugin. The script will provision the app for your Microsoft 365 tenant, set up the required reply URLs and permissions for the provisioned app, and return the AppID and Key. You can use the generated AppID and Key in your Microsoft 365 Moodle Plugin setup page to configure your Moodle server site with Azure AD.

Important

Cached

The PowerShell script is not updated with the latest configuration items, so you'll have to complete the configuration manually following the steps outlined in the Moodle 3.8.0.4 and 3.9.1 and 3.8.0.5 and 3.9.2 release pages.
To view the manual steps that the PowerShell script is automating in detail , seeRegister your Moodle instance as an Application.

The Moodle tab for Microsoft Teams information flow

  1. From the Microsoft 365 Integration plugin page select the Setup tab.

  2. Select the Download PowerShell Script button and save it to your local computer.

  3. You'll need to prepare the PowerShell script from the ZIP file. To do so:

    • 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, check the Unblock box next to the Security attribute located at the bottom of the window.
    • Select OK.
    • Copy the directory path to the extracted folder.
  4. Next you'll run PowerShell as an administrator:

    • Select Start.
    • Type PowerShell.
    • Right-click Windows PowerShell.
    • Select 'Run as Administrator'.
  5. Navigate to the unzipped directory by typing cd ../../Moodle-AzureAD-Powershell where ../.. is the path to the directory.

  6. Execute the PowerShell script:

    • Enter Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser.
    • Enter ./Moodle-AzureAD-Script.ps1.
    • Login to your Microsoft 365 administrator account in the pop-up window.
    • Enter the name of the Azure AD Application (e.g., Moodle/Moodle plugin).
    • Enter the URL for your Moodle server.
    • Copy the Application ID and Application Key generated by the script and save them.
  7. Next you'll need to add the AppID and Key to the Microsoft 365 Moodle Plugin. Return to the plugin administration page (Site administration ➡ Plugins ➡ Microsoft 365 Integration).

  8. On the Setup tab add the Application ID and Application Key you copied previously, then select Save changes.

  9. Once the page refreshes you should see a new section Choose connection method. Select the checkbox labeled Default and then select Save changes again.

  10. Once the page refreshes you will see another new section Admin consent & additional information.

    • Select the Provide Admin Consent link, enter your Microsoft 365 Global Administrator credentials, then Accept to grant the permissions.
    • Next to the Azure AD Tenant field select the Detect button.
    • Next to the OneDrive for Business URL select the Detect button.
    • Once the fields populate, select the Save changes button again.
  11. Select the Update button to verify the installation, then Save changes.

  12. Next, you'll need to synchronize users between your Moodle server and Azure AD. Depending on your environment, you may select different options during this stage. To get started:

    • Switch to the Sync Settings tab

    • In the Sync users with Azure AD section, select the checkboxes that apply to your environment. Typically, you would, at a minimum, select the following:

      ✔ Create accounts in Moodle for users in Azure AD .✔ Update all accounts in Moodle for users in Azure AD.

    • In the User Creation Restriction section, you can setup a filter to limit the Azure AD users that will be synced to Moodle.

    • The User Field Mapping section will allow you to customize the Azure AD to Moodle User Profile field mapping.

    • In the Teams Sync section you can choose to automatically create Groups (i.e. teams) for some, or all, of your existing Moodle courses.

Note

The Moodle Cron will run according to the task schedule (once a day by default). However, the cron should run more frequently to keep everything in sync.

Office
  1. To validate cron jobs (and/or run them manually for the first run) select the Scheduled tasks management page link in the Sync users with Azure AD section. This will take you to the Scheduled Tasks page.

    • Scroll down and find the Sync users with Azure AD job and select Run now.
    • If you chose to create Groups based on existing courses, you can also run the Create user groups in Microsoft 365 job.
  2. Return to the plugin administration page (Site administration ➡ Plugins ➡ Microsoft 365 Integration) and select the Teams Settings page. You'll need to configure some settings to enable the Teams app integration.

    • To enable OpenID Connect, select the Manage Authentication link, and select the eye icon on the OpenId Connect line if it is greyed out.

    • Next, you'll need to enable frame embedding. Select the HTTP Security link, then select the checkbox next to Allow frame embedding.

    • The next step is to enable web services which will enable the Moodle API features. Select the Advanced Features link, then make sure the checkbox next to Enable web services is checked.

    • Finally, you'll need to enable the external services for Microsoft 365. Select the External services link then next: Restart openssh debian.

      ✔ Select Edit on the Moodle Microsoft 365 Webservices row.
      ✔ Mark the checkbox next to Enabled, then select Save Changes

    • Next, you'll need to edit your authenticated user permissions to allow them to create web service tokens. Select the Editing role 'Authenticated user' link. Scroll down and find the Create a web service token capability and mark the Allow checkbox.

Step 3: 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

In this section you'll deploy resources to your Azure subscription. All resources will be configured using the free tier. Depending on the usage of your bot, you may need to scale these resources.If you want to use the Moodle tab without the bot, skip to step 4.

Office

Moodle bot information flow

To install the bot, you'll first need to register it on the Microsoft Identity Platform. This allows your bot to authenticate against your Microsoft endpoints. To register your bot:

  1. Return to the plugin administration page (Site administration ➡ Plugins ➡ Microsoft 365 Integration) and select the Teams Settings tab.

  2. Select the Microsoft Application Registration Portal link and login with your Microsoft ID.

  3. Enter a name for your app (e.g., MoodleBot) and select the Create button.

  4. Copy the Application ID and paste it into the Bot Application ID field on the Team Settings page.

  5. Select the Generate New Password button. Copy the generated password and and paste it into the Bot Application Password field on the Team Settings page.

  6. Scroll to the bottom of the form and select Save Changes.

Now that you've generated your Application ID and Password, it's time to deploy your bot to Azure:

  • Select the Deploy to Azure button and complete the form with the necessary information (the Bot Application ID, Bot Application Password and the Moodle Secret are on the Team Settings page. The Azure information is on the Setup page).
  • Once you have the form completed, select the check box to agree to the terms and conditions.
  • Select the Purchase button (all Azure resources are deployed to the free tier).

Once the resources have completed deploying to Azure, you'll need to configure the Microsoft 365 Moodle plugin with a messaging endpoint. You'll need to get the endpoint from your bot in Azure:

  1. Log into the Azure portal.

  2. In the left pane select Resource groups and choose the resource group you used (or created) while deploying your bot.

  3. Select the WebApp Bot resource from the list of resources in the group.

  4. Copy the Messaging Endpoint from the Overview section.

  5. In Moodle, open the Team Settings page of your Microsoft 365 Moodle Plugin.

  6. In the Bot Endpoint field paste the URL you just copied and change the word messages to webhook. The URL should now appear as follows: https://botname.azurewebsites.net/api/webhook

  7. Select Save Changes.

  8. Once your changes have been saved, go back to the Team Settings tab, select the Download manifest file button, and save the app manifest package to your computer (you'll use it in the next section).

Step 4: Deploy your Microsoft Teams app

Moodle Office 365

Now that you have your bot deployed to Azure and configured to talk to your Moodle server, it's time to deploy your Microsoft Teams app. To do this you'll load the app manifest file that you downloaded from the Microsoft 365 Moodle Plugin Team Settings page in the previous step.

Before you can install the app you'll need to make sure external apps and uploading of apps is enabled. To do so, you can follow the steps in the Teams Prepare your Microsoft 365 tenant documentation. Once you've ensured that external apps are enabled, you can follow the steps below to deploy your app:

  1. Open Microsoft Teams.

  2. Select the App icon on the lower-left area of the navigation bar.

  3. Select the Upload a custom app link from the list of options.

Moodle Office 365

Note

If you're logged in as a global administrator you'll have the option of uploading the app to your organization's app catalog, otherwise you'll only be able to load the app for a team in which you are a member.

  1. Select the manifest.zip package you downloaded previously and select Save. If you haven't downloaded the app manifest package, you can do so from the Team Settings tab of the plugin 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, navigate 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.

Step 5: Allow automatic creation of Moodle tabs in Microsoft Teams

Although the Moodle tabs can be created manually in Microsoft Teams, you may decide to have them automatically created when teams are created from course synchronization. To do this, you'll configure the ID of the uploaded Microsoft Teams app in Moodle:

  1. Open Microsoft Teams.

  2. Select the Apps icon from the lower-left area of the navigation bar.

  3. Locate the uploaded Moodle app ➡ select the options icon ➡ select copy link.

  4. In a text editor, paste the copied content. It should contain a URL such as ht​tps://teams.microsoft.com/l/app/00112233-4455-6677-8899-aabbccddeeff. Copy the last part of the URL, e.g. 00112233-4455-6677-8899-aabbccddeeff, which is the ID of the Microsoft Teams app.

  5. In Moodle, open the Teams Moodle app tab from your Microsoft 365 Moodle Plugin configuration page.

  6. Paste the ID of the Microsoft Teams app into the Moodle app ID field, and save changes.

Now when a Moodle course is synced, Microsoft Teams will automatically install the Moodle app in the team, create a Moodle tab in the General channel of Teams, and configure it to contain the course page for the Moodle course from which it is synced.

That's it! You and your team, can now start working with your Moodle courses directly from Microsoft Teams.

To share any feature requests or feedback with us, please visit our User Voice page.

Maynooth Moodle Office 365

-->

Moodle, the most popular and open-source Learning Management System (LMS) in the world, is now integrated with Microsoft Teams! This integration helps educators and teachers collaborate around Moodle courses, ask questions about their grades and assignments and stay updated with notifications -- right within Teams!

To help IT admins easily set this integration up, we have updated our open-source Moodle Plugin with the following capabilities:

  • Auto-registration of your Moodle server with Azure AD.
  • 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. (Coming soon)
  • One-click publishing of the Moodle app into your private Teams App Store. (Coming soon)

To learn more about the functionality this integration provides, see Installing the Moodle integration with Microsoft Teams.

Prerequisites

In order to install and configure this application you'll need:

  1. Moodle administrator credentials
  2. Azure AD administrator credentials
  3. An Azure subscription you can create new resources in

Step 1: Install the Moodle Plugin

The Moodle integration in Microsoft Teams is powered by the open source Moodle plugin set. To install the plugin in your Moodle server:

  1. First, download the Moodle plugin set and save it to your local computer. You'll need to use version 3.5 or newer.
    • Installing the local_o365 plugin will also install the auth_oidc and boost_o365Teams plugins.
  2. Sign in to your Moodle server as an administrator, and select Site administration from the left navigation panel.
  3. Select the Plugins tab, and then click Install plugins.
  4. Under the Install plugin from ZIP file section click the Choose a file button.
  5. Select the Upload a file option from the left navigation, browse for the file you downloaded above and click Upload this file.
  6. Select the Site administration option from the left navigation panel again to return to your admin dashboard. Scroll down to the Local plugins and click the Microsoft Office 365 Integration link. Keep this configuration page open in a separate browser tab as you'll be using it throughout the rest of this process.

You can find more information on how to install Moodle plugins in the Moodle documentation.

Important Note: Keep your Microsoft 365 or Office 365 Moodle Plugin configuration page open in a separate browser tab as you will be returning to this set of pages throughout this process.

Don't have a Moodle site already? You might want to check out our Moodle on Azure repo where you can quickly deploy a Moodle instance on Azure and customize it to your needs.

Step 2: Configure the connection between the Microsoft 365 or Office 365 plugin and Azure Active Directory

Next you'll need to register Moodle as an application in your Azure Active Directory. We've provided a PowerShell script to help you complete this process. The PowerShell Script provisions a new Azure AD application for your Microsoft 365 or Office 365 organization, which will be used by the Moodle Plugin. The script will provision the app for your Microsoft 365 or Office 365 tenant, set up all the required Reply URLs and Permissions for the provisioned app and return the AppID and Key. You can use the generated AppID and Key in your Moodle Plugin Setup Page to configure your Moodle server with Azure AD. If you want to see the detailed manual steps that the PowerShell script is automating, you can find them in the full documentation for the plugin.

Moodle tab for Microsoft Teams information flow

  1. From the Microsoft 365 or Office 365 Integration plugin page, select the Setup tab.
  2. Click the Download PowerShell Script button and save it to your local computer.
  3. You'll need to prepare the PowerShell script from the ZIP file. To do so:
    • 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, check the Unblock box next to the Security attribute at the bottom.
    • Click OK.
    • Copy the directory path of the extracted folder.
  4. Next you'll run PowerShell as an administrator:
    • Click Start.
    • Type PowerShell.
    • Right-click Windows PowerShell.
    • Click 'Run as Administrator'.
  5. Navigate to the unzipped directory by typing cd ...Moodle-AzureAD-Powershell where ... is the path to the directory.
  6. Execute the PowerShell script by:
    • Enter Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser.
    • Enter .Moodle-AzureAD-Script.ps1.
    • Log in to your Microsoft 365 or Office 365 Administrator account in the pop-up window.
    • Enter the name of the Azure AD Application (Ex. Moodle/Moodle plugin).
    • Enter the URL of your Moodle server.
    • Copy the Application ID and Application Key generated by the script and save them.
  7. Next you'll need to add the Id and Key to the Moodle Plugin. Return to the plugin administration page (Site administration > Plugins > Microsoft 365 Integration).
  8. On the Setup tab add the Application Id and Application Key you copied previously, then click Save changes.
  9. Once the page refreshes you should now see a new section Choose connection method. Click the checkbox labeled Default and then click Save changes again.
  10. Once the page refreshes you will see another new section Admin consent & additional information.
    • Click the Provide Admin Consent link, enter your Microsoft 365 or Office 365 Global Administrator credentials, then Accept to grant the permissions.
    • Next to the Azure AD Tenant field click the Detect button.
    • Next to the OneDrive for Business URL click the Detect button.
    • Once the fields populate, click the Save changes button again.
  11. Click the Update button to verify the installation, then Save changes.
  12. Next you'll need to synchronize users between your Moodle server and Azure Active Directory. Depending on your environment, you may select different options during this stage. Note that the configuration you set here will run with each Moodle cron run (typically once a day) to keep everything in sync. To get started:
    • Switch to the Sync Settings tab
    • In the Sync users with Azure AD section, select the checkboxes that apply to your environment. Typically you would select at least:
      • Create accounts in Moodle for users in Azure AD
      • Update all accounts in Moodle for users in Azure AD
    • In the User Creation Restriction section you can set up a filter to limit the Azure AD users that will be synced to Moodle.
    • The User Field Mapping section will allow you to customize the Azure AD to Moodle User Profile field mapping.
    • In the Teams Sync section you can choose to automatically create Groups (i.e. Teams) for some, or all, of your existing Moodle courses.
  13. To validate the cron jobs (and run them manually if you wish to for the first run) click the Scheduled tasks management page link in the Sync users with Azure AD section. This will take you to the Scheduled Tasks page.
    • Scroll down and find the job Sync users with Azure AD job and click Run now.
    • If you chose to create Groups based on existing courses, you can also run the Create user groups in Office 365 job.
  14. Return to the plugin administration page (Site administration > Plugins > Microsoft 365 Integration) and select the Teams Settings page. You'll need to configure some security settings to enable the Teams app integration.
    • To enable OpenID Connect, click the Manage Authentication link, and click the eye icon on the OpenId Connect line if it is greyed out.
    • Next you'll need to enable frame embedding. Click the HTTP Security link, then click the checkbox next to Allow frame embedding.
    • The next step is to enable web services which will enable the Moodle API features. Click the Advanced Features link, then make sure the checkbox next to Enable web services is checked.
    • Finally you'll need to enable the external services for Microsoft 365 or Office 365. Click the External services link then:
      • Click Edit on the Moodle Office 365 Webservices row.
      • Mark the checkbox next to Enabled, then click Save Changes
    • Next you'll need to edit your authenticated user permissions to allow them to create web service tokens. Click the Editing role 'Authenticated user' link. Scroll down and find the Create a web service token capability and mark the Allow checkbox.

Step 3: 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 right within Teams. This bot is an open source project maintained by Microsoft, and is available on GitHub.

Note

In this section you will deploy resources to your Azure subscription, and all resources will be configured using the free tier. Depending on the usage of your bot, you may need to scale these resources.If you want to just use the Moodle tab without the bot, skip to step 4.

Moodle bot information flow

Moodle Office 365 Integration Step By Step

To install the bot, you'll first need to register it on the Microsoft Identity Platform. This allows your Bot to authenticate against your Microsoft endpoints. To register your bot:

  1. Return to the plugin administration page (Site administration > Plugins > Microsoft 365 Integration) and select the Teams Settings tab.
  2. Click the Microsoft Application Registration Portal link and login with your Microsoft Id.
  3. Enter a name for your app (Eg. MoodleBot) and click the Create button.
  4. Copy the Application Id and paste it into the Bot Application ID field on the Team Settings page.
  5. Click the Generate New Password button. Copy the generated password and paste it into the Bot Application Password field on the Team Settings page.
  6. Scroll to the bottom of the form and click Save Changes.

Now that you've generated your Application Id and Password, it's time to deploy your bot to Azure. Click on the Deploy to Azure button and fill out the form with the necessary information (the Bot Application Id, Bot Application Password and the Moodle Secret are on the Team Settings page, and the Azure information is on the Setup page). Once you've got the form filled out, click the check box to agree to the terms and conditions then click the Purchase button (all Azure resources are deployed to the free tier).

Once the resources are finished deploying to Azure, you'll need to configure the Moodle plugin with its messaging endpoint. Get notifications from these senders missing. First, you'll need to get the endpoint from your Bot in Azure. To do that:

  1. If you aren't already, log into the Azure portal.
  2. In the left pane select Resource groups.
  3. From the list select the resource group you just used (or created) while deploying your Bot.
  4. Select the WebApp Bot resource from the list of resources in the group.
  5. Copy the Messaging Endpoint from the Overview section.
  6. In Moodle, open the Team Settings page of your Moodle Plugin.
  7. In the Bot Endpoint field paste the URL you just copied and change the word messages to webhook. The URL should now look like https://botname.azurewebsites.net/api/webhook
  8. Click Save Changes
  9. Once your changes have saved, go back to the Team Settings tab, click the Download manifest file button and save the manifest package to your computer (you'll use it in the next section).

Moodle Office 365 Web Services

Step 4: Deploy your Microsoft Teams app

Now that you have your Bot deployed to Azure and configured to talk to your Moodle server, it's time to deploy your Microsoft Teams app. To do this you'll load the manifest file you downloaded from the Moodle Plugin Team Settings page in the previous step.

Before you can install the app you'll need to make sure external apps and sideloading of apps is enabled. To do so you can follow these steps. Once you've ensured that external apps are enabled, you can follow the steps below to deploy your app.

  1. Open Microsoft Teams.
  2. Click the Store icon on the lower left of the navigation bar.
  3. Click the Upload a custom app link from the list of options. Note: If you're logged in as a global administer you'll have the option of uploading the app to your organization's app store, otherwise you'll only be able to load the app for Teams you're a part of ('sideloading').
  4. Select the manifest.zip package you downloaded previously and click Save. If you haven't yet downloaded the manifest package, you can do so from the Team Settings tab of the plugin 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 navigate to the channel, click the + symbol and select your app from the list. Follow the prompts to finish adding your Moodle course tab to a channel.

That's it! You and your team, can now start working with your Moodle courses directly from Microsoft Teams.

To share any feature requests or feedback with us, please visit our User Voice page.

Note

Moodle Office 365 Integration

Microsoft will be moving from UserVoice to our own customer feedback solution on a product-by-product basis during 2021. Learn more.