Anas bin Malik reported,

While the Messenger of Allah ﷺ was delivering the Friday sermon, a man came to him and said, "Messenger of Allah, the rain has stopped. Pray to Allah to send us rain."So he prayed, and we were drenched with rain. We could hardly reach our homes, and the rain continued until the following Friday.Then that man, or another, stood up and said, "Messenger of Allah, pray to Allah to divert it from us."The Messenger of Allah ﷺ said, "O Allah, around us and not upon us."I then saw the clouds splitting away to the right and the left, raining upon those areas while the people of Madinah received no rain.

Bukhari 1015

Sahih

حدثنا مسدد قال حدثنا أبو عوانة عن قتادة

عن أنس بن مالك قال

بينما رسول الله ﷺ يخطب يوم الجمعة إذ جاءه رجل فقال يا رسول الله قحط المطر فادع الله أن يسقينا فدعا فمطرنا فما كدنا أن نصل إلى منازلنا فما زلنا نمطر إلى الجمعة المقبلة قال فقام ذلك الرجل أو غيره فقال يا رسول الله ادع الله أن يصرفه عنا فقال رسول الله ﷺ اللهم حوالينا ولا علينا قال فلقد رأيت السحاب يتقطع يمينا وشمالا يمطرون ولا يمطر أهل المدينة

البخاري 1015صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Istisqa
Chapter
Praying for rain on the minbar
Numbering
Darussalam 1015
Bukhari 1015