srinipadala We have followed this document to the . and we are still stuck and can't complete the kubectl commands.
Our setup
1. Private AKS cluster
2. Agent in the same Vnet
3. Azure devops pipeline can't run we get the following
/usr/local/bin/kubectl apply -f deploy.yaml -o json
##[debug]Called Toolrunner exec() method asynchronously. Returning the promise.
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code ZZZZZZ to authenticate.
Unable to connect to the server: context deadline exceeded (Client.Timeout exceeded while awaiting headers)
##[debug]Exit code 1 received from tool '/usr/local/bin/kubectl'
##[debug]STDIO streams have closed for tool '/usr/local/bin/kubectl'
##[debug]Toolrunner exec() method returned error for the kubectl command. Error: Error: The process '/usr/local/bin/kubectl' failed with exit code 1.
##[error]To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code XXXXXXX to authenticate.
##[debug]Processed: ##vso[task.issue type=error;]To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code XXXXXX to authenticate.
##[error]Unable to connect to the server: context deadline exceeded (Client.Timeout exceeded while awaiting headers)
##[debug]Processed: ##vso[task.issue type=error;]Unable to connect to the server: context deadline exceeded (Client.Timeout exceeded while awaiting headers)