Variantly: "Listen, O heavens": R. Yehudah was wont to say: An analogy: A king had caretakers in the land, to whom he entrusted what was his. Giving them his son, he said to them: So long as my son does my will, indulge him and pamper him and give him food and drink; but if he does not do my will, let him taste nothing that is mine. Similarly, when Israel do G-d's will, what is written of them? (Devarim 28:12) "The L-rd shall open for you His goodly treasure trove, the heavens, to give to you the rain of your land in its time, etc." And when Israel do not do G-d's will, what is written of them? (Ibid. 11:17) "And the wrath of the L-rd will burn against you, and He will hold back the heavens and there will not be rain, and the ground will not yield its produce, etc."
Listen O Heavens - The Cosmic Contract with Israel
Sifrei Devarim 306:4