Deuteronomy 31:5

And the LORD shall give them up before your face, that ye may do unto them according unto all the commandments which I have commanded you.

The verse stands in the closing account of Moses' life and the transition to Joshua as Israel's leader. God placed Joshua in Moses' role as successor in command of Israel. It belongs to the final book's rehearsal of God's acts and law to Israel before Moses handed his work to another. More specifically, it falls within Moses' seventh discourse, which runs from Deuteronomy 31:2 to Deuteronomy 31:6.

It is part of Moses' final charge to the priests and to Joshua. That charge was given together with the delivering of the law to the priests. It was given together with the commissioning of Joshua as well.