Ensure aptpkg._consolidate_repo strips trailing slashes from repo_uri

This fixes #18909
Allow service_name to be specified for azure
Syntax/formatting.