<p>I have an azure pipeline that I am using to generate and push helm charts in. Within this pipeline I have a deployment stage that uses the <code>HelmDeploy0</code> task. This task requires a <code>kubernetesServiceEndpoint</code>. Consequentially, I have also opted to use Pipeline environments and have configured my dev Kubernetes cluster as my Dev Environment for use in the pipeline. I am unsure ohow this task is going to use this environment as I have to assume that Azure DevOps, upon using the environment, must be authenticating with the cluster, thus, the helm chart should simply install. Unfortunately the <code>HelmDeploy0</code> task requires this serviceendpoint key. Any insight would be appreciated. Below is a snippet of the pipeline stage.</p>
<pre><code>- stage: Dev
  displayName: Deploy to Dev
  dependsOn: Build
  condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
  jobs: 
  - deployment:
    
    displayName: Deploy $(projName)
    environment: 'Dev'
    strategy:
      runOnce:
        preDeploy:
          steps:
            - task: HelmInstaller@1
              inputs:
                helmVersionToInstall: latest
        deploy:
          steps:
            - task: HelmDeploy@0
              displayName: Install Helm Chart
              inputs: 
                command: install
                chartName: $(REGISTRY_NAME)/helm/$(projName)
                arguments: --version $(tag)
                releaseName: $(projName)
</code></pre>
<p>NOTE: Yes I know variables cannot be used as the display name, it's there to protect any IP right now.</p>

Derek Williams
<p>You probably need to explicitly specify your Kubernetes cluster resource name in the Environment section. See below:</p>
<pre><code>- deployment: 
  environment:               
    name: Dev   # name of the environment to run this job on.
    resourceName: cluster-resource-name # name of the resource in the environment to record the deployments against
    resourceType: Kubernetes
  strategy:
    ...
</code></pre>
<p>You can also try using the shorten syntax: <code>environment: environmentName.resourceName</code>. If the shorten syntax failed to find the resource, you need to use above syntax to provide the <code>resourceType</code>. See document <a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&amp;tabs=schema%2Cparameter-schema#environment" rel="nofollow noreferrer">here</a>.</p>
<p>The steps of the deployment job automatically inherit the service connection details from resource targeted by the deployment job.</p>
<blockquote>
<p>You can scope the target of deployment to a particular resource within the environment. This allows you to record deployment history on a specific resource within the environment. The steps of the deployment job automatically inherit the service connection details from resource targeted by the deployment job.</p>
</blockquote>
<p>Check <a href="https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&amp;tabs=schema%2Cparameter-schema#environment" rel="nofollow noreferrer">here</a> for information.</p>
