Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding user assigned identities no longer works in 0.14.9 #117

Closed
zanecodes opened this issue Nov 1, 2019 · 4 comments
Closed

Adding user assigned identities no longer works in 0.14.9 #117

zanecodes opened this issue Nov 1, 2019 · 4 comments

Comments

@zanecodes
Copy link
Contributor

As of kitchen-azurerm 0.14.9, attempting to add a user assigned identity using the user_assigned_identities config option results in the following error:

-----> Starting Kitchen (v2.3.3)
-----> Creating <azonly-windows)...
       Creating Resource Group: kitchen-azonly-windows-20191101T151822
       Creating deployment: deploy-3df06c328c2ae4d4
       Adding WinRM configuration to provisioning profile.
       Resource Microsoft.Network/publicIPAddresses 'publicip' provisioning status is Running
       Resource Microsoft.Network/virtualNetworks 'vnet' provisioning status is Running
       Resource Template deployment reached end state of 'Failed'.
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #create action: [{"error"=>{"code"=>"InvalidParameter", "message"=>"ResourceIdentity property identityIds is deprecated. The userAssignedIdentities property should be used instead.", "target"=>"resourceIdentity.identityIds"}}] on azonly-windows
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

This appears to be due to this change, at least according to the Azure documentation.

Implementing a fix may end up being a bit annoying due to the new property's structure.

@stuartpreston
Copy link
Contributor

Ugh. Thanks for the report.

@nhudacin
Copy link

I just hit this same issue. Following as I might be able to help out.

@nhudacin
Copy link

Ok... So I confirmed that if we draw the line and say that kitchen-azurerm will only support 1 user-assigned identity, then the code change is actually pretty easy and I'm just able ready to put a PR in for that. I can't imagine why anyone would want to assign multiple identities to a VM, I don't even know how that would work or why MSFT supports it.

I like this approach because it doesn't change any of the interfaces for any of us who use this property so our .kitchen.yml files will start working again without having to change them all. Basically handling the type change behind the scenes with something like this:

userAssignedIdentities: config[:user_assigned_identities][0].to_s,

If we need to support multiple user identities then I'll need to add some template code in the erb files to handle it.

@stuartpreston stuartpreston added this to the 1.0 milestone Jan 29, 2020
zanecodes added a commit to zanecodes/kitchen-azurerm that referenced this issue May 4, 2020
@zanecodes zanecodes mentioned this issue May 4, 2020
3 tasks
xorima added a commit that referenced this issue May 6, 2020
@StylusEaterChef
Copy link
Contributor

@zanecodes It looks like this was addressed with your code. Mind closing out the issue?

@xorima xorima closed this as completed Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants