Language:
كتاب المغازى
64  
Military Expeditions led by the Prophet (pbuh) (Al-Maghaazi)
(83)
Chapter: The sickness of the Prophet (saws) and his death
(83)
بَابُ مَرَضِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ وَوَفَاتِهِ
Sahih al-Bukhari 4459

Narrated Al-Aswad:

It was mentioned in the presence of `Aisha that the Prophet (ﷺ) had appointed `Ali as successor by will. Thereupon she said, "Who said so? I saw the Prophet, while I was supporting him against my chest. He asked for a tray, and then fell on one side and expired, and I did not feel it. So how (do the people say) he appointed `Ali as his successor?"

حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مُحَمَّدٍ، أَخْبَرَنَا أَزْهَرُ، أَخْبَرَنَا ابْنُ عَوْنٍ، عَنْ إِبْرَاهِيمَ، عَنِ الأَسْوَدِ، قَالَ ذُكِرَ عِنْدَ عَائِشَةَ أَنَّ النَّبِيَّ صلى الله عليه وسلم أَوْصَى إِلَى عَلِيٍّ، فَقَالَتْ مَنْ قَالَهُ لَقَدْ رَأَيْتُ النَّبِيَّ صلى الله عليه وسلم وَإِنِّي لَمُسْنِدَتُهُ إِلَى صَدْرِي، فَدَعَا بِالطَّسْتِ فَانْخَنَثَ فَمَاتَ، فَمَا شَعَرْتُ، فَكَيْفَ أَوْصَى إِلَى عَلِيٍّ
Reference : Sahih al-Bukhari 4459
In-book reference : Book 64, Hadith 475
USC-MSA web (English) reference : Vol. 5, Book 59, Hadith 736
  (deprecated numbering scheme)