page_type | description | products | languages | extensions | urlFragment | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sample |
This sample app demonstrates bulk meeting creation on Teams calendars using an Excel upload. |
|
|
|
officedev-microsoft-teams-samples-graph-bulk-meetings-csharp |
This sample application allows users to efficiently create multiple meetings in Microsoft Teams calendars by uploading an Excel sheet. It utilizes the Graph API, provides a user-friendly tab interface for interaction, and includes comprehensive setup instructions for Microsoft Entra ID app registration and bot configuration.
- Tabs
- Graph API
- 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.
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.
-
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
-
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.
-
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
-
Clone the repository
git clone https://github.com/OfficeDev/Microsoft-Teams-Samples.git
-
Launch Visual Studio
- File -> Open -> Project/Solution
- Navigate to folder where repository is cloned and then open this file
samples/EventMeeting/csharp/EventMeeting.sln
-
Setup and run the bot from Visual Studio: Modify the
appsettings.json
file with the following details:- Update configuration with the
MicrosoftAppId
,MicrosoftAppPassword
andMicrosoftAppTenantId
values received while doing Microsoft Entra ID app registration in your Azure portal. - Press
F5
to run the project
- Update configuration with the
-
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 behttps://1234.ngrok-free.app
then your domain-name will be1234.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 amanifest.zip
- Upload the
manifest.zip
to Teams (in the Apps view click "Upload a custom app")
To learn more about deploying a bot to Azure, see Deploy your bot to Azure for a complete list of deployment instructions.