Insert and constrain whatever this pipe is going to terminate into (both ends.) Create a new part within the assembly. When you enter sketch mode, project the edges that will be the ends of the pipe and constrain your sketch of the cross section accordingly (it'll be a revolution.) When you've completed the revolve, change the constraints that you applied to define the length of the pipe. It should grow or shrink like your asking.