Skip to content

SystemAssigned Identity being created when creating UserAssigned #8772

Open

Description

Bicep version
Bicep CLI version 0.11.1 (030248d)

Describe the bug
When creating ONLY a UserAssigned identity on a Microsoft.Compute/virtualMachines resource, a SystemAssigned identity is created too. This means when the deployment finishes both a System and User identity are present.

We see this in the ARM (taken from export template in the portal)

To Reproduce

resource vm 'Microsoft.Compute/virtualMachines@2022-08-01' = {
  name: vmName
  location: location
  tags: tags
  identity: {
    type: 'UserAssigned'
    userAssignedIdentities: {
      '${identities}': {}
....

The deployment is successful, but the ARM from the portal shows:

"resources": [
        {
            "type": "Microsoft.Compute/virtualMachines",
            "apiVersion": "2022-03-01",
            "name": "[parameters('virtualMachines_vm01')]",
            "location": "uksouth",
            "tags": {
                "Environment": "Demo",
                "Owner": "user@domain.co.uk",
                "Service": "Product",
                "Deployment Date": "2022-10-24"
            },
            "identity": {
                "type": "SystemAssigned, UserAssigned",
                "userAssignedIdentities": {
                    "/subscriptions/ID/resourceGroups/RGNAME/providers/Microsoft.ManagedIdentity/userAssignedIdentities/msi-vm01": {}
                }
            },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions