Another interpretation of (Gen. 39:1): "And Joseph was brought down to Egypt." This is what Scripture says (Eccl. 10:7): "I have seen slaves upon horses." This refers to Nebuchadnezzar, who destroyed the Temple, for he did not enter into it because he was afraid. What did Michael do? He descended and seized his horse, and brought him into the Holy of Holies. And the Holy Spirit says (ibid.): "I have seen slaves upon horses" — this is Nebuchadnezzar; "and princes walking like slaves upon the ground" (ibid.) — this is Michael, as it is said (Dan. 10:21): "except Michael your prince."
Michael Forces Nebuchadnezzar Into the Holy of Holies
Midrash Tanchuma Buber, Vayeshev 15:1
ד"א ויוסף הורד מצרימה. זש"ה ראיי עבדים על סוסים (קהלת י ז). זה נבוכדנצר שהחריב את בית המקדש, שלא נכנס לתוכו שהיה מתירא, מה עשה מיכאל ירד ואחז בסוסו, והכניסו לקודש הקדשים, ורוח הקודש אומרת ראיתי עבדים על סוסים, זה נבוכדנצר, ושרים הולכים כעבדים על הארץ (שם), זה מיכאל, שנאמר כי אם מיכאל שרכם (דניאל י כא).