code: def list_resource_groups(call=None):
      '''
      List resource groups associated with the subscription
      '''
      if call == 'action':
          raise SaltCloudSystemExit(
              'The list_hosted_services function must be called with '
              '-f or --function'
          )
  
      resconn = get_conn(client_type='resource')
      ret = {}
      try:
          groups = resconn.resource_groups.list()
  
          for group_obj in groups:
              group = group_obj.as_dict()
              ret[group['name']] = group
      except CloudError as exc:
          __utils__['azurearm.log_cloud_error']('resource', exc.message)
          ret = {'Error': exc.message}
  
      return ref list_resource_groups(call=None):
      '''
      List resource groups associated with the subscription
      '''
      if call == 'action':
          raise SaltCloudSystemExit(
              'The list_hosted_services function must be called with '
              '-f or --function'
          )
  
      resconn = get_conn(client_type='resource')
      ret = {}
      try:
          groups = resconn.resource_groups.list()
  
          for group_obj in groups:
              group = group_obj.as_dict()
              ret[group['name']] = group
      except CloudError as exc:
          __utils__['azurearm.log_cloud_error']('resource', exc.message)
          ret = {'Error': exc.message}
  
      return ret
docs: List resource groups associated with the subscription