In scalar fiel theory the two point function is given by $$\langle{0}| T\phi(x) \phi(y) |0\rangle= \int D[\phi] \phi(x) \phi(y) \exp[i\int d^4x\mathcal{L_{scalar}}]$$ introducing the the generating functional
$$Z=\int D\phi \exp[i\int d^4x(\mathcal{L_{scalar}}+J\phi )]$$ we have
$$\langle{0}| T\phi(x) \phi(y) |0\rangle=\frac{1}{i^2} \frac{\delta Z[J]}{\delta J (x) \delta J (y)}\bigg|_{J=0}$$ Now in QED the interacting photon propagator is given by
$$\langle{0}| TA_\mu(x) A_\nu(x)|0\rangle=\int [DA] A_\mu(x) A_\nu(y) \exp[i\int d^4x \mathcal{L_{qed}}]\tag 1$$
where $$\mathcal{L_{qed}} =\overline{\psi}(-i\gamma^\mu \partial_\mu +m)\psi+\frac{1}{4}F^{\mu \nu}F_{\mu \nu}+J^{\mu}A_\mu$$ with $J^{\mu} = \bar{\psi} \gamma^{\mu} \psi$
Now usually in textbooks they define $$Z=\int DA \exp[i\int d^4x\mathcal{L_{qed}} ] $$
and $$\langle{0}| TA_\mu(x) A_\nu(y)|0\rangle=\frac{1}{i^2} \frac{\delta Z[J]}{\delta J^\mu(x) \delta J^\nu (y)}\bigg|_{J=0} \tag 2$$
But if we put $J=0$ we are turning the interaction off. Shouldn't we have $$\langle{0}| TA_\mu(x) A_\nu(y)|0\rangle=\frac{1}{i^2} \frac{\delta Z[J]}{\delta J^\mu(x) \delta J^\nu (y)}~? \tag 3$$ Then we would have $ (1)=(3).$