azure-devopsnugetazure-artifacts

Azure Devops Artifacts: Can't find unlisted packages to delete them


I unlisted my NuGet packages from my Azure Devops feed, but now my Storage is full, and I want to go delete them. They no longer show up in the list of available packages, and so I am unable to find them in the Portal to delete them. Please suggest another way to find this information; I don't know how to delete them otherwise.


Solution

  • What I wound up doing was accessing the REST API to see the unlisted packages. I got a Personal Access Token (PAT) and used that as my password for basic authentication with the Azure Devops endpoint. The request I used was as follows [Powershell]:

    $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
    $headers.Add("Authorization", "••••••")
        
    $response = Invoke-RestMethod 'https://feeds.dev.azure.com/{{organization}}/{{project}}/_apis/packaging/Feeds/{{feedId}}/packages?includeAllVersions=true&includeDeleted=false&api-version=7.2-preview.1' -Method 'GET' -Headers $headers
    $response | ConvertTo-Json
    

    I used the JSON response to see the unlisted packages. Then in the Portal UI, I could search upstream sources for those packages, click on the Version tab, and delete the packages for good.