def getResourceGroups(self):
        """ Find nodeResourceGroup for the cluster.
            This can be determined by finding the resource groups that are managed_by 
            the cluater resource group ID
        """
        self.logger.debug("++ Azure cluster_rg: %s", self.cluster_rg)
        self.logger.debug("++ Azure cluster_node_rg: %s", self.cluster_node_rg)

        if self.cluster_node_rg is None:
            if self.cluster_rg is not None:
                """ get the nodeResouceGroup for the cluster ResourceGroup """
                crg = self.resource_client.resource_groups.get(self.cluster_rg)
                """ get resource groups managedBy the returned id e.g. crg.id == <>.managed_by """
                """ NOTE: azure python API resource selection filter does not appear to select correctly,
                So, query all resources and process here instead.
                """
                rgl = self.resource_client.resource_groups.list(None)
                for trg in rgl:
                    if trg.managed_by is not None:
                        if trg.managed_by.startswith(crg.id):
                            self.cluster_node_rg = trg.name
                            self.logger.info("++ Azure cluster_node_rg set to: %s", self.cluster_node_rg)
                            break
            else:
                """ Don't have the cluster resource group.
                    NOTE: it should be possible to determine it from the kubernetes cluster name.
                    however, the current (4/17/2019), python azure API doesn't support
                    querying aks by kubernetes cluster name.
                """
                self.logger.warning("Azure Cluster Resource Group is not specified.  Please specify as an argument.")
 Find nodeResourceGroup for the cluster.
            This can be determined by finding the resource groups that are managed_by 
            the cluater resource group ID
        
powerfulseal/clouddrivers/azure_driver.py