1 Samuel 23:2shaal
So David inquired of the Lord, saying, "Shall I go and attack these Philistines?" And the Lord said to David, "Go and attack the Philistines and deliver Keilah."
David asks God whether to fight, and God answers.
Ezekiel 20:3darash
"Son of man, speak to the elders of Israel and say to them, 'Thus says the Lord GOD, "Do you come to inquire of Me? As I live," declares the Lord GOD, "I will not be inquired of by you."'
God refuses to be inquired of by unfaithful elders.