title: How to create VSTS CI-CD for Azure Functions (with shared javascript files) using Visual Studio Code?
body: <p>I'm trying to use Visual Studio code to create a Azure Function micro-service (javascript and Functions v2) that I push to my VSTS account, that then triggers a CI-CD to Azure functions.  </p>
  
  <p><strong>How do I configure the Azure Functions CI-CD process to bring across all of the files in my VSTS git repo?</strong></p>
  
  <p>Has anyone gotten this working? Is there a better way to connect the Azure Function to a CosmosDb while having shared javascript model files (I've seen numerous examples in C# on microsoft, but not for Javascript)?</p>
  
  <p>Preferred dev env: VS Code -> VSTS Git CI-CD -> Azure Function -> Azure CosmosDb</p>
  
  <p>What I'm trying to achieve:</p>
  
  <ul>
  <li>Step 1: I did a great tutorial that gets an Angular page linking to a Azure Http Trigger Function (<a href="https://dzone.com/articles/create-a-serverless-angular-app-with-azure-functio" rel="nofollow noreferrer">https://dzone.com/articles/create-a-serverless-angular-app-with-azure-functio</a>)</li>
  <li>Step 2: I like Visual Studio Code and want to be able to use it to develop a more sophistacated micro-service (<a href="https://www.michaelcrump.net/azure-tips-and-tricks50/" rel="nofollow noreferrer">https://www.michaelcrump.net/azure-tips-and-tricks50/</a>)</li>
  <li>Step 3: I managed to do the advised "Upload" to Azure and the functions arived and worked ... nice one old-mate! (<a href="https://www.michaelcrump.net/azure-tips-and-tricks52/" rel="nofollow noreferrer">https://www.michaelcrump.net/azure-tips-and-tricks52/</a>)</li>
  <li>Step 4: I pushed my 2 Functions (one from first tutorial and the other just the standard Hello-world created in VS Code) to VSTS, and created a Azure side CI-CD pull.  This works, but VSTS has no Build or Deploy scripts I can see or edit. [<a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-continuous-deployment]" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/azure-functions/functions-continuous-deployment]</a></li>
  <li>Step 5: I want to create a RESTful Azure Function microservice to use mongoose and connect to Azure CosmosDb. This is the best I can find that suggests how using Azure CLI. (<a href="http://thecodebarbarian.com/getting-started-with-azure-functions-and-mongodb.html" rel="nofollow noreferrer">http://thecodebarbarian.com/getting-started-with-azure-functions-and-mongodb.html</a>)</li>
  <li>Step 6: I want to have a shared model files as the microservice becomes more sophisticated.  (<a href="https://stackoverflow.com/questions/44612507/how-to-share-code-in-javascript-azure-functions">How to share code in JavaScript Azure Functions?</a>)</li>
  </ul>
  
  <p><strong>Problem</strong> ... The CI-CD I setup in Azure Function isn't bringing my shared sub-directory over and therefore the entire Function breaks.  The CI-CD in VSTS doesn't include any details of the CI-CD Build and Release steps in the VSTS web UI (no processes are setup).  </p>
  
  <p>How do you create a shared subdirectory between functions?  </p>