I also facing the same issue while using the service connection name through variable groups inside the pipeline because variable groups consider the service connection name as a string, not a service connection. To fix this issue, create the variable inside the pipeline.