Skip to content
Howard van Rooijen By Howard van Rooijen Co-Founder
Azure Web Apps: Package Restore against a private NuGet Feed

Microsoft Azure Web Apps (formerly known as Azure Websites) has a very useful inbuilt continuous integration and deployment engine called Kudu (it's also open source; under an Apache 2.0 license, and you can also host it outside of Azure). Kudu supports a continuous integration and deployment workflow against VSO, GitHub, TeamCity, Hudson and BitBucket.

If you package any of your tools or libraries as private NuGet packages, exposed publically via authenticated private feeds using TeamCity, MyGet, ProGet or a custom NuGet Server, performing a package restore as part of the build process will fail as NuGet requires valid credentials to access the private feed.

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. It is also advisable to create a unique set of credential per application you are deploying with only enough rights to see the packages they require.

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.

In NuGet v3.0 the ability to read credentials from environmental variables has been added. This allows you to add your credentials via the app settings UI in the Azure Portal. This is a much better approach to take as it ensures that your NuGet feed credentials are not committed to your source control repo.

@HowardvRooijen

Sign up to Azure Weekly to receive Azure related news and articles direct to your inbox every Sunday, or follow @azureweekly on Twitter.

Using Azure CLI Authentication within Local Containers

Using Azure CLI Authentication within Local Containers

James Dawson

Have the recent changes to Azure CLI on Windows broken your dev inner loop when working with containerised applications that need access to Azure resources? If so, this post provides a workaround that will unblock you without having to be stuck on an old version of the Azure CLI.
How to consume a NuGet package in PowerShell

How to consume a NuGet package in PowerShell

Ed Freeman

Sometimes the logic for the bit of work you're doing in PowerShell won't be packaged into a handy PowerShell module with cmdlets to perform the operations you need to perform. But what if there is a .NET package listed on NuGet that does contain the assemblies you need for your work? How can we import that into PowerShell and make use of its classes and methods? This blog explains how to do just that, avoiding current pitfalls in PowerShell's implementation of the NuGet package provider.
How to update credentials for an on-prem Power BI data source using PowerShell

How to update credentials for an on-prem Power BI data source using PowerShell

Ed Freeman

Automating the updating of Power BI data source credentials is a common requirement in the application lifecycle management of a Power BI solution. However, on-premises data sources throw an extra spanner in the works: you must encrypt your credentials using the RSA-OAEP encryption algorithm before sending off the request to update the data source. There is currently no PowerShell module that encapsulates this logic into a set of handy cmdlets, so you must either implement the algorithm's logic yourself, or you can use the helper classes in the existing .NET SDK to do all the heavy lifting for you. This blog shows how to do the latter.

Howard van Rooijen

Co-Founder

Howard van Rooijen

Howard spent 10 years as a technology consultant helping some of the UK's best known organisations work smarter, before founding endjin in 2010. He's a Microsoft ScaleUp Mentor, and a Microsoft Azure MVP, and helps small teams achieve big things using data, AI and Microsoft Azure.