Answered by:
Web App fails to fetch NuGet packages

Question
-
From Jacob Foshee @82unplugged via Twitter
Frustrated can't deploy @Azure web app because it fails to fetch @nuget packages. @AppVeyor was able to fetch them. Nuget status is green.
https://twitter.com/82unpluggd/status/631089721494515713
Thanks,
@AzureSupport
Tuesday, August 11, 2015 1:19 PM
Answers
-
Hello,
1. What is the exact error message you get when the webapp fails to fetch the nuget package?
2. Is this a private Nuget package?Kudu takes care of the build and deployment phase in Azure webapps, It fetches the changes linked to the commit that triggered the service, and prepares a local working environment. If your project is configured to use NuGet package restore, then this will happen in a pre-build step. It is key to understand that NuGet package restore by default is executed as part of the MSBuild process.
If you package any of your tools or libraries as private NuGet packages, exposed publically via authenticated
A workaround is to add a custom NuGet.config file, stored at the same level as your .SLN file which will contain an entry for your private NuGet feed and also credentials stored in plain text. You cannot use encrypted credentials as the encryption is generated on a per-machine basis
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
<packageSources>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="custom_package_source" value="https://custom_package_source/nuget/v1/FeedService.svc/" />
</packageSources>
<disabledPackageSources />
<packageSourceCredentials>
<custom_package_source>
<add key="Username" value="CustomUsername" />
<add key="ClearTextPassword" value="CustomPassword" />
</custom_package_source>
</packageSourceCredentials>When you deploy via Kudu, this should allow the build process to discover your private feed, authenticate & restore your packages.
If you do not require authentication against your private feed, remove the <packageSourceCredentials> element.You can also refer to the Stackoverflow thread:
Thanks,
Syed Irfan Hussain- Edited by Syed Irfan Hussain Tuesday, August 11, 2015 2:20 PM
- Proposed as answer by Syed Irfan Hussain Wednesday, August 12, 2015 10:08 AM
- Marked as answer by Girish Prajwal Sunday, August 16, 2015 1:03 PM
Tuesday, August 11, 2015 2:19 PM
All replies
-
Hi,
If I understand you correctly you have trouble deploying the azure web app as the Visual studio fails to fetch the Nuget package.
What version of Visual studio you are using ?
What version of NuGet you have ?
When you say it failes to fetch Nuget packages , do you see any exceptions ? Could you elaborate more to better assist you.
Regards,
Shirisha Paderu
Tuesday, August 11, 2015 2:13 PM -
Hello,
1. What is the exact error message you get when the webapp fails to fetch the nuget package?
2. Is this a private Nuget package?Kudu takes care of the build and deployment phase in Azure webapps, It fetches the changes linked to the commit that triggered the service, and prepares a local working environment. If your project is configured to use NuGet package restore, then this will happen in a pre-build step. It is key to understand that NuGet package restore by default is executed as part of the MSBuild process.
If you package any of your tools or libraries as private NuGet packages, exposed publically via authenticated
A workaround is to add a custom NuGet.config file, stored at the same level as your .SLN file which will contain an entry for your private NuGet feed and also credentials stored in plain text. You cannot use encrypted credentials as the encryption is generated on a per-machine basis
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
<packageSources>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="custom_package_source" value="https://custom_package_source/nuget/v1/FeedService.svc/" />
</packageSources>
<disabledPackageSources />
<packageSourceCredentials>
<custom_package_source>
<add key="Username" value="CustomUsername" />
<add key="ClearTextPassword" value="CustomPassword" />
</custom_package_source>
</packageSourceCredentials>When you deploy via Kudu, this should allow the build process to discover your private feed, authenticate & restore your packages.
If you do not require authentication against your private feed, remove the <packageSourceCredentials> element.You can also refer to the Stackoverflow thread:
Thanks,
Syed Irfan Hussain- Edited by Syed Irfan Hussain Tuesday, August 11, 2015 2:20 PM
- Proposed as answer by Syed Irfan Hussain Wednesday, August 12, 2015 10:08 AM
- Marked as answer by Girish Prajwal Sunday, August 16, 2015 1:03 PM
Tuesday, August 11, 2015 2:19 PM