https://pulumi.com logo
Title
b

brief-pencil-59807

12/01/2022, 11:52 AM
m

many-telephone-49025

12/01/2022, 11:59 AM
are you planing to use the azure-native provider or classic?
b

brief-pencil-59807

12/01/2022, 12:00 PM
azure-native provider
m

many-telephone-49025

12/01/2022, 12:01 PM
Should be a system assigned identity or user assigned?
b

brief-pencil-59807

12/01/2022, 12:02 PM
an existing user assigned identity
m

many-telephone-49025

12/01/2022, 12:05 PM
I did not find an example for the azure-native provider and Scaleset, so I could create one! In the mean time, did you checked the docs for the provider https://www.pulumi.com/registry/packages/azure-native/api-docs/compute/virtualmachinescaleset/#virtualmachinescalesetidentity Maybe it helps you already?
Let me know if you need example code
b

brief-pencil-59807

12/01/2022, 12:13 PM
var existingScaleSet = VirtualMachineScaleSet.Get("nameofthescaleset", "/subscriptions/aaa/resourceGroups/aaa/providers/Microsoft.Compute/virtualMachineScaleSets/nameofthescaleset");
existingScaleSet.Identity.Apply(x => x.UserAssignedIdentities.Add("identity-gguid", ??? ));
something like this? can you correct it for me please
m

many-telephone-49025

12/01/2022, 12:17 PM
add should have the type and another map of the ids in it
b

brief-pencil-59807

12/01/2022, 12:20 PM
Can you please retype that or provide me an example.
m

many-telephone-49025

12/01/2022, 12:20 PM
ok, give some mins to come up with an example code
b

brief-pencil-59807

12/01/2022, 12:21 PM
Many thanks 🙂
m

many-telephone-49025

12/01/2022, 12:21 PM
I am going to use go, but I think it should not make a difference
b

brief-pencil-59807

12/01/2022, 12:22 PM
ok Im using c#
m

many-telephone-49025

12/01/2022, 12:22 PM
I am so out on c# 😞
b

brief-pencil-59807

12/01/2022, 12:23 PM
ok no worries. example on any language is fine
m

many-telephone-49025

12/01/2022, 1:19 PM
https://github.com/dirien/azure-scaleset Hope this helps, I did not do a getXX, I just created the identity and the scaleset
b

brief-pencil-59807

12/01/2022, 1:20 PM
ok many thanks for your time
m

many-telephone-49025

12/01/2022, 1:20 PM
Happy to help! Let me know how it ends 🙂
b

brief-pencil-59807

12/01/2022, 1:22 PM
sure thanks :)
Got another question:
VirtualMachineScaleSetIdentityResponseUserAssignedIdentities
is sealed class with a private constructor which does not allow me to create an object and add it into the
UserAssignedIdentities
m

many-telephone-49025

12/01/2022, 2:38 PM
wait I try it
I think a
get
call will never update the resource:
A resource read with the
get
function will never be updated or deleted by Pulumi during an update.
https://www.pulumi.com/docs/intro/concepts/resources/get/
You could import the resource into your Pulumi program though
b

brief-pencil-59807

12/01/2022, 2:55 PM
ok thanks