The duct by which urine passes from the kidney to the bladder or cloaca.