Anti tumour necrosis factor (anti-TNF) drugs increase the risk of serious respiratory infection and impair protective immunity following pneumococcal and influenza vaccination. Here we report SARS-CoV-2 vaccine-induced immune responses and breakthrough infections in patients with inflammatory bowel disease, who are treated either with the anti-TNF antibody, infliximab, or with vedolizumab targeting a gut-specific anti-integrin that does not impair systemic immunity. Geometric mean [SD] anti-S RBD antibody concentrations are lower and half-lives shorter in patients treated with infliximab than vedolizumab, following two doses of BNT162b2 (566.7 U/mL [6.2] vs 4555.3 U/mL [5.4], p <0.0001; 26.8 days [95% CI 26.2 - 27.5] vs 47.6 days [45.5 - 49.8], p <0.0001); similar results are also observed with ChAdOx1 nCoV-19 vaccination (184.7 U/mL [5.0] vs 784.0 U/mL [3.5], p <0.0001; 35.9 days [34.9 - 36.8] vs 58.0 days [55.0 - 61.3], p value < 0.0001). One fifth of patients fail to mount a T cell response in both treatment groups. Breakthrough SARS-CoV-2 infections are more frequent (5.8% (201/3441) vs 3.9% (66/1682), p = 0.0039) in patients treated with infliximab than vedolizumab, and the risk of breakthrough SARS-CoV-2 infection is predicted by peak anti-S RBD antibody concentration after two vaccine doses. Irrespective of the treatments, higher, more sustained antibody levels are observed in patients with a history of SARS-CoV-2 infection prior to vaccination. Our results thus suggest that adapted vaccination schedules may be required to induce immunity in at-risk, anti-TNF-treated patients.