Azure Logic app standard - set vnetPrivatePortsCount

We have a requirement to set the vnetPrivatePortsCount which is a Configuration setting of Standard logic app. However, so far we could not find a way to set it via terraform. We use azurerm_logic_app_standard object to create Logic apps so we need an option to set it via that.

We have tried doing below but that does not work
site_config {
vnet_private_ports_count = 2

Is this property not available via terraform or am I missing something?

Hi @master.vijoo,

As per the azurerm_logic_app_standard site_config section this attribute is not supported by the resource as implemented by the azurerm provider.

A work around I use in such instances is to use the azapi provider specifically the azapi_update_resource. This resource can manage a subset of any existing Azure resource manager resource’s properties, to add or modify properties on an existing resource.
If you put such a resource in alongside your existing azurerm_logic_app_standard and reference that azurerm_logic_app_standard resource’s attributes then the dependency will be implied.

For some further detail of what the calls look like then the following will be useful. Note this shows an example creating the resource via the azapi_resource with all attributes, whereas you only need to update one via the azapi_update_resource so it is only for a reference.
Microsoft.Web/sites - Bicep, ARM template & Terraform AzAPI reference | Microsoft Learn

Also refer to Announcing AzAPI Dynamic Properties - Microsoft Community Hub The examples in the Microsoft documentation are still using the pre v1.13.0 syntax requiring the jsonenode function. This is no longer required and it is recommended to not use it as it provides better output for planning and reduces the amount of spurious resource updates as Terraform can actually determine at plan time what has changed on the resource attributes and have the provider target just those attributes (As opposed to it just being a single jsonencoded string attribute)

There is often some trial and error required (and a lot of test), and sometimes captuing the API call from the portal to Azure via your browser’s developer network capture mode will give you more insight as to what to put in the azapi call also.

Good luck.

Happy Terraforming
Hope that