Open mKamleiter opened 6 months ago
Hi @mKamleiter, thank you for reaching out. It is required by Azure when creating an azurerm_linux_virtual_machine_scale_set using upgrade_mode = "Rolling" with an inline HealthExtension. If the configuration of health extension is not taken, the Azure service will return an error.
Hi @ms-zhenhua, thanks for you answer. Already suspected that.
Any idea on how to integrate rolling scale sets with azure DevOps scale set agents? We need to pre-provision the virtual machine scale set and would like to change them to rolling for the azure update manager to work properly. Unfortunately once the Devops guys connect the scale set to an agent pool, Azure DevOps creates another scale set extension, which gets removed by terraform. Already tried to add a lifecycle hook to ignore the changes, but unfortunately can't ignore only one specific extension.
Thanks for the support
Hi @mKamleiter, could you confirm why is the Azure DevOps extension removed by terraform? Is it possible to define a new extension
block for the Azure DevOps extension to avoid the deletion?
Hi @ms-zhenhua,
Our setup involves two core platform teams responsible for maintaining and providing application landing zones, as suggested by the Landing Zone Framework (https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/ready/landing-zone/#platform-landing-zones-vs-application-landing-zones).
The first team is responsible for infrastructure provisioning, including subscriptions, core services such as virtual networks and the virtual machine scale set mentioned earlier, which will be used later with Azure DevOps.
Once the first team has completed their work, the second team, DevOps, takes over. Their responsibilities include provisioning an Azure DevOps project, multiple service connections, and agent pools within the project, while also ensuring proper permissions are set up. They then connect the pre-provisioned scale set to the corresponding agent pools. This process generates a new virtual machine scale set extension named 'Microsoft.Azure.Devops.Pipelines.Agent'. This extension provides details about the agent pool, including the registration token required for authentication.
If the platform team configures an inline extension
block for the 'ApplicationHealthLinux' extension, Terraform will treat it as the only extension to be configured for the virtual machine scale set. It will delete the DevOps extension instead of ignoring it alongside its own extension, as the azurerm_virtual_machine_scale_set_extension
resource does.
We attempted to pre-provision an empty extension for 'Microsoft.Azure.Devops.Pipelines.Agent', but unfortunately the VM entered a failed state due to incorrect configuration.
It would be good to have the ability to add 'ignore_changes' lifecycle hooks for specific extensions, but currently this is not possible.
Is there an existing issue for this?
Community Note
Terraform Version
1.7.3
AzureRM Provider Version
3.92.0
Affected Resource(s)/Data Source(s)
azurerm_linux_virtual_machine_scale_set, azurerm_virtual_machine_scale_set_extension
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
It should be possible to create a
azurerm_linux_virtual_machine_scale_set
usingupgrade_mode = "Rolling"
while attaching the HealthExtension throughazurerm_virtual_machine_scale_set_extension
.Currently it's only possible to attach the HealthExtension using inline
extension
block. However scale sets can be used as Azure Devops Agents and Azure Devops attaches an additional external scale set extension, which gets deleted if inline extension is used.Actual Behaviour
HealthExtension set using azurerm_virtual_machine_scale_set_extension should work aswell
Steps to Reproduce
terraform apply
Important Factoids
No response
References
No response