Azure / Azure/azure-policy

Modifiable Alias missing for Microsoft.Compute/virtualMachines/extensions

Open
#944 0 comments 0 reactions 0 assignees View on GitHub
alias-request
Dominant language
Open Policy Agent
Stars
1.7k
Forks
1.2k
Avg merge
2d 54m
Merged PRs (30d)
3

Description

Hello,
I am trying to deploy configurations on VirtualMachine Extensions via Azure Policies, but I am missing aliases to deploy the updates.

In detail, I need to update the policy I try to deploy looks like the following:

`{
"properties": {
"displayName": "Enable AzureMonitor Extension AutoUpgrade",
"mode": "Indexed",
"description": "This policy enables the automatic upgrade of Azure Monitor Extensions.",
"metadata": {
"category": "Monitoring"
},
"parameters": {
"effect": {
"type": "string",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy."
},
"allowedValues": ["Modify", "Disabled"],
"defaultValue": "Modify"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "Microsoft.Compute/virtualMachines/extensions/type",
"equals": "AzureMonitorWindowsAgent"
},
{
"field": "Microsoft.Compute/virtualMachines/extensions/publisher",
"equals": "Microsoft.Azure.Monitor"
},
{
"field": "Microsoft.Compute/virtualMachines/extensions/provisioningState",
"equals": "Succeeded"
},
{
"field": "Microsoft.Compute/virtualMachines/extensions/enableAutomaticUpgrade",
"equals": false
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"conflictEffect": "audit",
"roleDefinitionIds": [
"/providers/microsoft.authorization/roleDefinitions/9980e02c-c2be-4d73-94e8-173b1dc7cf3c"
],
"operations": [
{
"condition": "[greaterOrEquals(requestContext().apiVersion, '2020-06-01')]",
"operation": "addOrReplace",
"field": "Microsoft.Compute/virtualMachines/extensions/enableAutomaticUpgrade",
"value": true
}
]
}
}
}
}
}`

The used field "Microsoft.Compute/virtualMachines/extensions/enableAutomaticUpgrade" is not available in the listing of modifiable aliases for Virtual Machines, the policy deployment therefore fails with the following error:
![image](https://user-images.githubusercontent.com/10231267/165061831-3b454583-4e6d-41f7-910c-87617c4fcce5.png)

I found, this alias is available for VirtualMachineScaleSets:
![image](https://user-images.githubusercontent.com/10231267/165061683-c4720896-9c38-44ae-9d71-2422cd2f2a4a.png)

Is there a reason this is missing for Virtual Machines?
Is there a timeline bringing making this alias available (and modifiable)?

Best Regards
Christoph

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the modifiable-alias listing for Microsoft.Compute/virtualMachines/extensions and compare it with the corresponding VirtualMachineScaleSets alias. Confirm whether enableAutomaticUpgrade is supported for the requested API versions; the issue is complete when the alias is available and the shown Azure Policy deployment succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
authorization, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.