<p>I would request if someone can help in why my release pipeline to AKS cluster is failing. I'm using Azure Devops Release pipeline.</p>
<pre><code>2020-09-02T10:56:33.1944594Z ##[section]Starting: kubectl create app and service or apply
2020-09-02T10:56:33.2380678Z ==============================================================================
2020-09-02T10:56:33.2381778Z Task         : Kubectl
2020-09-02T10:56:33.2384698Z Description  : Deploy, configure, update a Kubernetes cluster in Azure Container Service by running kubectl commands
2020-09-02T10:56:33.2385174Z Version      : 1.173.0
2020-09-02T10:56:33.2386143Z Author       : Microsoft Corporation
2020-09-02T10:56:33.2387216Z Help         : https://aka.ms/azpipes-kubectl-tsg
2020-09-02T10:56:33.2387656Z ==============================================================================
2020-09-02T10:56:34.9075560Z Downloading: https://storage.googleapis.com/kubernetes-release/release/v1.7.0/bin/windows/amd64/kubectl.exe
2020-09-02T10:56:37.8112374Z Caching tool: kubectl 1.7.0 x64
2020-09-02T10:56:37.9135761Z Prepending PATH environment variable with directory: C:\hostedtoolcache\windows\kubectl\1.7.0\x64
2020-09-02T10:56:40.4896282Z Could not fetch Kubectl version. Please make sure that the Kubernetes server is up and running.
2020-09-02T10:56:40.5241929Z [command]C:\hostedtoolcache\windows\kubectl\1.7.0\x64\kubectl.exe apply -f D:\a\r1\a\_praneshshzl_AKSCICDDEMO\aksdeploy.yml -o json
2020-09-02T10:56:49.8395443Z {
2020-09-02T10:56:49.8397440Z     &quot;apiVersion&quot;: &quot;apps/v1&quot;,
2020-09-02T10:56:49.8398489Z     &quot;kind&quot;: &quot;Deployment&quot;,
2020-09-02T10:56:49.8399348Z     &quot;metadata&quot;: {
2020-09-02T10:56:49.8400030Z         &quot;annotations&quot;: {
2020-09-02T10:56:49.8401188Z             &quot;deployment.kubernetes.io/revision&quot;: &quot;2&quot;,
2020-09-02T10:56:49.8404455Z             &quot;kubectl.kubernetes.io/last-applied-configuration&quot;: &quot;{\&quot;apiVersion\&quot;:\&quot;apps/v1\&quot;,\&quot;kind\&quot;:\&quot;Deployment\&quot;,\&quot;metadata\&quot;:{\&quot;annotations\&quot;:{},\&quot;name\&quot;:\&quot;aspx-deployment\&quot;,\&quot;namespace\&quot;:\&quot;default\&quot;},\&quot;spec\&quot;:{\&quot;replicas\&quot;:2,\&quot;selector\&quot;:{\&quot;matchLabels\&quot;:{\&quot;app\&quot;:\&quot;asp-net\&quot;}},\&quot;template\&quot;:{\&quot;metadata\&quot;:{\&quot;labels\&quot;:{\&quot;app\&quot;:\&quot;asp-net\&quot;}},\&quot;spec\&quot;:{\&quot;containers\&quot;:[{\&quot;image\&quot;:\&quot;***/drop:40\&quot;,\&quot;name\&quot;:\&quot;asp\&quot;,\&quot;ports\&quot;:[{\&quot;containerPort\&quot;:80}]}]}}}}\n&quot;
2020-09-02T10:56:49.8406762Z         },
2020-09-02T10:56:49.8407640Z         &quot;creationTimestamp&quot;: &quot;2020-09-02T07:19:54Z&quot;,
2020-09-02T10:56:49.8408392Z         &quot;generation&quot;: 2,
2020-09-02T10:56:49.8409051Z         &quot;name&quot;: &quot;aspx-deployment&quot;,
2020-09-02T10:56:49.8409752Z         &quot;namespace&quot;: &quot;default&quot;,
2020-09-02T10:56:49.8410403Z         &quot;resourceVersion&quot;: &quot;19157&quot;,
2020-09-02T10:56:49.8411229Z         &quot;selfLink&quot;: &quot;/apis/apps/v1/namespaces/default/deployments/aspx-deployment&quot;,
2020-09-02T10:56:49.8412093Z         &quot;uid&quot;: &quot;57c18e4d-0583-43bc-b0c4-58d6bb2c9069&quot;
2020-09-02T10:56:49.8413323Z     },
2020-09-02T10:56:49.8413859Z     &quot;spec&quot;: {
2020-09-02T10:56:49.8414348Z         &quot;progressDeadlineSeconds&quot;: 600,
2020-09-02T10:56:49.8414799Z         &quot;replicas&quot;: 2,
2020-09-02T10:56:49.8415097Z         &quot;revisionHistoryLimit&quot;: 10,
2020-09-02T10:56:49.8415368Z         &quot;selector&quot;: {
2020-09-02T10:56:49.8415640Z             &quot;matchLabels&quot;: {
2020-09-02T10:56:49.8416109Z                 &quot;app&quot;: &quot;asp-net&quot;
2020-09-02T10:56:49.8416360Z             }
2020-09-02T10:56:49.8416549Z         },
2020-09-02T10:56:49.8416778Z         &quot;strategy&quot;: {
2020-09-02T10:56:49.8417054Z             &quot;rollingUpdate&quot;: {
2020-09-02T10:56:49.8417341Z                 &quot;maxSurge&quot;: &quot;25%&quot;,
2020-09-02T10:56:49.8417658Z                 &quot;maxUnavailable&quot;: &quot;25%&quot;
2020-09-02T10:56:49.8417927Z             },
2020-09-02T10:56:49.8418189Z             &quot;type&quot;: &quot;RollingUpdate&quot;
2020-09-02T10:56:49.8418422Z         },
2020-09-02T10:56:49.8418649Z         &quot;template&quot;: {
2020-09-02T10:56:49.8419141Z             &quot;metadata&quot;: {
2020-09-02T10:56:49.8419452Z                 &quot;creationTimestamp&quot;: null,
2020-09-02T10:56:49.8419748Z                 &quot;labels&quot;: {
2020-09-02T10:56:49.8420044Z                     &quot;app&quot;: &quot;asp-net&quot;
2020-09-02T10:56:49.8420308Z                 }
2020-09-02T10:56:49.8420525Z             },
2020-09-02T10:56:49.8420745Z             &quot;spec&quot;: {
2020-09-02T10:56:49.8422686Z                 &quot;containers&quot;: [
2020-09-02T10:56:49.8422953Z                     {
2020-09-02T10:56:49.8423661Z                         &quot;image&quot;: &quot;***/drop:40&quot;,
2020-09-02T10:56:49.8424053Z                         &quot;imagePullPolicy&quot;: &quot;IfNotPresent&quot;,
2020-09-02T10:56:49.8424416Z                         &quot;name&quot;: &quot;asp&quot;,
2020-09-02T10:56:49.8424731Z                         &quot;ports&quot;: [
2020-09-02T10:56:49.8425016Z                             {
2020-09-02T10:56:49.8425324Z                                 &quot;containerPort&quot;: 80,
2020-09-02T10:56:49.8425698Z                                 &quot;protocol&quot;: &quot;TCP&quot;
2020-09-02T10:56:49.8426026Z                             }
2020-09-02T10:56:49.8426285Z                         ],
2020-09-02T10:56:49.8426562Z                         &quot;resources&quot;: {},
2020-09-02T10:56:49.8426957Z                         &quot;terminationMessagePath&quot;: &quot;/dev/termination-log&quot;,
2020-09-02T10:56:49.8427380Z                         &quot;terminationMessagePolicy&quot;: &quot;File&quot;
2020-09-02T10:56:49.8427696Z                     }
2020-09-02T10:56:49.8427918Z                 ],
2020-09-02T10:56:49.8428205Z                 &quot;dnsPolicy&quot;: &quot;ClusterFirst&quot;,
2020-09-02T10:56:49.8428542Z                 &quot;restartPolicy&quot;: &quot;Always&quot;,
2020-09-02T10:56:49.8428896Z                 &quot;schedulerName&quot;: &quot;default-scheduler&quot;,
2020-09-02T10:56:49.8429231Z                 &quot;securityContext&quot;: {},
2020-09-02T10:56:49.8429585Z                 &quot;terminationGracePeriodSeconds&quot;: 30
2020-09-02T10:56:49.8429873Z             }
2020-09-02T10:56:49.8430792Z         }
2020-09-02T10:56:49.8431012Z     },
2020-09-02T10:56:49.8431285Z     &quot;status&quot;: {
2020-09-02T10:56:49.8431559Z         &quot;availableReplicas&quot;: 2,
2020-09-02T10:56:49.8431825Z         &quot;conditions&quot;: [
2020-09-02T10:56:49.8432059Z             {
2020-09-02T10:56:49.8432383Z                 &quot;lastTransitionTime&quot;: &quot;2020-09-02T07:19:54Z&quot;,
2020-09-02T10:56:49.8432798Z                 &quot;lastUpdateTime&quot;: &quot;2020-09-02T07:37:15Z&quot;,
2020-09-02T10:56:49.8433255Z                 &quot;message&quot;: &quot;ReplicaSet \&quot;aspx-deployment-84597d88f5\&quot; has successfully progressed.&quot;,
2020-09-02T10:56:49.8434044Z                 &quot;reason&quot;: &quot;NewReplicaSetAvailable&quot;,
2020-09-02T10:56:49.8434679Z                 &quot;status&quot;: &quot;True&quot;,
2020-09-02T10:56:49.8435244Z                 &quot;type&quot;: &quot;Progressing&quot;
2020-09-02T10:56:49.8435605Z             },
2020-09-02T10:56:49.8435825Z             {
2020-09-02T10:56:49.8436146Z                 &quot;lastTransitionTime&quot;: &quot;2020-09-02T10:53:01Z&quot;,
2020-09-02T10:56:49.8436562Z                 &quot;lastUpdateTime&quot;: &quot;2020-09-02T10:53:01Z&quot;,
2020-09-02T10:56:49.8436957Z                 &quot;message&quot;: &quot;Deployment has minimum availability.&quot;,
2020-09-02T10:56:49.8437364Z                 &quot;reason&quot;: &quot;MinimumReplicasAvailable&quot;,
2020-09-02T10:56:49.8437756Z                 &quot;status&quot;: &quot;True&quot;,
2020-09-02T10:56:49.8438064Z                 &quot;type&quot;: &quot;Available&quot;
2020-09-02T10:56:49.8438304Z             }
2020-09-02T10:56:49.8438510Z         ],
2020-09-02T10:56:49.8438765Z         &quot;observedGeneration&quot;: 2,
2020-09-02T10:56:49.8439067Z         &quot;readyReplicas&quot;: 2,
2020-09-02T10:56:49.8439325Z         &quot;replicas&quot;: 2,
2020-09-02T10:56:49.8439604Z         &quot;updatedReplicas&quot;: 2
2020-09-02T10:56:49.8439834Z     }
2020-09-02T10:56:49.8440256Z }
2020-09-02T10:56:50.0434980Z error: error validating &quot;D:\\a\\r1\\a\\_praneshshzl_AKSCICDDEMO\\aksdeploy.yml&quot;: error validating data: the server could not find the requested resource; if you choose to ignore these errors, turn validation off with --validate=false
2020-09-02T10:56:50.0592077Z commandOutput{
2020-09-02T10:56:50.0592764Z     &quot;apiVersion&quot;: &quot;apps/v1&quot;,
2020-09-02T10:56:50.0593476Z     &quot;kind&quot;: &quot;Deployment&quot;,
2020-09-02T10:56:50.0593853Z     &quot;metadata&quot;: {
2020-09-02T10:56:50.0594453Z         &quot;annotations&quot;: {
2020-09-02T10:56:50.0617018Z             &quot;deployment.kubernetes.io/revision&quot;: &quot;2&quot;,
2020-09-02T10:56:50.0619826Z             &quot;kubectl.kubernetes.io/last-applied-configuration&quot;: &quot;{\&quot;apiVersion\&quot;:\&quot;apps/v1\&quot;,\&quot;kind\&quot;:\&quot;Deployment\&quot;,\&quot;metadata\&quot;:{\&quot;annotations\&quot;:{},\&quot;name\&quot;:\&quot;aspx-deployment\&quot;,\&quot;namespace\&quot;:\&quot;default\&quot;},\&quot;spec\&quot;:{\&quot;replicas\&quot;:2,\&quot;selector\&quot;:{\&quot;matchLabels\&quot;:{\&quot;app\&quot;:\&quot;asp-net\&quot;}},\&quot;template\&quot;:{\&quot;metadata\&quot;:{\&quot;labels\&quot;:{\&quot;app\&quot;:\&quot;asp-net\&quot;}},\&quot;spec\&quot;:{\&quot;containers\&quot;:[{\&quot;image\&quot;:\&quot;***/drop:40\&quot;,\&quot;name\&quot;:\&quot;asp\&quot;,\&quot;ports\&quot;:[{\&quot;containerPort\&quot;:80}]}]}}}}\n&quot;
2020-09-02T10:56:50.0622683Z         },
2020-09-02T10:56:50.0623075Z         &quot;creationTimestamp&quot;: &quot;2020-09-02T07:19:54Z&quot;,
2020-09-02T10:56:50.0623735Z         &quot;generation&quot;: 2,
2020-09-02T10:56:50.0624085Z         &quot;name&quot;: &quot;aspx-deployment&quot;,
2020-09-02T10:56:50.0624371Z         &quot;namespace&quot;: &quot;default&quot;,
2020-09-02T10:56:50.0624697Z         &quot;resourceVersion&quot;: &quot;19157&quot;,
2020-09-02T10:56:50.0628209Z         &quot;selfLink&quot;: &quot;/apis/apps/v1/namespaces/default/deployments/aspx-deployment&quot;,
2020-09-02T10:56:50.0628683Z         &quot;uid&quot;: &quot;57c18e4d-0583-43bc-b0c4-58d6bb2c9069&quot;
2020-09-02T10:56:50.0628948Z     },
2020-09-02T10:56:50.0629156Z     &quot;spec&quot;: {
2020-09-02T10:56:50.0629632Z         &quot;progressDeadlineSeconds&quot;: 600,
2020-09-02T10:56:50.0629958Z         &quot;replicas&quot;: 2,
2020-09-02T10:56:50.0630236Z         &quot;revisionHistoryLimit&quot;: 10,
2020-09-02T10:56:50.0633694Z         &quot;selector&quot;: {
2020-09-02T10:56:50.0634104Z             &quot;matchLabels&quot;: {
2020-09-02T10:56:50.0634389Z                 &quot;app&quot;: &quot;asp-net&quot;
2020-09-02T10:56:50.0634654Z             }
2020-09-02T10:56:50.0634863Z         },
2020-09-02T10:56:50.0635116Z         &quot;strategy&quot;: {
2020-09-02T10:56:50.0635383Z             &quot;rollingUpdate&quot;: {
2020-09-02T10:56:50.0635685Z                 &quot;maxSurge&quot;: &quot;25%&quot;,
2020-09-02T10:56:50.0636003Z                 &quot;maxUnavailable&quot;: &quot;25%&quot;
2020-09-02T10:56:50.0636322Z             },
2020-09-02T10:56:50.0636572Z             &quot;type&quot;: &quot;RollingUpdate&quot;
2020-09-02T10:56:50.0636821Z         },
2020-09-02T10:56:50.0637050Z         &quot;template&quot;: {
2020-09-02T10:56:50.0637316Z             &quot;metadata&quot;: {
2020-09-02T10:56:50.0637611Z                 &quot;creationTimestamp&quot;: null,
2020-09-02T10:56:50.0637922Z                 &quot;labels&quot;: {
2020-09-02T10:56:50.0638230Z                     &quot;app&quot;: &quot;asp-net&quot;
2020-09-02T10:56:50.0638483Z                 }
2020-09-02T10:56:50.0638819Z             },
2020-09-02T10:56:50.0639105Z             &quot;spec&quot;: {
2020-09-02T10:56:50.0639388Z                 &quot;containers&quot;: [
2020-09-02T10:56:50.0639651Z                     {
2020-09-02T10:56:50.0640045Z                         &quot;image&quot;: &quot;***/drop:40&quot;,
2020-09-02T10:56:50.0640435Z                         &quot;imagePullPolicy&quot;: &quot;IfNotPresent&quot;,
2020-09-02T10:56:50.0640782Z                         &quot;name&quot;: &quot;asp&quot;,
2020-09-02T10:56:50.0641098Z                         &quot;ports&quot;: [
2020-09-02T10:56:50.0641395Z                             {
2020-09-02T10:56:50.0642030Z                                 &quot;containerPort&quot;: 80,
2020-09-02T10:56:50.0642527Z                                 &quot;protocol&quot;: &quot;TCP&quot;
2020-09-02T10:56:50.0642853Z                             }
2020-09-02T10:56:50.0643111Z                         ],
2020-09-02T10:56:50.0643405Z                         &quot;resources&quot;: {},
2020-09-02T10:56:50.0643802Z                         &quot;terminationMessagePath&quot;: &quot;/dev/termination-log&quot;,
2020-09-02T10:56:50.0644232Z                         &quot;terminationMessagePolicy&quot;: &quot;File&quot;
2020-09-02T10:56:50.0644550Z                     }
2020-09-02T10:56:50.0644768Z                 ],
2020-09-02T10:56:50.0645058Z                 &quot;dnsPolicy&quot;: &quot;ClusterFirst&quot;,
2020-09-02T10:56:50.0645398Z                 &quot;restartPolicy&quot;: &quot;Always&quot;,
2020-09-02T10:56:50.0645752Z                 &quot;schedulerName&quot;: &quot;default-scheduler&quot;,
2020-09-02T10:56:50.0646087Z                 &quot;securityContext&quot;: {},
2020-09-02T10:56:50.0646605Z                 &quot;terminationGracePeriodSeconds&quot;: 30
2020-09-02T10:56:50.0646902Z             }
2020-09-02T10:56:50.0647131Z         }
2020-09-02T10:56:50.0647308Z     },
2020-09-02T10:56:50.0647518Z     &quot;status&quot;: {
2020-09-02T10:56:50.0647785Z         &quot;availableReplicas&quot;: 2,
2020-09-02T10:56:50.0648069Z         &quot;conditions&quot;: [
2020-09-02T10:56:50.0648292Z             {
2020-09-02T10:56:50.0648700Z                 &quot;lastTransitionTime&quot;: &quot;2020-09-02T07:19:54Z&quot;,
2020-09-02T10:56:50.0649116Z                 &quot;lastUpdateTime&quot;: &quot;2020-09-02T07:37:15Z&quot;,
2020-09-02T10:56:50.0649585Z                 &quot;message&quot;: &quot;ReplicaSet \&quot;aspx-deployment-84597d88f5\&quot; has successfully progressed.&quot;,
2020-09-02T10:56:50.0650020Z                 &quot;reason&quot;: &quot;NewReplicaSetAvailable&quot;,
2020-09-02T10:56:50.0650354Z                 &quot;status&quot;: &quot;True&quot;,
2020-09-02T10:56:50.0650662Z                 &quot;type&quot;: &quot;Progressing&quot;
2020-09-02T10:56:50.0650920Z             },
2020-09-02T10:56:50.0651117Z             {
2020-09-02T10:56:50.0651508Z                 &quot;lastTransitionTime&quot;: &quot;2020-09-02T10:53:01Z&quot;,
2020-09-02T10:56:50.0652363Z                 &quot;lastUpdateTime&quot;: &quot;2020-09-02T10:53:01Z&quot;,
2020-09-02T10:56:50.0652807Z                 &quot;message&quot;: &quot;Deployment has minimum availability.&quot;,
2020-09-02T10:56:50.0653184Z                 &quot;reason&quot;: &quot;MinimumReplicasAvailable&quot;,
2020-09-02T10:56:50.0653520Z                 &quot;status&quot;: &quot;True&quot;,
2020-09-02T10:56:50.0653840Z                 &quot;type&quot;: &quot;Available&quot;
2020-09-02T10:56:50.0654095Z             }
2020-09-02T10:56:50.0654285Z         ],
2020-09-02T10:56:50.0654538Z         &quot;observedGeneration&quot;: 2,
2020-09-02T10:56:50.0654831Z         &quot;readyReplicas&quot;: 2,
2020-09-02T10:56:50.0655099Z         &quot;replicas&quot;: 2,
2020-09-02T10:56:50.0655360Z         &quot;updatedReplicas&quot;: 2
2020-09-02T10:56:50.0655592Z     }
2020-09-02T10:56:50.0655767Z }
2020-09-02T10:56:50.0655889Z 
2020-09-02T10:56:52.6885299Z ##[error]The process 'C:\hostedtoolcache\windows\kubectl\1.7.0\x64\kubectl.exe' failed with exit code 1
2020-09-02T10:56:52.7480636Z ##[section]Finishing: kubectl create app and service or apply

