The azurerm_bot_channel_slack resource takes client_id, client_secret, signing_secret and verification_token, but Azure won't save those fields unless the registerBeforeOAuthFlow is set to true. This field is set in the client, but the rest api wrongly defines it as read only, so it's never sent in the json payload, and therefore the fields are discarded on the server. The tests pass because the response from the server includes the data that was sent, not the data that was actually saved on the slack channel registration.
Is there a way to work around this issue until hopefully the problem is fixed in the sdk itself? This is breaking automation completely for bot service slack.
The
azurerm_bot_channel_slack
resource takesclient_id
,client_secret
,signing_secret
andverification_token
, but Azure won't save those fields unless theregisterBeforeOAuthFlow
is set to true. This field is set in the client, but the rest api wrongly defines it as read only, so it's never sent in the json payload, and therefore the fields are discarded on the server. The tests pass because the response from the server includes the data that was sent, not the data that was actually saved on the slack channel registration.The azure rest API spec issue is here: https://github.com/Azure/azure-rest-api-specs/issues/18367 The azure sdk issue is here: https://github.com/Azure/azure-sdk-for-go/issues/17358
Is there a way to work around this issue until hopefully the problem is fixed in the sdk itself? This is breaking automation completely for bot service slack.
This is where the field is set in the provider: https://github.com/hashicorp/terraform-provider-azurerm/blob/0ef20db4995c24fc1e23a7955c3f3c4ae36390fd/internal/services/bot/bot_channel_slack_resource.go#L110-L115
But it's set as readonly so it's never marshalled to json in the sdk: https://github.com/Azure/azure-sdk-for-go/blob/b375326a136a64a03eb3d5ce0277f562c2ed455c/services/botservice/mgmt/2021-03-01/botservice/models.go#L2692-L2713