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.58k stars 4.62k forks source link

`Microsoft.App/environments` invalid delegation for a subnet #21604

Closed StiviiK closed 1 year ago

StiviiK commented 1 year ago

Is there an existing issue for this?

Community Note

Terraform Version

1.4.5

AzureRM Provider Version

3.54.0

Affected Resource(s)/Data Source(s)

azurerm_subnet

Terraform Configuration Files

resource "azurerm_subnet" "core_containerappsenv" {
  name                 = "${local.prefixes.core_normal}-snet-cae"
  resource_group_name  = azurerm_resource_group.rg_core.name
  virtual_network_name = azurerm_virtual_network.core.name
  address_prefixes     = ["10.50.1.0/25"]
  delegation {
    name = "core-containerappsenv"
    service_delegation {
      name    = "Microsoft.App/environments"
      actions = ["Microsoft.Network/virtualNetworks/subnets/action"]
    }
  }
}

Debug Output/Panic Output

╷
│ Error: expected delegation.0.service_delegation.0.name to be one of [Microsoft.ApiManagement/service Microsoft.AzureCosmosDB/clusters Microsoft.BareMetal/AzureVMware Microsoft.BareMetal/CrayServers Microsoft.Batch/batchAccounts Microsoft.ContainerInstance/containerGroups Microsoft.ContainerService/managedClusters Microsoft.Databricks/workspaces Microsoft.DBforMySQL/flexibleServers Microsoft.DBforMySQL/serversv2 Microsoft.DBforPostgreSQL/flexibleServers Microsoft.DBforPostgreSQL/serversv2 Microsoft.DBforPostgreSQL/singleServers Microsoft.HardwareSecurityModules/dedicatedHSMs Microsoft.Kusto/clusters Microsoft.Logic/integrationServiceEnvironments Microsoft.LabServices/labplans Microsoft.MachineLearningServices/workspaces Microsoft.Netapp/volumes Microsoft.Network/dnsResolvers Microsoft.Network/managedResolvers Microsoft.PowerPlatform/vnetaccesslinks Microsoft.ServiceFabricMesh/networks Microsoft.Sql/managedInstances Microsoft.Sql/servers Microsoft.StoragePool/diskPools Microsoft.StreamAnalytics/streamingJobs Microsoft.Synapse/workspaces Microsoft.Web/hostingEnvironments Microsoft.Web/serverFarms Microsoft.Orbital/orbitalGateways NGINX.NGINXPLUS/nginxDeployments PaloAltoNetworks.Cloudngfw/firewalls Qumulo.Storage/fileSystems], got Microsoft.App/environments
│ 
│   with azurerm_subnet.core_containerappsenv,
│   on network.tf line 33, in resource "azurerm_subnet" "core_containerappsenv":
│   33:       name    = "Microsoft.App/environments"
│ 
╵

Expected Behaviour

The delegation Microsoft.App/environments should be accepted for subnets, as it is required for Azure Container Apps Environments using the workload profiles architecture. Microsoft Documentation: https://learn.microsoft.com/en-us/azure/container-apps/networking#subnet

Actual Behaviour

No response

Steps to Reproduce

No response

Important Factoids

No response

References

No response

atiaar commented 1 year ago

Hello, I am facing the same issue while adding this delegation Microsoft.App/environments to an existing subnet using Terraform libray. Any target date to add the missing delegation?

Terraform Supported delegations: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet#service_delegation

Error:

expected delegation.0.service_delegation.0.name to be one of [Microsoft.ApiManagement/service, Microsoft.AzureCosmosDB/clusters, Microsoft.BareMetal/AzureVMware, Microsoft.BareMetal/CrayServers, Microsoft.Batch/batchAccounts, Microsoft.ContainerInstance/containerGroups, Microsoft.ContainerService/managedClusters, Microsoft.Databricks/workspaces, Microsoft.DBforMySQL/flexibleServers, Microsoft.DBforMySQL/serversv2, Microsoft.DBforPostgreSQL/flexibleServers, Microsoft.DBforPostgreSQL/serversv2, Microsoft.DBforPostgreSQL/singleServers, Microsoft.HardwareSecurityModules/dedicatedHSMs, Microsoft.Kusto/clusters, Microsoft.Logic/integrationServiceEnvironments, Microsoft.LabServices/labplans, Microsoft.MachineLearningServices/workspaces, Microsoft.Netapp/volumes, Microsoft.Network/dnsResolvers, Microsoft.Network/managedResolvers, Microsoft.PowerPlatform/vnetaccesslinks, Microsoft.ServiceFabricMesh/networks, Microsoft.Sql/managedInstances, Microsoft.Sql/servers, Microsoft.StoragePool/diskPools, Microsoft.StreamAnalytics/streamingJobs, Microsoft.Synapse/workspaces, Microsoft.Web/hostingEnvironments, Microsoft.Web/serverFarms, Microsoft.Orbital/orbitalGateways, NGINX.NGINXPLUS/nginxDeployments, PaloAltoNetworks.Cloudngfw/firewalls, and Qumulo.Storage/fileSystems],
got Microsoft.App/environments
sanderrhorst commented 1 year ago

Running into this as well. Service Delegation support is required for me to work with Container Apps Environment. Please add this to the supported delegations.

github-actions[bot] commented 1 year ago

This functionality has been released in v3.58.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

github-actions[bot] commented 4 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.