The highest law officer of a State government and its chief legal adviser, the State-level counterpart of the Attorney General of India.
Article 165, the "qualified to be a High Court judge" condition and the parallel with the Attorney General (Art 76) are standard State-executive facts, often tested as a matching pair.
The Advocate General (Art 165, State, qualified like a High Court judge) is the State counterpart of the Attorney General (Art 76, Union, qualified like a Supreme Court judge); he is appointed by the Governor, not the Chief Minister.
Art 165 highest law officer of a State, qualified like a High Court judge, holding office during the Governor's pleasure.