<p>I’m sure many have come across this problem because I can’t be the only one.</p>
<p>In Visual Studio code I work with Kubernetes and Azure Devops YAML. Both have complete different formatting. To work with each I find I have to uninstall the others extension.</p>
<p>Has anyone worked out, how to have both together where VSCode can work out when your coding an Azure DevOps pipeline or a Kubernetes cluster?</p>

Jason
<p>I did do what @flyx recommended but late yesterday evening and did not post my answer but I am going to do that now.</p>
<p>I worked out the following things.</p>
<ol>
<li>VSCode can't seem to resolve the schema that are in <code>http://www.schemastore.org/json/composer</code> if you try to reference them by JSON glob words</li>
<li>You can get different schemas to work across different technologies. For Example Kubernetes, Azure DevOps and Ansible are what I have set up now.</li>
<li>You have to be okay with having an end syntax on your YAML files for this to work. For example, my Ansible YAML files all now end with _a.yml, my Kubernetes YAML files all end with _kube.yaml, and my Azure DevOps YAML files all end with the default syntax .yml</li>
</ol>
<p>Having figured out those three things I was able to set up my env, to allow the inteli sense and JSON syntax checker to pull the different needed schemas. I have also found the Google Cloud Code extension for Kubernetes is actually better than the Microsoft one and it picks up a lot quicker that your building a Kubernetes YAML file.</p>
<p>Also for this to work you need to save the file first, with the right extension for VSCode to know you are working on a certain technology and pull down the right Schema. Also, watch out for the .vscode file this sometimes gets a bit silly and does not put the right schema in, so just keep an eye on it. If it fails delete it close VSCode and reopen and you should be good to go.</p>
<p>Here are my JSON settings for anyone that wants to do this:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>{
    "redhat.telemetry.enabled": true,
    "yaml.schemas": {
        "https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json": "*.yml",
       // "http://www.schemastore.org/json/composer": ["/*"],
      // "https://raw.githubusercontent.com/apache/camel/main/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/camel-yaml-dsl.json" : "/_kube*.yaml", 
       "kubernetes": ["/*.yaml"],
       "https://json.schemastore.org/ansible-playbook" : "/_a*.yaml",
       "https://json.schemastore.org/ansible-role-2.9" : ["^/roles/*/tasks/_a*.yaml", "^/tasks/_a*.yaml"]
    },
    "vs-kubernetes": {
        "vscode-kubernetes.helm-path.windows": "C:\\Users\\Jason\\.vs-kubernetes\\tools\\helm\\windows-amd64\\helm.exe",
        "vscode-kubernetes.minikube-path.windows": "C:\\Users\\Jason\\.vs-kubernetes\\tools\\minikube\\windows-amd64\\minikube.exe"
    },
    "files.associations": {
            "**/ci/*.yml": "azure-pipelines"
        },
    "[azure-pipelines]": {
            "editor.defaultFormatter": "esbenp.prettier-vscode"
        },
        "yaml.schemaStore.url": "http://www.schemastore.org/api/json/catalog.json",
        "cloudcode.yaml.crdSchemaLocations": [
        
        ],
        "cloudcode.yaml.schemas": {
        
        },
        "cloudcode.yaml.yamlFileMatcher": "/_kube*.yaml",
}</code></pre>
</div>
</div>
</p>
<p>Extensions used for this:</p>
<ol>
<li>redhat yaml</li>
<li>googles cloud code</li>
<li>Azure Pipelines</li>
<li>Kubernetes Microsoft Default (Some reason this is needed to make the redhat yml extension behave)</li>
<li>The Ansible Yaml Schema (This is not an extension these just come down from the json schema store but make sure you have the right url otherwise VSCode does not resolve it. See Point 1. )</li>
</ol>
