It was not long before he was called on to defend the dignity and independence of his office against the Austrian government, which, even under Maria Theresa, was foreshadowing the reign of Joseph II. Despite his great devotion to Maria Theresa, he more than once resisted the improper exactions of her ministers, who wished him to grant Lenten dispensations according to their pleasure, and interfered in the most annoying manner in matters that pertained exclusively to ecclesiastical jurisdiction. He enjoyed, however, the personal favour of Maria Theresa, who sought to have him made Archbishop of Vienna, and in 1778 exerted herself to the uttermost to obtain for him the cardinal's hat.