code: def avail_locations(call=None):
      '''
      Return a dict of all available regions.
      '''
      if call == 'action':
          raise SaltCloudSystemExit(
              'The avail_locations function must be called with '
              '-f or --function, or with the --list-locations option'
          )
  
      ret = {}
      ret['locations'] = []
  
      try:
          resconn = get_conn(client_type='resource')
          provider_query = resconn.providers.get(
              resource_provider_namespace='Microsoft.Compute'
          )
          locations = []
          for resource in provider_query.resource_types:
              if six.text_type(resource.resource_type) == 'virtualMachines':
                  resource_dict = resource.as_dict()
                  locations = resource_dict['locations']
          for location in locations:
              lowercase = location.lower().replace(' ', '')
              ret['locations'].append(lowercase)
      except CloudError as exc:
          __utils__['azurearm.log_cloud_error']('resource', exc.message)
          ret = {'Error': exc.message}
  
      return ref avail_locations(call=None):
      '''
      Return a dict of all available regions.
      '''
      if call == 'action':
          raise SaltCloudSystemExit(
              'The avail_locations function must be called with '
              '-f or --function, or with the --list-locations option'
          )
  
      ret = {}
      ret['locations'] = []
  
      try:
          resconn = get_conn(client_type='resource')
          provider_query = resconn.providers.get(
              resource_provider_namespace='Microsoft.Compute'
          )
          locations = []
          for resource in provider_query.resource_types:
              if six.text_type(resource.resource_type) == 'virtualMachines':
                  resource_dict = resource.as_dict()
                  locations = resource_dict['locations']
          for location in locations:
              lowercase = location.lower().replace(' ', '')
              ret['locations'].append(lowercase)
      except CloudError as exc:
          __utils__['azurearm.log_cloud_error']('resource', exc.message)
          ret = {'Error': exc.message}
  
      return ret
docs: Return a dict of all available regions.