title: Calling Azure DevOps REST API in a daemon app or long-running task
body: <p>I'm writing Azure WebJob (long running task) to create a WorkItems pragmatically. I created Azure AD App (SPN) and added Visual Studio Team Services under API permissions. I created console application to test API and here is the code to get the token and calling DevOps API</p>
  
  <pre><code>static async Task RunAsync()
  {
      AuthenticationContext authContext = new AuthenticationContext(authority); // https://login.microsoftonline.com/{tanent}
      ClientCredential clientCredential = new ClientCredential(clientId, appKey); // Azure APP ID and Key
      AuthenticationResult result = await authContext.AcquireTokenAsync(resourceId, clientCredential); // 499b84ac-1321-427f-aa17-267ca6975798
  
      httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", result.AccessToken);
  
      HttpResponseMessage response = await httpClient.GetAsync(baseAddress + "/_apis/wit/workitemtypes?api-version=5.1-preview.2"); // https://dev.azure.com/{org}/{project}
  
      if (response.IsSuccessStatusCode)
      {
          string s = await response.Content.ReadAsStringAsync();
          Console.WriteLine(s);
      }
  }
  </code></pre>
  
  <p>I am getting HTML output with title: "Azure DevOps Services | Sign In" instead of JSON response (list of work item types). Since it's background process I cannot ask user a prompt for login. Can I do this way? Is it supported?  </p>