Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
page_type description products languages extensions urlFragment
sample
This is a sample application which demonstrates how to create meeting in bulk on Teams calendar through teams tab.
office-teams
office
office-365
csharp
contentType createdDate
samples
09/13/2022 12:00:00 AM
officedev-microsoft-teams-samples-graph-bulk-meetings-csharp

Graph bulk meetings

This is a sample application which demonstrates how to create meeting in bulk on Teams calendar use to create meeting to upload excel sheet.

Included Features

  • Tabs
  • Graph API

Interact with app

Meeting Event

Prerequisites

  • Microsoft Teams is installed and you have an account (not a guest account)
  • .NET 6.0 SDK.
        # determine dotnet version
        dotnet --version```
    
  • dev tunnel or ngrok latest version or equivalent tunneling solution
  • M365 developer account or access to a Teams account with the appropriate permissions to install an app.

Setup

Note these instructions are for running the sample on your local machine, the tunnelling solution is required because the Teams service needs to call into the bot.

  1. Run ngrok - point to port 3978

    ngrok http 3978 --host-header="localhost:3978"

    Alternatively, you can also use the dev tunnels. Please follow Create and host a dev tunnel and host the tunnel with anonymous user access command as shown below:

    devtunnel host -p 3978 --allow-anonymous

Ngrok

  1. Setup for Microsoft Entra ID app registration In Azure portal, create a Microsoft Entra ID app registration - Navigate to API Permissions, and make sure to add the below permissions: - Select Add a permission, select Microsoft Graph -> Application permissions. - Calendars.ReadWrite - Calendars.Read

     - Click on Add permissions. Please make sure to grant the admin consent for the required permissions.
    

    Navigate to the Certificates & secrets. In the Client secrets section, click on "+ New client secret". Add a description (Name of the secret) for the secret and select “Never” for Expires. Click "Add". Once the client secret is created, copy its value, it need to be placed in the appsettings.json file.

  2. Setup for Bot In Azure portal, create a Azure Bot resource.

    • For bot handle, make up a name.
    • Select "Use existing app registration" (Create the app registration in Microsoft Entra ID beforehand.)
    • If you don't have an Azure account create an Azure free account here

    In the new Azure Bot resource in the Portal,

    • Ensure that you've enabled the Teams Channel
    • In Settings/Configuration/Messaging endpoint, enter the current https URL you were given by running the tunnelling application. Append with the path /api/messages
  3. Clone the repository

    git clone https://github.com/OfficeDev/Microsoft-Teams-Samples.git
  4. Launch Visual Studio

    • File -> Open -> Project/Solution
    • Navigate to folder where repository is cloned and then open this file samples/EventMeeting/csharp/EventMeeting.sln
  5. Setup and run the bot from Visual Studio: Modify the appsettings.json file with the following details:

    • Update configuration with the MicrosoftAppId, MicrosoftAppPassword and MicrosoftAppTenantId values received while doing Microsoft Entra ID app registration in your Azure portal.
    • Press F5 to run the project
  6. Modify the manifest.json in the /AppManifest folder Replace the following details:

    • <<Your Microsoft App Id>> with your MicrosoftAppId received after doing Microsoft Entra ID app registration in your Azure portal.
    • {{BASE-URL}} with base Url domain. E.g. if you are using ngrok it would be https://1234.ngrok-free.app then your domain-name will be 1234.ngrok-free.app and if you are using dev tunnels then your domain will be like: 12345.devtunnels.ms.
    • Zip up the contents of the AppManifest folder to create a manifest.zip
    • Upload the manifest.zip to Teams (in the Apps view click "Upload a custom app")

Running the sample

  1. Imported Meetings view from the excel sheet. Meeting Event

  2. Dashborad of the Meetings Here is the all created meetings list. Meeting Event

  3. Created Meeting view in teams. Meeting Event

Deploy the bot to Azure

To learn more about deploying a bot to Azure, see Deploy your bot to Azure for a complete list of deployment instructions.

Further reading