Let $A\to B$ be a morphism of (commutative) algebras and $M$ a $B$-module. The $A$-bilinear map $B\times M\to M$ given by $(b,m)\mapsto bm$ induces a surjective homomorphism $B\otimes_{A}M\to M$.

Give sufficient and necessary (or at least sufficient) conditions for this mapping to be an isomorphism of $B$-modules.