hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.51k stars 4.6k forks source link

azurerm_virtual_desktop_application_group wrong MaxLength constraint when checking for presence of existing Virtual Desktop Application Group #9310

Open timbehh opened 3 years ago

timbehh commented 3 years ago

Community Note

Terraform (and AzureRM Provider) Version

Terraform v0.13.5
+ provider registry.terraform.io/hashicorp/azurerm v2.36.0

Affected Resource(s)

Terraform Configuration Files

provider "azurerm" {
  version         = "=2.36.0"
  subscription_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  features {}
}

resource "azurerm_virtual_desktop_application_group" "desktopapp" {
  name                = "thisnameis39characterslongandshouldwork"
  location            = "eastus"
  resource_group_name = "team-wvdarm"

  type          = "RemoteApp"
  host_pool_id  = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/team-wvdarm/providers/Microsoft.DesktopVirtualization/hostpools/armpool01"
}

Debug Output

Panic Output

Expected Behaviour

Windows Virtual Desktop Application Group is created

Actual Behaviour

Error: checking for presence of existing Virtual Desktop Application Group "thisnameis39characterslongandshouldwork" (Resource Group "team-wvdarm"): desktopvirtualization.ApplicationGroupsClient#Get: Invalid input: autorest/validation: validation failed: parameter=applicationGroupName constraint=MaxLength value="thisnameis39characterslongandshouldwork" details: value length must be less than or 
equal to 24

  on provider.tf line 7, in resource "azurerm_virtual_desktop_application_group" "desktopapp":
   7: resource "azurerm_virtual_desktop_application_group" "desktopapp" {

The Windows Virtual Desktop Application Group is not created. I had filed a bug before (#8980) that was fixed (#9030). But there seems to be another check for the application group name length when checking if the group is already present. The MaxLength constraint should be 260 characters instead of 24.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

tombuildsstuff commented 3 years ago

hi @timbehh

Thanks for opening this issue.

Taking a look through this appears to be an issue in the Azure SDK's validation, rather than Terraform's - so this'd need to be fixed there. @ArcturusZhang would you be able to reach out to the service team to get this fixed?

Thanks!

ArcturusZhang commented 3 years ago

Upstream issue created: https://github.com/Azure/azure-rest-api-specs/issues/11687 And I also assigned the last committer of the swagger, who might take a look and provide a fix for this.

datr93 commented 3 years ago

https://github.com/Azure/azure-rest-api-specs/pull/11692