-
Notifications
You must be signed in to change notification settings - Fork 336
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
azure_rm_aks_info fails when using new AzureAD authentication experience #225
Comments
@adhodgson1 I tested it locally and didn't have any errors getting aks info. Can you share your complete PlayBook? In addition, please help to provide "pip3 list" information. Thank you very much! |
I'm getting the same error for playbooks that target an Azure AKS Cluster that is using Managed Identities instead of Service Principals. To reproduce this issues you might have to create an AKS Cluster with managed identities first. az aks create -g myResourceGroup -n myManagedCluster --enable-managed-identity https://docs.microsoft.com/en-us/azure/aks/use-managed-identity |
Please find here the required information: Playbook example:
And the resulting output:
Thanks in advance for your help! |
I followed the method you said to test locally, or did not encounter the above problems? Thank you! |
@foofoo-2 Can you try upgrading ansible-collection to the latest version? Thank you!
|
@Fred-sun: I did a quick test with the latest version of the collection (1.0.0) and same problem occurs. |
Thank you for your feedback, I will keep watching. Thank you! |
I just reproduced this on a cluster that used managed identities as well. If you create the cluster using the azure_rm_aks module you're good to go but if you create it using the Azure CLI or an ARM template with either the managed identity or managed AAD features then use the azure_rm_aks_info module to get information about the cluster you will run into the same issue. |
Unfortunately we are not using the |
Recommendation when testing this: use the ansible module of If there is something wrong with the collection installation it can be silently swallowed and you will be using the code from upstream ansible. If you use the fully qualified module reference that can't happen. E.g. in the stacktrace at the top of this ticket:
That path pattern " I don't think this really changes this ticket, @foofoo-2 reproduced the bug and from their stack trace you can see the correct path pattern. Having been super confused recently about "why doesn't the behavior match the code" I'm trying to help spread the word :-) |
Any news on this issue? Thanks |
Looks like the whole implementation is outdated, not just While current azure documentation tells
the current ansible-collections / azure only supports former, not latter azure/plugins/modules/azure_rm_aks.py Line 121 in 9e20c6e
service_principal as required and allows no system-assigned managed identity.
The plugins/modules/azure_rm_aks.py implementation is created by some microsoft guy in 2018 and has been updated since migration to ansible-collections only once (nodepools feature #440) https://github.com/ansible-collections/azure/commits/dev/plugins/modules/azure_rm_aks.py Somebody needs to update the implementation. I had a look at the implementation and I doubt I can just fix that particular problem without reworking the whole module. May be we can drive Microsoft's attention to this outdated piece of software so they make using (buying) their services easier for us. |
Same problem here. Clusters created with Managed Identities fail to use the azure/plugins/modules/azure_rm_aks.py Line 515 in 45259c4
|
Workaround using the aks_rm_info module:
|
@adhodgson1 I have not had any problems with the latest version of Azure Collection. Can you upgrade to latest to retry. Thank you very much!
|
Fred, is your cluster created with Managed Identities? Not specified in your az cli shell, not sure what's the default these days. Maybe you can post a debug of the 'output' var to verify? |
Like this
|
Cool, seems fixed indeed: servicePrincipalProfile": { 🙏 |
Ok, I will closed it! |
SUMMARY
Azure has just released a new cluster AzureAD integration experience which manages the client and server applications for you. For any cluster that is using this new experience, the azure_rm_aks_info module fails because some of the AAD profile parameters returned are now Null. A workarround for us is to use azure_rm_resource_info instead.
ISSUE TYPE
COMPONENT NAME
azure_rm_aks_info
ANSIBLE VERSION
ansible 2.9.11
STEPS TO REPRODUCE
EXPECTED RESULTS
Lookup completes successfully.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: