The Verse: "Obey Allah and Obey the Apostle and those of you (Muslims) who are in authority." (4.59) was revealed in connection with ʿAbdullah bin Hudhafa bin Qais bin ʿAdi' when the Prophet ﷺ appointed him as the commander of a Sariyya (army detachment).
عَنِ ابْنِ عَبَّاسٍ ؓ {أَطِيعُوا اللَّهَ وَأَطِيعُوا الرَّسُولَ وَأُولِي الأَمْرِ مِنْكُمْ} قَالَ نَزَلَتْ فِي عَبْدِ اللَّهِ بْنِ حُذَافَةَ بْنِ قَيْسِ بْنِ عَدِيٍّ إِذْ بَعَثَهُ النَّبِيُّ ﷺ فِي سَرِيَّةٍ