From 64dc54e1bea23a63d402eaf866b8bc6b27c9e80f Mon Sep 17 00:00:00 2001 From: twerthi Date: Mon, 31 Jul 2023 10:02:05 -0700 Subject: [PATCH] Changing managed identity from system to user --- .../shared-workers-terraform/azure/azure.tf | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/octopus-samples-instances/shared-workers-terraform/azure/azure.tf b/octopus-samples-instances/shared-workers-terraform/azure/azure.tf index b91ac58..af3fee1 100644 --- a/octopus-samples-instances/shared-workers-terraform/azure/azure.tf +++ b/octopus-samples-instances/shared-workers-terraform/azure/azure.tf @@ -82,6 +82,13 @@ resource "azurerm_network_interface" "windows-worker-nic" { } } +resource "azurerm_user_assigned_identity" "database-admin" { + location = var.octopus_azure_location + resource_group_name = var.octopus_azure_resourcegroup_name + + name = "samples-database-admin" +} + resource "azurerm_windows_virtual_machine" "samples-windows-worker" { name = var.octopus_azure_windows_worker_name location = var.octopus_azure_location @@ -109,7 +116,9 @@ resource "azurerm_windows_virtual_machine" "samples-windows-worker" { #custom_data = "${base64encode(file("../configure-tentacle.ps1"))}" identity { - type = "SystemAssigned" + #type = "SystemAssigned" + type = "UserAssigned" + identity_ids = [azurerm_user_assigned_identity.database-admin.id] } tags = var.tags