Leviticus 26:3
2 You must keep my Sabbaths and reverence my sanctuary. I am the Lord. 3 “‘If you walk in my statutes and are sure to obey my commandments, 4 I will give you your rains in their time so that the land will give its yield and the trees of the field will produce their fruit. 5 Threshing season will extend for you until the season for harvesting grapes, and the season for harvesting grapes will extend until sowing season, so you will eat your bread until you are satisfied, and you will live securely in your land.
Jeremiah 3:3
2 “Look up at the hilltops and consider this. Where have you not been ravished? You waited for those gods like a thief lying in wait in the wilderness. You defiled the land by your wicked prostitution to other gods. 3 That is why the rains have been withheld and the spring rains have not come. Yet in spite of this you are obstinate as a prostitute. You refuse to be ashamed of what you have done. 4 Even now you say to me, ‘You are my father! You have been my faithful companion ever since I was young. 5 You will not always be angry with me, will you? You will not be mad at me forever, will you?’ That is what you say, but you continually do all the evil that you can.”
Notes and References
"... While Palestine is a semi-arid land, the drought in this case is not thought to be due to any climatological cycle but is seen instead as divine punishment for sin (compare Deuteronomy 28:23-24). The Bible contains passages that indicate that rains are the reward for obedience (Leviticus 26:3-4: Deuteronomy 11:13-14), and others that indicate that drought is indeed the punishment for disobedience (Deuteronomy 28:23-24; Jeremiah 3:3; Joel 2:23). Perhaps the best parallel for this phenomenon is in the very next chapter: 'When I shut up the heavens so that there is no rain, or command the locust to devour the land, or send pestilence against my people, if my people over whom my name is called humble themselves, and pray and seek my face, and turn from their evil ways, then I will hear from heaven and I will forgive their sin and heal their land' (2 Chronicles 7:13-14) ..."
Klein, Ralph W. 2 Chronicles: A Commentary (p. 94) Fortress Press, 2012