title: Publish Build artifacts to artifact feeds programatically by using Artifcat upstream
body: <p>Using Azure-devops, am trying to develop an API(.net core) where in am picking build artifact packages using below using builds</p>
  <pre><code>var builds = await buildClient.GetBuildsAsync(project.Id);
  </code></pre>
  <p>Now, using latest build... am trying to feed build package artifacts to Azure-devops artifacts using below</p>
  <pre><code>var stream = await buildClient.GetArtifactContentZipAsync(project.Id, build.Id, first.Name);
  string jsonBody = new JavaScriptSerializer().Serialize(new
                      {
                          name = &quot;MyFeedName112&quot;,
                          hideDeletedPackageVersions = &quot;true&quot;,
                          upstreamEnabled = &quot;true&quot;,
                          upstreamSources = stream,
                      });
  
     var response = await client.PostAsync( &quot;https://feeds.dev.azure.com/{organization}/{project}/_apis/packaging/feeds?api-version=6.0-preview.1&quot;, new StringContent(jsonBody, Encoding.UTF8, &quot;application/json&quot;));                  
  </code></pre>
  <p>However my post request fails with 500 server error, Am doing it for POC purpose and couldn't find  many references. Is my approach correct? any references/inputs will help..Thanks</p>