This message was deleted.
# azure
s
This message was deleted.
b
could you please share your code
q
Sure. Now we just moved to this:
Copy code
self.vnet = network.VirtualNetwork(
            f"{self.config.cluster_name}-vnet",
            location=self.config.location,
            resource_group_name=self.rg.name,
            address_space=network.AddressSpaceArgs(address_prefixes=[address_space]),
            subnets=[
                network.SubnetArgs(
                    address_prefix=address_space,
                    private_endpoint_network_policies="Enabled",
                    private_link_service_network_policies="Enabled",
                    name=f"{self.config.cluster_name}-subnet",
                )
            ]
        )
Before we were creating the vnet, and then a subnet was assigned to this vnet. azure-native wasn't able to understand this, and after a refresh when azure returned the subnets as part of the vnet, it would try to recreate it. Moving the subnet initialization inside the vnet class, it stopped behaving weirdly.
c
This a ”feature“ since the dawn of Azure Resource Manager (ARM) that why I always create my subnets inside the VNET. The only time I don’t see the weirdness is with terraform which is correcting the issue behind the scenes. Since Pulumi goes to the ARM API, the result is the same as ARM templates and bicep. https://github.com/Azure/azure-quickstart-templates/issues/2786
👀 1