For graphs G and H, let G⟶rbH denote the property that for every proper edge colouring of G there is a rainbow copy of H in G. Extending a result of Nenadov, Person, Škorić and Steger [J. Combin. Theory Ser. B 124 (2017),1-38], we determine the threshold for G(n,p)⟶rbCℓ for cycles Cℓ of any given length ℓ≥4.