Hello team; I'm using pulumi with go and azure-nat...
# general
w
Hello team; I'm using pulumi with go and azure-native, trying to modify VM OsDisk NetworkAccessPolicy to compute.NetworkAccessPolicyAllowPrivate, I don't see any option for NetworkAccessPolicy in compute.OSDiskArgs, I tried to use cumpute.GetDisk once the disk is created and then apply the change , but looks like it is still using default settings "Allow All" . any advise, Thanks !
Copy code
osDiskOutput := vm.StorageProfile.OsDisk().ApplyT(func(d *compute.OSDiskResponse) (*string, error) {
            if d == nil {
                return nil, fmt.Errorf("missing compute.OSDiskResponse")
            }

            osDisk, err := compute.GetDisk(ctx, *d.Name, pulumi.ID(*d.ManagedDisk.Id), nil, nil)
            if err != nil {
                return d.Name, err
            }

            osDisk.NetworkAccessPolicy = compute.NetworkAccessPolicyDenyAll.ToStringPtrOutput()
            return d.Name, nil
        })

        ctx.Export("osDiskOutput", osDiskOutput)
Slack Conversation