You might be interested in this answer by u/Total_Markage that gives a good overview of how the Turkic tribes moved into the Middle East
Parts of this answer by u/Interpine looks at the relationship between the Abbasids and Turkic leaders. Hopefully someone can expand more on it though