Azure-Samples / compute-python-msi-vm

This sample demonstrates how to create Azure virtual machine with Managed Service Identity Extension using a Python client
MIT License
5 stars 6 forks source link

May need update for 2018 version of API or explicitly say only for 2017 version of the API #8

Open jkoplik-dxc opened 4 years ago

jkoplik-dxc commented 4 years ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ X ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful

The identity creation seems to be based on 2017 version of API but does not explicitly say so - even though this has been updated in 2019.

The 2018 version changed to "userAssignedIdentities" as the key value and the data structure changed from List to Dict. See https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/qs-configure-template-windows-vm. Therefore your identity would be create in python as this:

    params_identity = {}
    params_identity['type'] = ResourceIdentityType.user_assigned
    params_identity['userAssignedIdentities'] = {
        "myIdentity":{}
    }

Thanks! We'll be in touch soon.