I have an app service with a production (default) and test slot, and each slot has a private endpoint preventing public access to the apps. I'm able to use an azure pipeline to deploy to the production slot but I receive a 401 error when trying to deploy to the test slot. To deploy to the production slot, I had to add an application variable WEBSITE_WEBDEPLOY_USE_SCM=false to the app service's Configuration. The test slot has the same app variable set to false. The service connection for the pipeline to connect to the app has Contributor permissions. Is there something else that's missing?
Error: Error Code: ERROR_USER_UNAUTHORIZED
Error: The remote server returned an error: (401) Unauthorized.