Azure / Azure/azure-cli-extensions
az bot msteams create command failing
- Dominant language
- Python
- Stars
- 454
- Forks
- 1.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 64
Description
### 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.
Contributor guide
Assessment
This issue has not been assessed yet.