Answer
Jahan Shah, the founder of the Afsharid dynasty, used Azerbaijani as the language of his court. This was a departure from the previous practice of using Persian as the official language of the court. Jahan Shah's decision to use Azerbaijani was likely motivated by his desire to appeal to the Turkic-speaking population of Iran.