Why is archangel Michael portrayed with a sword in art? There is no mention of Michael wielding a sword in the bible, so I wonder if there are references in other texts?
Michael the Archangel is depicted in the Bible as a warrior and leader of angel armies:

Daniel 12:1 (ESV)
At that time shall arise Michael, the great prince who has charge of your people. And there shall be a time of trouble, such as never has been since there was a nation till that time. But at that time your people shall be delivered, everyone whose name shall be found written in the book.
Jude 9 (ESV)
But when the archangel Michael, contending with the devil, was disputing about the body of Moses...
Revelation 12:7 (ESV)
Now war arose in heaven, Michael and his angels fighting against the dragon. And the dragon and his angels fought back...

Not surprisingly, the early church understood Michael in this way, that he was a leader of heavenly armies (see Ancient Christian Commentary). Later writers developed more detailed understandings of angel hierarchies, and continued treating Michael as a military leader (see Pseudo-Dionysius and the Apocalypse of the Virgin).
The primary weapon of war mentioned in the Bible is the sword, and it is commonly associated with spiritual warfare (e.g., Ro 13:4, Rev 1:16, and Eph 6:17), including God's final defeat of Satan (Isa 27:1).  The Bible also specifically mentions angels with swords in several places (Gen 3:24, Num 22:31, and 1 Ch 21:16).
Furthermore, in the time of early Christianity, the sword was the weapon associated with the upper classes and military leaders.  The scene from Revelation is depicted in the statue below, where Michael is defeating the serpent, and we can see that he is portrayed much like a Roman soldier, complete with a sword:

Given the biblical mentions of angels carrying swords and the use of swords in spiritual warfare, plus the historical predominance of the sword as a leader's military weapon, it's not surprising that Christians would depict the leader of heavenly armies carrying a weapon suitable for his position: a sword.