We have been working on setting up thebuild definition on the on Premise TFS 2015 server, however are stuck with the proxy issue that’s coming while running a build task (Azure powershell). The build task actually makes a call out to Azure to add an authenticated account to be used for Azure cmdlets, but however getting blocked by the proxy server as seen below. We need a way to pass current user credentials to the Azure Powershell cmdlets, any help would be appreciated.
Error Message Network Access Message: The page cannot be displayed Technical Information (for Support personnel) Error Code: 407 Proxy Authentication Required. The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. (12209) IP Address: some IP address Date: 17/03/2017 09:03:58 [GMT] Server: ..com Source: proxy
Tried putting [System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
in the custom PowerShell script to be run as the task, however it gets blocked before entering the custom script. Basically, before running the custom script, Azure PowerShell build task tries to run Add-AzureRmAccount which makes a call out to Azure to add an authenticated account to be used for Azure cmdlets where it gets blocked by the proxy.