Azure / azure-cli-extensions

Public Repository for Extensions of Azure CLI.
https://docs.microsoft.com/en-us/cli/azure
MIT License
381 stars 1.2k forks source link

az bot msteams create command failing #5618

Open ThatDodoBird opened 1 year ago

ThatDodoBird commented 1 year ago

Related command

az bot msteams create --name "TestingBotName" --resource-group "TestingResourceGroupName"

Extension name (the extension in question)

az bot msteams create

Description of issue (in as much detail as possible)

Command fails with an unexpected error:

cli.azure.cli.core.azclierror: An error occurred. UnknownError: An unexpected error occurred. Exception: 'Newtonsoft.Json.JsonSerializationException: Error converting value "FallbackDeploymentEnvironment" to type 'Microsoft.Bot.Internal.Schema.ApsDeploymentEnvironment'. Path 'properties.deploymentEnvironment'. ---> System.ArgumentException: Requested value 'FallbackDeploymentEnvironment' was not found.

I believe this problem is related to my previous issue post here. I was able to work around it using az rest yet again. However, these failures seem to be problematic and might indicate a larger issue at hand here.

On local it works...

This is the request url:

cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.BotService/botServices/<bot_name>/channels/MsTeamsChannel?api-version=2021-05-01-preview'

This is the request body:

cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: {"location": "global", "properties": {"channelName": "MsTeamsChannel", "location": "global", "properties": {"isEnabled": true}}}

Inside of my alpine docker container it fails...

This is the request url inside the container:

cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.BotService/botServices/<bot_name>/channels/MsTeamsChannel?api-version=2022-06-15-preview'

This is the request body inside the container:

cli.azure.cli.core.sdk.policies: Request body: 
cli.azure.cli.core.sdk.policies: {"location": "global", "properties": {"channelName": "MsTeamsChannel", "location": "global", "properties": {"isEnabled": true, "deploymentEnvironment": "FallbackDeploymentEnvironment"}}}

Once again, an invalid parameter seems to be added to the request body by the command. Once again, it is not a parameter I have control over in the original Azure CLI command and it seems to be occurring under the hood. Once again, the newer schema version is in the url.

ghost commented 1 year ago

Thank you for your feedback. This has been routed to the support team for assistance.

yonzhan commented 1 year ago

route to CXP team

navba-MSFT commented 1 year ago

Adding Service team to assist.

ghost commented 1 year ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @sgellock.

Issue Details
### Related command `az bot msteams create --name "TestingBotName" --resource-group "TestingResourceGroupName"` ### Extension name (the extension in question) `az bot msteams create` ### Description of issue (in as much detail as possible) Command fails with an unexpected error: ``` cli.azure.cli.core.azclierror: An error occurred. UnknownError: An unexpected error occurred. Exception: 'Newtonsoft.Json.JsonSerializationException: Error converting value "FallbackDeploymentEnvironment" to type 'Microsoft.Bot.Internal.Schema.ApsDeploymentEnvironment'. Path 'properties.deploymentEnvironment'. ---> System.ArgumentException: Requested value 'FallbackDeploymentEnvironment' was not found. ``` I believe this problem is related to my previous issue post [here](https://github.com/Azure/azure-cli-extensions/issues/5602). I was able to work around it using `az rest` yet again. However, these failures seem to be problematic and might indicate a larger issue at hand here. On local it works... This is the request url: ``` cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.BotService/botServices//channels/MsTeamsChannel?api-version=2021-05-01-preview' ``` This is the request body: ``` cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: {"location": "global", "properties": {"channelName": "MsTeamsChannel", "location": "global", "properties": {"isEnabled": true}}} ``` Inside of my alpine docker container it fails... This is the request url inside the container: ``` cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions//resourceGroups//providers/Microsoft.BotService/botServices//channels/MsTeamsChannel?api-version=2022-06-15-preview' ``` This is the request body inside the container: ``` cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: {"location": "global", "properties": {"channelName": "MsTeamsChannel", "location": "global", "properties": {"isEnabled": true, "deploymentEnvironment": "FallbackDeploymentEnvironment"}}} ``` Once again, an invalid parameter seems to be added to the request body by the command. Once again, it is not a parameter I have control over in the original Azure CLI command and it seems to be occurring under the hood. Once again, the newer schema version is in the url.
Author: ThatDodoBird
Assignees: -
Labels: `question`, `customer-reported`, `Bot Service`, `Service Attention`, `Auto-Assign`, `Test`
Milestone: -
omidreza-amrollahi commented 12 months ago

Are there any updates to this issue? for me when I accept the terms and conditions of msteam channel using azure portal it gets solved but are there any ways to do this using the cli?

AFK-Python commented 12 months ago

@omidreza-amrollahi I ended up replacing the az bot command with az rest commands (my other post mentioning this), but my team and I also released a terraform version and that worked. We use the terraform version over the powershell version for our tooling, but the powershell still exists as a backup. Hope that helps!