You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 4, 2023. It is now read-only.
1) Create [Bot Framework registration resource](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-registration) in Azure
32
+
- Use the current `https` URL you were given by running ngrok. Append with the path `/api/messages` used by this sample
33
+
- Ensure that you've [enabled the Teams Channel](https://docs.microsoft.com/en-us/azure/bot-service/channel-connect-teams?view=azure-bot-service-4.0)
34
+
- __*If you don't have an Azure account*__ you can use this [Bot Framework registration](https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/create-a-bot-for-teams#register-your-web-service-with-the-bot-framework)
35
+
36
+
1) Update the `resources/application.properties` configuration forthe bot to use the Microsoft App Id and App Password from the Bot Framework registration. (Note the App Password is referred to as the "client secret"in the azure portal and you can always create a new client secret anytime.)
37
+
38
+
1) __*This step is specific to Teams.*__
39
+
- **Edit** the `manifest.json` contained in the `teamsAppManifest` folder to replace your Microsoft App Id (that was created when you registered your bot earlier) *everywhere* you see the place holder string `<<YOUR-MICROSOFT-APP-ID>>` (depending on the scenario the Microsoft App Id may occur multiple times in the `manifest.json`)
40
+
- **Zip** up the contents of the `teamsAppManifest` folder to create a `manifest.zip`
41
+
- **Upload** the `manifest.zip` to Teams (in the Apps view click "Upload a custom app")
42
+
43
+
1) From the root of this project folder:
44
+
- Build the sample using `mvn package`
45
+
- Unless done previously, install the packages in the local cache by using `mvn install`
46
+
- Run it by using `java -jar .\target\bot-teams-file-upload-sample.jar`
47
+
48
+
49
+
## Interacting with the bot in Teams
50
+
51
+
> Note this `manifest.json` specified that the bot will be installed in "personal" scope which is why you immediately entered a one on one chat conversation with the bot. Please refer to Teams documentation for more details.
52
+
53
+
Sending a message to the bot will cause it to respond with a card that will prompt you to upload a file. The file that's being uploaded is the `teams-logo.png` in the `Files` directory in this sample. The `Accept` and `Decline` events illustrated in this sample are specific to Teams. You can message the bot again to receive another prompt.
54
+
55
+
You can also send a file to the bot as an attachment in the message compose section in Teams. This will be delivered to the bot as a Message Activity and the code in this sample fetches and saves the file.
56
+
57
+
## Deploy the bot to Azure
58
+
59
+
To learn more about deploying a bot to Azure, see [Deploy your bot to Azure](https://aka.ms/azuredeployment) for a complete list of deployment instructions.
60
+
61
+
## Further reading
62
+
63
+
- [How Microsoft Teams bots work](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-basics-teams?view=azure-bot-service-4.0&tabs=javascript)
0 commit comments