Derive Schwinger-Dyson equations in Srednicki In eq. (22.20) on p. 135 in Srednicki he defines the functional integral 
$$Z(J) = \int\mathcal{D}\phi\,\exp\Big[\mathrm{i}\big(S+\int\mathrm{d^4}y \,J_a\phi_a\big)\Big], \tag{A}$$ 
where $S$ and $J_a$ are the action and sources respectively (sum over $a$). What I don't get is that when he in eq. (22.21) considers a small variation $\delta Z$ he seem to get the variation of the action inside an integral (I get it without the integral) as follows:
$$0=\delta Z(J) = \mathrm{i}Z(J) \times \Bigg[\int \mathrm{d^4}x\Big(\,\frac{\delta S}{\delta \phi_a(x)}+J_a(x)\Big)\delta \phi_a(x)\Bigg].\tag{B}$$
My attempt: 
$$0=\delta Z(J) = \frac{\delta Z}{\delta\phi_b(x)}\delta\phi_b(x)\\[10mm]=\int \mathcal{D}\phi\,\delta\phi_b(x)\Bigg[\frac{\delta}{\delta\phi_b(x)}\mathrm{e}^{\mathrm{i}(S+\int\mathrm{d^4}y\,J_a(y)\phi_a(y))}\Bigg].\tag{C}$$
The box becomes: 
$$\Bigg[\frac{\delta}{\delta\phi_b(x)}\mathrm{e}^{\mathrm{i}(S+\int\mathrm{d^4}y\,J_a(y)\phi_a(y))}\Bigg] = \frac{\delta}{\delta\phi_a(y)}\mathrm{e}^{\mathrm{i}(S+\int\mathrm{d^4}y\,J_a(y)\phi_a(y))}\frac{\delta\phi_a(y)}{\delta\phi_b(x)}\\[10mm]=\delta_{ab}\delta^4(x-y)\mathrm{e}^{\mathrm{i}(S+\int\mathrm{d^4}y\,J_a(y)\phi_a(y))}\times\mathrm{i}\underbrace{\frac{\delta}{\delta\phi_a(y)}\Big(S+\int\mathrm{d^4}y\,J_a(y)\phi_a(y)\Big)}_{\Lambda}. \tag{D}$$
Lambda becomes (?)
$$\Lambda = \frac{\delta S}{\delta \phi_a(y)}+\int\mathrm{d^4}y J_a(y). \tag{E}$$
What I'm I doing wrong here? 
 A: Let's consider a single scalar field for simplicity.  The following step is a misapplication of the functional derivative:
\begin{align}
  \delta Z(J) = \frac{\delta Z}{\delta\phi(x)}\delta\phi(x)
\end{align}
By definition, one can only take the functional derivative of a functional $F$ with respect to $\phi$ if $F$ is a functional of $\phi$.  The functional $Z$ is not a functional of $\phi$ because $\phi$ is being integrated over in the functional integral.
What's going on here is a change of variables in the functional integral.  The measure is assumed to be invariant under this change of variables, so what's left is that the terms inside of the exponential can change.  To deal with the term involving $S$, we note that under the change of variables $\phi \to \phi + \delta\phi$, the action changes as follows:
\begin{align}
  S[\phi] \to S[\phi + \delta \phi] = S[\phi] + \delta S[\phi] + O(\delta\phi^2) \tag{A}
\end{align}
and for suitably well-behaved $S$, the first order change of the right hand side (namely $\delta S$) can be written as the integral of the functional derivative of $S$ with respect to $\phi$.  To see this, let's assume, for example, that $S$ is the integral of a local Lagrangian density depending on the field and its derivative;
\begin{align}
  S[\phi] = \int d^4x\, \mathscr L(\phi(x), \partial\phi (x)) \tag{B}
\end{align}
then, under appropriate boundary conditions, we obtain
\begin{align}
  \delta S[\phi] = \int d^4x\, \left[\frac{\partial\mathscr L}{\partial \phi} -\partial_\mu \frac{\partial\mathscr L}{\partial(\partial_\mu\phi)}\right] \delta\phi(x) \tag{C}
\end{align}
on the other hand, notice that
\begin{align}
  \int d^4x\frac{\delta S}{\delta\phi(x)}\delta \phi(x) 
  &= \int d^4x \,\delta\phi(x)\int d^4y \left[\frac{\partial\mathscr L}{\partial\phi}\frac{\delta\phi(y)}{\delta\phi(x)}+\frac{\partial\mathscr L}{\partial(\partial_\mu\phi)}\partial_\mu\frac{\delta\phi(y)}{\delta\phi(x)}\right] \\
  &= \int d^4x \,\delta\phi(x)\int d^4y \left[\frac{\partial\mathscr L}{\partial\phi}\delta(x-y)+\frac{\partial\mathscr L}{\partial(\partial_\mu\phi)}\partial_\mu\delta(x-y)\right]\\
  &=  \int d^4x\, \left[\frac{\partial\mathscr L}{\partial \phi} -\partial_\mu \frac{\partial\mathscr L}{\partial(\partial_\mu\phi)}\right] \delta\phi(x)
\end{align}
so in summary, we find that
\begin{align}
  \delta S[\phi] = \int d^4x\, \left[\frac{\partial\mathscr L}{\partial \phi} -\partial_\mu \frac{\partial\mathscr L}{\partial(\partial_\mu\phi)}\right] \delta\phi(x) \tag{D}
\end{align}
as noted in Srednicki.
Notes.  I used integration by parts and the following functional derivative identity in the computations above:
\begin{align}
  \frac{\delta\phi(x)}{\delta\phi(y)} = \delta(x-y)
\end{align}
which can be proven from the definition of the functional derivative.
A: I) The mentioned integral $\color{Red}{\int \!\mathrm{d}^4x}$ on the right-hand side of eq. (B) should really be there. If we define the action as 
$$\tag{1}S_J[\phi]~:=~S[\phi]+\int \!\mathrm{d}^4x~ J_a(x) \phi^a(x),$$ 
then the infinitesimal variation of the action reads
$$\tag{2}\delta S_J~=~ \color{Red}{\int \!\mathrm{d}^4x} ~\frac{\delta S_J}{\delta \phi^a(x)} ~\delta \phi^a(x).$$ 
Functional derivatives inside (2) are analogous to partial derivatives from the theory of functions $f=f(z)$ in several variables $z\in \mathbb{R}^n$. In the latter an infinitesimal variation reads
$$\tag{3} \delta f(z)~=~\color{Red}{\sum_{i=1}^n} \frac{\partial f(z)}{\partial z^i}\delta z^i. $$
The difference is that the sum $\color{Red}{\sum_{i=1}^n}$ in (3) is replaced by an integral $\color{Red}{\int \!\mathrm{d}^4x}$ in (2) to account for the fact that we now have infinitely many variables $\phi^a(x)$ (as opposed to $z^i$), labelled by a continous index $x\in \mathbb{R}^4$ (as opposed to a discrete index $i$).
II) Another issue is that one cannot replace the path integral on the right-hand side of OP's eq. (B) with $Z[J]$ since the path integral is supposed to integrate over the remainder of the right-hand side.  