</code></pre>
<p>My aksdeploy.yml file is at <a href="https://github.com/praneshshzl/AKSCICDDEMO/blob/master/aksdeploy.yml" rel="nofollow noreferrer">https://github.com/praneshshzl/AKSCICDDEMO/blob/master/aksdeploy.yml</a></p>
<p>My image to deploy is a docker hub image based on windows at <a href="https://hub.docker.com/repository/docker/praneshhzl/drop" rel="nofollow noreferrer">https://hub.docker.com/repository/docker/praneshhzl/drop</a></p>

Pranesh Sathyanarayan
<p>Looks like this was something to do in the kubectl apply task in release pipeline. We have to go to right pane, scroll down, expand &quot;advanced&quot; and in version spec check the box <strong>&quot;check for latest version&quot;</strong>. My pipeline built completed successfully. There was no issues in my deployment yaml.</p>
<p>Enabling this option ensures proper latest version of kubectl.exe is downloaded
onto the VSTS agent</p>
<pre><code>Downloading: https://storage.googleapis.com/kubernetes-release/release/stable.txt
2020-09-02T12:18:39.3539227Z Downloading: https://storage.googleapis.com/kubernetes-release/release/v1.19.0/bin/windows/amd64/kubectl.exe
2020-09-02T12:18:40.7266540Z Caching tool: kubectl 1.19.0 x64
2020-09-02T12:18:40.8028720Z Prepending PATH environment variable with directory: C:\hostedtoolcache\windows\kubectl\1.19.0\x64
2020-09-02T12:18:43.3630075Z ==============================================================================
2020-09-02T12:18:43.3632157Z            Kubectl Client Version: v1.19.0
2020-09-02T12:18:43.3633193Z            Kubectl Server Version: v1.16.13
2020-09-02T12:18:43.3633757Z ==============================================================================
</code></pre>
