Open im-konge opened 2 years ago
Hi,
before some kind of upgrade of az-cli, our automation with ServicePrincipal was working without a problem.
Currently, we are able to create ARO clusters using the ServicePrincipal, but we are getting exceptions when we are trying to delete it.
The thing is that we already added Owner
role to our ServicePrincipal, which was sufficient before.
What else should be set (what permissions) for successfully deleting the cluster?
Also, isn't a bit strange that we are able to create clusters, but not delete them?
This is more question than bug report.
Thank you for your feedback. This has been routed to the support team for assistance.
route to CXP team
I encountered the exact same problem. What is the status of this issue?
Any progress on this issue?
@jiasli, could you please take a look?
As mentioned by a commenter on the related #27146 this error is coming from AAD. I have seen this same behavior before when comparing a run of this command with my personal account which matched an automation service principal against the Azure subscription. It always worked for me but failed for the automation service principal because the automation service principal was heavily locked down and had no permissions to read or list anything in AAD.
The documentation at https://learn.microsoft.com/en-us/azure/openshift/tutorial-delete-cluster does not cover any permissions needed for the service principal executing the command against AAD but based on the error message performing rp_client_sp_id = aad.get_service_principal_id(resolve_rp_client_id()) sps = self.client.service_principal_list(f"appId eq '{app_id}'") result = self._send("GET", "/servicePrincipals" + _filter_to_query(filter)) there are actions taken in AAD which would require some type of permissions outside of the Azure Subscription.
If there is an assumption for minimum permissions needed for az cli I cannot find it documented anywhere. What are the minimum permissions needed outside of the Azure subscription and within the AAD tenant itself to perform az aro delete?
Also for anyone unsure if they are hitting this the clear signal is that you have all the right inputs but nothing shows up in the Azure Subscription Activity Log. Why? Because it fails at AAD before it ever hits the Azure Subscription with the cluster.
I suspect the calling of az aro delete needs to look up the Azure Red Hat OpenShift RP enterprise app registration as it will have a different app id in each customer's tenant and it is needed to execute the actual deletion as it was used in provisioning the cluster. Calling az aro delete is simply the trigger for "Azure Red Hat OpenShift RP" to do the work.
Is there any progress on this issue? It's opened for quite a long time and I'm a bit blocked on this -> as I cannot upgrade to latest version of the CLI, but I need to delete the clusters using service principal in our automation.
I also see that the other issues that are related to this one are not resolved. Is it matter of permissions that need to be documented somewhere? Is it a bug in the CLI itself? Is there anything we can do to fix that?
Thanks for the answers.
This is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az aro delete
Errors:
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
az aro delete --name {} --resource-group {} -y
Expected Behavior
Environment Summary
Additional Context