4

How can I clear nuget cache in Azure Functions? Some changes happend to our nuget package but version wasn't changed. (The package in dev now, and we can't change the version now, it should be the same)

Janusz Nowak
  • 2,595
  • 1
  • 17
  • 36

1 Answers1

5

Good question - unfortunately, there may be some tricky side effects. I'd recommend updating the package version appropriately so that the nuget restore always works as intended.

To see nuget caches, navigate to portal -> function app -> platform features -> console.

In the console, run nuget locals all -list to see local package caches. The problem you may have is that some these caches are stored locally on the vm, and we don't expose a console which can run a command on all vms. nuget locals all -clear is the command to clear the package cache, but it likely won't do what you want (clear the cache across all instances).

The nuget packages for your function are stored at %HOME%\data\Functions\packages, which is part of the shared file system. You can replace the package there with the updated package.

Matt Mason
  • 2,676
  • 9
  • 22