Failed to create secret Unauthorized - AKS Azure - CreateSecret Action in KubernetesManifest Task

Rehaan 26 Reputation points
2023-02-13T12:51:16.7666667+00:00
Starting: KubernetesManifest
==============================================================================
Task         : Deploy to Kubernetes
Description  : Use Kubernetes manifest files to deploy to clusters or even bake the manifest files to be used for deployments using Helm charts
Version      : 0.212.0
Author       : Microsoft Corporation
Help         : https://aka.ms/azpipes-k8s-manifest-tsg
==============================================================================
==============================================================================
			Kubectl Client Version: v1.26.1
	Kubectl Server Version: Could not find kubectl server version
==============================================================================
/usr/local/bin/kubectl delete secret k8sexamplesacrauth --insecure-skip-tls-verify --namespace 
namespace-name
 
E0213 11:23:38.679583    1587 memcache.go:238] couldn't get current server API group list: the server has asked for the client to provide credentials
E0213 11:23:38.707383    1587 memcache.go:238] couldn't get current server API group list: the server has asked for the client to provide credentials
E0213 11:23:38.735107    1587 memcache.go:238] couldn't get current server API group list: the server has asked for the client to provide credentials
E0213 11:23:38.763074    1587 memcache.go:238] couldn't get current server API group list: the server has asked for the client to provide credentials
E0213 11:23:38.790777    1587 memcache.go:238] couldn't get current server API group list: the server has asked for the client to provide credentials
error: You must be logged in to the server (the server has asked for the client to provide credentials)
/usr/local/bin/kubectl create secret docker-registry k8sexamplesacrauth --docker-username *** --docker-password *** --docker-server *** --docker-email ServicePrincipal@AzureRM --insecure-skip-tls-verify --namespace namespace-name
error: failed to create secret Unauthorized
##[error]error: failed to create secret Unauthorized
Finishing: KubernetesManifest

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
42,882 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.