diff --git a/internal/services/bot/bot_channel_ms_teams_resource.go b/internal/services/bot/bot_channel_ms_teams_resource.go index 0acaf1a78de2..2d39eeb9faed 100644 --- a/internal/services/bot/bot_channel_ms_teams_resource.go +++ b/internal/services/bot/bot_channel_ms_teams_resource.go @@ -63,6 +63,16 @@ func resourceBotChannelMsTeams() *pluginsdk.Resource { ValidateFunc: validate.BotMSTeamsCallingWebHook(), }, + "deployment_environment": { + Type: pluginsdk.TypeString, + Optional: true, + Default: "CommercialDeployment", + ValidateFunc: validation.StringInSlice([]string{ + "CommercialDeployment", + "GCCModerateDeployment", + }, false), + }, + // TODO 4.0: change this from enable_* to *_enabled "enable_calling": { Type: pluginsdk.TypeBool, @@ -95,8 +105,10 @@ func resourceBotChannelMsTeamsCreate(d *pluginsdk.ResourceData, meta interface{} channel := botservice.BotChannel{ Properties: botservice.MsTeamsChannel{ Properties: &botservice.MsTeamsChannelProperties{ - EnableCalling: utils.Bool(d.Get("enable_calling").(bool)), - IsEnabled: utils.Bool(true), + AcceptedTerms: utils.Bool(true), + DeploymentEnvironment: utils.String(d.Get("deployment_environment").(string)), + EnableCalling: utils.Bool(d.Get("enable_calling").(bool)), + IsEnabled: utils.Bool(true), }, ChannelName: botservice.ChannelNameBasicChannelChannelNameMsTeamsChannel, }, @@ -146,6 +158,7 @@ func resourceBotChannelMsTeamsRead(d *pluginsdk.ResourceData, meta interface{}) if channel, ok := props.AsMsTeamsChannel(); ok { if channelProps := channel.Properties; channelProps != nil { d.Set("calling_web_hook", channelProps.CallingWebhook) + d.Set("deployment_environment", channelProps.DeploymentEnvironment) d.Set("enable_calling", channelProps.EnableCalling) } } @@ -167,9 +180,11 @@ func resourceBotChannelMsTeamsUpdate(d *pluginsdk.ResourceData, meta interface{} channel := botservice.BotChannel{ Properties: botservice.MsTeamsChannel{ Properties: &botservice.MsTeamsChannelProperties{ - EnableCalling: utils.Bool(d.Get("enable_calling").(bool)), - CallingWebhook: utils.String(d.Get("calling_web_hook").(string)), - IsEnabled: utils.Bool(true), + AcceptedTerms: utils.Bool(true), + DeploymentEnvironment: utils.String(d.Get("deployment_environment").(string)), + EnableCalling: utils.Bool(d.Get("enable_calling").(bool)), + CallingWebhook: utils.String(d.Get("calling_web_hook").(string)), + IsEnabled: utils.Bool(true), }, ChannelName: botservice.ChannelNameBasicChannelChannelNameMsTeamsChannel, }, diff --git a/internal/services/bot/bot_channel_ms_teams_resource_test.go b/internal/services/bot/bot_channel_ms_teams_resource_test.go index 97bd44e4355c..67f193eae6ff 100644 --- a/internal/services/bot/bot_channel_ms_teams_resource_test.go +++ b/internal/services/bot/bot_channel_ms_teams_resource_test.go @@ -94,11 +94,12 @@ func (BotChannelMsTeamsResource) basicUpdate(data acceptance.TestData) string { %s resource "azurerm_bot_channel_ms_teams" "test" { - bot_name = azurerm_bot_channels_registration.test.name - location = azurerm_bot_channels_registration.test.location - resource_group_name = azurerm_resource_group.test.name - calling_web_hook = "https://example.com/" - enable_calling = true + bot_name = azurerm_bot_channels_registration.test.name + location = azurerm_bot_channels_registration.test.location + resource_group_name = azurerm_resource_group.test.name + calling_web_hook = "https://example.com/" + enable_calling = true + deployment_environment = "CommercialDeployment" } `, BotChannelsRegistrationResource{}.basicConfig(data)) } diff --git a/website/docs/r/bot_channel_ms_teams.html.markdown b/website/docs/r/bot_channel_ms_teams.html.markdown index da4a0ed1f094..5a07b28500df 100644 --- a/website/docs/r/bot_channel_ms_teams.html.markdown +++ b/website/docs/r/bot_channel_ms_teams.html.markdown @@ -49,6 +49,8 @@ The following arguments are supported: * `calling_web_hook` - (Optional) Specifies the webhook for Microsoft Teams channel calls. +* `deployment_environment` - (Optional) The deployment environment for Microsoft Teams channel calls. Possible values are `CommercialDeployment` and `GCCModerateDeployment`. Defaults to `CommercialDeployment`. + * `enable_calling` - (Optional) Specifies whether to enable Microsoft Teams channel calls. This defaults to `false`. ## Attributes Reference