Azure / Azure/azure-rest-api-specs

[BUG] VM Extension typeHandlerVersion not showing the correct version

Open
#30,107 3 comments 0 reactions 1 assignee Claimed by @grizzlytheodore View on GitHub
bug customer-reported Mgmt question
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 2h
Merged PRs (30d)
424

Description

### API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/virtualMachine.json

### API Spec version

2024-07-01

### Describe the bug

The response of typeHandlerVersion in VirtualMachineExtensionInstanceView and VirtualMachineExtension should be the same, this reflects the currently installed Extension Version -- or you need to change the definition of the one in VirtualMachineExtension to say "the version you specified when installing the extension" -- which is also not the version you actually install if you have autoUpgradeMinorVersion set to true :)

1.

### Expected behavior

VirtualMachineExtension typeHandlerVersion should either show
a) the currently installed version or
b) the version it was installed with (taking into account the auto upgrade minor=true)

### Actual behavior

VirtualMachineExtension typeHandlerVersion shows the version you specifiy in the extension installation

### Reproduction Steps

Install an extension to one of your existing virtual machines for example via ansible:
```
azure_rm_virtualmachineextension:
subscription_id: "{{ subscription_id }}"
resource_group: "{{ resource_group_name }}"
name: AzureMonitorLinuxAgent
virtual_machine_name: "{{ inventory_hostname_short }}"
publisher: Microsoft.Azure.Monitor
virtual_machine_extension_type: AzureMonitorLinuxAgent
type_handler_version: 1.0
auto_upgrade_minor_version: true
```

Then get the extension including instanceVIew:
`https://management.azure.com/subscriptions/SUBSCRIPTION/resourceGroups/RESOURCEGROUP/providers/Microsoft.Compute/virtualMachines/VMNAME/extensions/AzureMonitorLinuxAgent?api-version=2024-07-01&$expand=InstanceView`

Output will show:
```
{
[...]
"properties": {
"autoUpgradeMinorVersion": true,
[...]
"instanceView": {
[...]
"typeHandlerVersion": "1.31.1",
[...]
},
[...]
"typeHandlerVersion": "1.0"
}
}
```

### Environment

Production Azure

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.