Skip to content

Commit

Permalink
Remove deprecated VM extension
Browse files Browse the repository at this point in the history
  • Loading branch information
romulets committed Apr 23, 2024
1 parent 82bc66f commit fc8694d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 91 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/arm-template-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ jobs:

# Based on https://github.com/microsoft/action-armttk/blob/main/action.yml#L56
#
# Not used the official MS ARM TTK Action because we need to ignore some rules
# which must be done by deleting `.ps1` files https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/test-toolkit#customize-tests
# Not used the official MS ARM TTK Action because we don't follow the standard file naming convertion
# The ARM TTK Action didn't give us such flexibility
- name: Run ARM-TTK ${{ matrix.template }}
working-directory: ./deploy/azure
Expand All @@ -36,15 +35,6 @@ jobs:
Invoke-WebRequest -Uri 'aka.ms/arm-ttk-latest' -OutFile arm-template-toolkit.zip
Expand-Archive -LiteralPath arm-template-toolkit.zip -DestinationPath arm-ttk
# Delete Unwanted rules
# Deleting ManagedIdentityExtension-must-not-be-used.test.ps1
# Under VMs release notes of May 7, 2018 https://learn.microsoft.com/en-us/cli/azure/release-notes-azure-cli#vm-27
# ManagedIdentityExtension is not recommended to be used anymore ([BREAKING CHANGE] Do not use VM 'ManagedIdentityExtension' for MSI support)
# But no alternative was found and even it's possible to find official MS docs using ManagedIdentityExtension for MSI still
# Therefore, let's just skip this rule
Remove-Item ./arm-ttk/arm-ttk/testcases/deploymentTemplate/ManagedIdentityExtension-must-not-be-used.test.ps1
# Load and run test
Import-Module ./arm-ttk/arm-ttk/arm-ttk.psd1
echo "Test-AzTemplate -TemplatePath ${{ matrix.template }} -Pester -Skip Secure-Params-In-Nested-Deployments" | Out-File -FilePath ./armttk.ps1
Expand Down
24 changes: 3 additions & 21 deletions deploy/azure/ARM-for-organization-account.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"variables": {
"resourceGroupDeployment": "[concat('resource-group-deployment-', parameters('DeploymentLocation'))]",
"roleAssignmentDeployment": "[concat('role-assignment-deployment-', parameters('DeploymentLocation'))]",
"roleGUID": "[guid(parameters('SubscriptionId'))]"
"roleGUID": "[guid(parameters('SubscriptionId'), parameters('ResourceGroupName'))]"
},
"resources": [
{
Expand Down Expand Up @@ -302,24 +302,6 @@
]
}
},
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"apiVersion": "2023-09-01",
"name": "cloudbeatVM/EnableMSIExtension",
"location": "[parameters('ResourceGroupLocation')]",
"dependsOn": [
"cloudbeatVM"
],
"properties": {
"publisher": "Microsoft.ManagedIdentity",
"type": "ManagedIdentityExtensionForLinux",
"typeHandlerVersion": "1.0",
"autoUpgradeMinorVersion": true,
"settings": {
"port": 50342
}
}
},
{
"type": "Microsoft.Authorization/roleDefinitions",
"apiVersion": "2022-04-01",
Expand All @@ -330,7 +312,7 @@
"[concat('/subscriptions/', parameters('SubscriptionId'))]",
"[concat('/subscriptions/', parameters('SubscriptionId'), '/resourcegroups/', parameters('ResourceGroupName'))]"
],
"description": "Additional read permissions for cloudbeatVM",
"description": "Additional read permissions for cloudbeatVM (edit)",
"permissions": [
{
"actions": [
Expand All @@ -340,7 +322,7 @@
]
}
],
"roleName": "cloudbeatVM additional permissions",
"roleName": "[concat('cloudbeatVM additional permissions ', parameters('ResourceGroupName'))]",
"type": "CustomRole"
}
},
Expand Down
24 changes: 3 additions & 21 deletions deploy/azure/ARM-for-organization-account.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"variables": {
"resourceGroupDeployment": "[concat('resource-group-deployment-', parameters('DeploymentLocation'))]",
"roleAssignmentDeployment": "[concat('role-assignment-deployment-', parameters('DeploymentLocation'))]",
"roleGUID": "[guid(parameters('SubscriptionId'))]"
"roleGUID": "[guid(parameters('SubscriptionId'), parameters('ResourceGroupName'))]"
},
"resources": [
{
Expand Down Expand Up @@ -326,24 +326,6 @@
]
}
},
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"apiVersion": "2023-09-01",
"name": "cloudbeatVM/EnableMSIExtension",
"location": "[parameters('ResourceGroupLocation')]",
"dependsOn": [
"cloudbeatVM"
],
"properties": {
"publisher": "Microsoft.ManagedIdentity",
"type": "ManagedIdentityExtensionForLinux",
"typeHandlerVersion": "1.0",
"autoUpgradeMinorVersion": true,
"settings": {
"port": 50342
}
}
},
{
"type": "Microsoft.Resources/deploymentScripts",
"apiVersion": "2023-08-01",
Expand All @@ -368,7 +350,7 @@
"[concat('/subscriptions/', parameters('SubscriptionId'))]",
"[concat('/subscriptions/', parameters('SubscriptionId'), '/resourcegroups/', parameters('ResourceGroupName'))]"
],
"description": "Additional read permissions for cloudbeatVM",
"description": "Additional read permissions for cloudbeatVM (edit)",
"permissions": [
{
"actions": [
Expand All @@ -378,7 +360,7 @@
]
}
],
"roleName": "cloudbeatVM additional permissions",
"roleName": "[concat('cloudbeatVM additional permissions ', parameters('ResourceGroupName'))]",
"type": "CustomRole"
}
}
Expand Down
20 changes: 1 addition & 19 deletions deploy/azure/ARM-for-single-account.dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"type": "Microsoft.Resources/deployments",
"apiVersion": "2022-09-01",
"name": "[variables('roleAssignmentDeployment')]",
"location": "[parameters('ResourceGroupLocation')]",
"subscriptionId": "[subscription().subscriptionId]",
"resourceGroup": "[resourceGroup().name]",
"properties": {
"expressionEvaluationOptions": {
"scope": "inner"
Expand Down Expand Up @@ -233,24 +233,6 @@
]
}
},
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"apiVersion": "2023-09-01",
"name": "cloudbeatVM/EnableMSIExtension",
"location": "[parameters('ResourceGroupLocation')]",
"dependsOn": [
"cloudbeatVM"
],
"properties": {
"publisher": "Microsoft.ManagedIdentity",
"type": "ManagedIdentityExtensionForLinux",
"typeHandlerVersion": "1.0",
"autoUpgradeMinorVersion": true,
"settings": {
"port": 50342
}
}
},
{
"type": "Microsoft.Authorization/roleDefinitions",
"apiVersion": "2022-04-01",
Expand Down
20 changes: 1 addition & 19 deletions deploy/azure/ARM-for-single-account.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"type": "Microsoft.Resources/deployments",
"apiVersion": "2022-09-01",
"name": "[variables('roleAssignmentDeployment')]",
"location": "[parameters('ResourceGroupLocation')]",
"subscriptionId": "[subscription().subscriptionId]",
"resourceGroup": "[resourceGroup().name]",
"properties": {
"expressionEvaluationOptions": {
"scope": "inner"
Expand Down Expand Up @@ -242,24 +242,6 @@
]
}
},
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"apiVersion": "2023-09-01",
"name": "cloudbeatVM/EnableMSIExtension",
"location": "[parameters('ResourceGroupLocation')]",
"dependsOn": [
"cloudbeatVM"
],
"properties": {
"publisher": "Microsoft.ManagedIdentity",
"type": "ManagedIdentityExtensionForLinux",
"typeHandlerVersion": "1.0",
"autoUpgradeMinorVersion": true,
"settings": {
"port": 50342
}
}
},
{
"type": "Microsoft.Resources/deploymentScripts",
"apiVersion": "2023-08-01",
Expand Down

0 comments on commit fc8694d

Please sign in to comment.