  We compute the worldsheet sphere partition function of string theory on
global AdS$_3$ with pure NS-NS flux. Because of an unfixed M\"obius symmetry on
the worldsheet, there is a cancellation of infinities and only a part of the
answer is unambiguous. We show that it precisely reproduces the holographic
Weyl anomaly and the ambiguous terms correspond to the possible counterterms of
the boundary CFT.
