Surface effects on a diffusion process governed by a fractional diffusion equation in a confined region with spatial and time dependent boundary conditions are investigated. First, we consider the one-dimensional case with the boundary conditions rho(0,t)=Phi0(t) and rho(a,t)=Phia(t). Subsequently, the two-dimensional case in the cylindrical symmetry with rho(a,theta,t)=Phia(theta,t) and rho(b,theta,t)=Phib(theta,t) is investigated. For these cases, we also obtain exact solutions for an arbitrary initial condition by using the Green's function approach.