early-advantage-63854
03/12/2025, 2:09 PMearly-advantage-63854
03/12/2025, 2:14 PMidentity=azure_native.compute.VirtualMachineIdentityArgs(
type="UserAssigned, SystemAssigned",
user_assigned_identities={
user_assigned_identity.id: {}
}
),
to the virtual machine,
as well like the identity before the vm:
user_assigned_identity = azure_native.managedidentity.UserAssignedIdentity("exampleUserAssignedIdentity",
resource_group_name=resource_group.name,
location=resource_group.location
)
Error:
pulumi:pulumi:Stack (project):
error: Program failed with an unhandled exception:
Traceback (most recent call last):
File "/home/user/.pulumi/bin/pulumi-language-python-exec", line 198, in <module>
loop.run_until_complete(coro)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/user/project/venv/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 143, in run_in_stack
await run_pulumi_func(run)
File "/home/user/project/venv/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 55, in run_pulumi_func
await wait_for_rpcs()
File "/home/user/project/venv/lib/python3.10/site-packages/pulumi/runtime/stack.py", line 119, in wait_for_rpcs
await task
File "/home/user/project/venv/lib/python3.10/site-packages/pulumi/runtime/resource.py", line 936, in do_register
resolver = await prepare_resource(
File "/home/user/project/venv/lib/python3.10/site-packages/pulumi/runtime/resource.py", line 196, in prepare_resource
serialized_props = await rpc.serialize_properties(
File "/home/user/project/venv/lib/python3.10/site-packages/pulumi/runtime/rpc.py", line 247, in serialize_properties
struct[translated_name] = result
File "/home/user/project/venv/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 471, in __setitem__
_SetStructValue(self.fields[key], value)
File "/home/user/project/venv/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 433, in _SetStructValue
struct_value.struct_value.update(value)
File "/home/user/project/venv/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 507, in update
_SetStructValue(self.fields[key], value)
File "/home/user/project/venv/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 433, in _SetStructValue
struct_value.struct_value.update(value)
File "/home/user/project/venv/lib/python3.10/site-packages/google/protobuf/internal/well_known_types.py", line 507, in update
_SetStructValue(self.fields[key], value)
TypeError: bad argument type for built-in operation
adventurous-butcher-54166
03/12/2025, 4:10 PMuser_assigned_identities
parameter be a Sequence[str]
?
user_assigned_identities=[
user_assigned_identity.id
]
early-advantage-63854
03/12/2025, 4:29 PMidentity=azure_native.compute.VirtualMachineIdentityArgs(
type="UserAssigned, SystemAssigned",
user_assigned_identities={
user_assigned_identity.id: {}
}
),
i tried both datatype that are given in the VirtualMachine constructor:
identity: Input[VirtualMachineIdentityArgs | VirtualMachineIdentityArgsDict] | None = None,
mostly i got the error: user_assigned_identity should be an object
. i just couldn't figure out which kind of object.
Docu of the virtualmachine:
identity VirtualMachineIdentityArgs
The identity of the virtual machine, if configured.
Docu of VirtualMachineIdentityArgs:
user_assigned_identities Sequence[str]
The list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
i tried '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'
as value with key user_assigned_identities:
that was the problem..
thank you for your help!