Asking for a letter of recommendation from someone on a hiring committee that is also reviewing your application
In many, and I hope most, places your friend will need to recuse from the decision to hire you even if they don't write a letter. Given that, assuming it is true, getting a letter from them isn't an issue.
But you can ask, first, for their advice on whether a letter from them would be helpful or not. It is even possible, I suppose, that rules would make such a letter off limits for consideration, though I think that would be rare.
It might be that an informal verbal recommendation from them to the hiring committee would carry weight (if not seen as improper), in which case a letter from someone else would be valuable.
But either avoid the issue completely by asking someone else for a letter or explore it with your friend first.