-
Notifications
You must be signed in to change notification settings - Fork 852
Python Migration - Bot Request Approval #1694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Python Migration - Bot Request Approval #1694
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new Python implementation of the “Bot Request Approval” Teams sample, including code, infrastructure, configuration, and dev tooling, and corrects a path in the existing Node.js README.
- Introduces Python bot logic (teamsBot, app, config), dependencies, and manifest.
- Adds infrastructure templates (Bicep, parameters), Teams Toolkit YAML, and VS Code tasks/settings.
- Fixes a directory path typo in the Node.js sample README.
Reviewed Changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
samples/bot-request-approval/python/server/bots/teamsBot.py | Python TeamsBot class for handling activities |
samples/bot-request-approval/python/app.py | Aiohttp server setup and BotFramework integration |
samples/bot-request-approval/python/config.py | Environment-based bot configuration |
samples/bot-request-approval/python/requirements.txt | Added Python package requirements |
samples/bot-request-approval/python/m365agents.yml | Toolkit provisioning pipeline metadata |
samples/bot-request-approval/python/m365agents.local.yml | Local dev provisioning and deployment actions |
samples/bot-request-approval/python/infra/azure.bicep | Azure BotService and Teams channel resources |
samples/bot-request-approval/python/infra/azure.parameters.json | Parameters for ARM/Bicep deployment |
samples/bot-request-approval/python/assets/sample.json | Sample catalog entry with metadata |
samples/bot-request-approval/python/appManifest/manifest.json | Teams app manifest for Python sample |
samples/bot-request-approval/python/README.md | Documentation for Python sample setup and usage |
samples/bot-request-approval/python/.vscode/* | VS Code debug and task configurations |
samples/bot-request-approval/python/.gitignore | Updated ignore rules for Python sample |
samples/bot-request-approval/nodejs/Readme.md | Corrected path to samples/bot-request-approval/nodejs |
Comments suppressed due to low confidence (5)
samples/bot-request-approval/python/assets/sample.json:27
- The metadata
TEAMS-SERVER-PLATFORM
is set to "express", but this is a Python sample. Please update it to reflect the correct platform (e.g., "python" or remove it).
"value": "express"
samples/bot-request-approval/python/README.md:19
- The README mentions ".NET Core" but this is a Python sample. Please update the description to reference Python and the appropriate runtime (e.g., Aiohttp).
This sample demonstrates a Teams bot that facilitates task approval requests within group chats. Users can submit requests via Adaptive Cards, which managers can then approve or reject directly in the chat. Other group members can view request details, while only requesters and managers have access to actionable options. The sample supports Azure and includes comprehensive setup guidance, leveraging .NET Core and the Microsoft 365 Agents Toolkit for Visual Studio.
samples/bot-request-approval/python/README.md:4
- The frontmatter lists the
products:
key twice. Please remove the duplicate to avoid confusion.
products:
samples/bot-request-approval/python/README.md:25
- [nitpick] There are two identical "## Included Features" sections. Please consolidate or remove the duplicate heading.
## Included Features
samples/bot-request-approval/python/.vscode/extensions.json:4
- The trailing comma after the last array element is invalid JSON in
extensions.json
. Please remove it.
"ms-python.python",
|
||
# Handle Adaptive Card submit actions | ||
if activity.name == "adaptiveCard/action": | ||
action = activity.value.get("action") # Extract submitted action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable action
is retrieved but never used. Either use it in your logic or remove this line.
action = activity.value.get("action") # Extract submitted action |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FIxed
subscriptionId: ${{AZURE_SUBSCRIPTION_ID}} # The AZURE_SUBSCRIPTION_ID is a built-in environment variable. TeamsFx will ask you select one subscription if its value is empty. You're free to reference other environment varialbe here, but TeamsFx will not ask you to select subscription if it's empty in this case. | ||
resourceGroupName: ${{AZURE_RESOURCE_GROUP_NAME}} # The AZURE_RESOURCE_GROUP_NAME is a built-in environment variable. TeamsFx will ask you to select or create one resource group if its value is empty. You're free to reference other environment varialbe here, but TeamsFx will not ask you to select or create resource grouop if it's empty in this case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo in the comment: "varialbe" should be "variable".
subscriptionId: ${{AZURE_SUBSCRIPTION_ID}} # The AZURE_SUBSCRIPTION_ID is a built-in environment variable. TeamsFx will ask you select one subscription if its value is empty. You're free to reference other environment varialbe here, but TeamsFx will not ask you to select subscription if it's empty in this case. | |
resourceGroupName: ${{AZURE_RESOURCE_GROUP_NAME}} # The AZURE_RESOURCE_GROUP_NAME is a built-in environment variable. TeamsFx will ask you to select or create one resource group if its value is empty. You're free to reference other environment varialbe here, but TeamsFx will not ask you to select or create resource grouop if it's empty in this case. | |
subscriptionId: ${{AZURE_SUBSCRIPTION_ID}} # The AZURE_SUBSCRIPTION_ID is a built-in environment variable. TeamsFx will ask you select one subscription if its value is empty. You're free to reference other environment variable here, but TeamsFx will not ask you to select subscription if it's empty in this case. | |
resourceGroupName: ${{AZURE_RESOURCE_GROUP_NAME}} # The AZURE_RESOURCE_GROUP_NAME is a built-in environment variable. TeamsFx will ask you to select or create one resource group if its value is empty. You're free to reference other environment variable here, but TeamsFx will not ask you to select or create resource group if it's empty in this case. |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
- uses: arm/deploy # Deploy given ARM templates parallelly. | ||
with: | ||
subscriptionId: ${{AZURE_SUBSCRIPTION_ID}} # The AZURE_SUBSCRIPTION_ID is a built-in environment variable. TeamsFx will ask you select one subscription if its value is empty. You're free to reference other environment varialbe here, but TeamsFx will not ask you to select subscription if it's empty in this case. | ||
resourceGroupName: ${{AZURE_RESOURCE_GROUP_NAME}} # The AZURE_RESOURCE_GROUP_NAME is a built-in environment variable. TeamsFx will ask you to select or create one resource group if its value is empty. You're free to reference other environment varialbe here, but TeamsFx will not ask you to select or create resource grouop if it's empty in this case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo in the comment: "grouop" should be "group".
resourceGroupName: ${{AZURE_RESOURCE_GROUP_NAME}} # The AZURE_RESOURCE_GROUP_NAME is a built-in environment variable. TeamsFx will ask you to select or create one resource group if its value is empty. You're free to reference other environment varialbe here, but TeamsFx will not ask you to select or create resource grouop if it's empty in this case. | |
resourceGroupName: ${{AZURE_RESOURCE_GROUP_NAME}} # The AZURE_RESOURCE_GROUP_NAME is a built-in environment variable. TeamsFx will ask you to select or create one resource group if its value is empty. You're free to reference other environment variable here, but TeamsFx will not ask you to select or create resource group if it's empty in this case. |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. Kindly add the build pipeline, include this sample in the main README file, and resolve the Copilot comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix the comments
--- | ||
page_type: sample | ||
description: This Teams bot enables users to request task approval from managers within group chats. Managers can quickly approve or reject requests, while other members view request details only. | ||
products: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove one products
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Fixed
This sample demonstrates a Teams bot that facilitates task approval requests within group chats. Users can submit requests via Adaptive Cards, which managers can then approve or reject directly in the chat. Other group members can view request details, while only requesters and managers have access to actionable options. The sample supports Azure and includes comprehensive setup guidance, leveraging .NET Core and the Microsoft 365 Agents Toolkit for Visual Studio. | ||
|
||
## Included Features | ||
* Bots |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate "## Included Features" section. Remove one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
devtunnel host -p 3978 --allow-anonymous | ||
``` | ||
|
||
3) Create [Azure Bot resource resource](https://docs.microsoft.com/azure/bot-service/bot-service-quickstart-registration) in Azure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Create [Azure Bot resource resource]"
Double "resource". Should be "Create [Azure Bot resource]".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
No description provided.