Trying to setup an Azure App Service. Source code is in github. This .NET project builds and runs fine on local Visual Studio 2022. The App Service deployment is pretty much stock that Azure created. It grabs the code from github and then further along attempts a nuget restore. The packages that are from the default path https://api.nuget.org are fine. The problem is that some packages are from https://api.anotherfeedsite.org and nuget restore still tries to find these in https://api.nuget.org.
All the search material that's coming up only has the package sources specified in Visual Studio https://learn.microsoft.com/en-us/nuget/consume-packages/package-restore which is great as it works on local. On the runner, I obviously don't have access to the Visual Studio to specify additional package sources. As far as I can tell adding additional package source in local Visual Studio does not change anything in the project source code/solution file so looks like that is stored in the "Visual Studio Settings" itself.
How is the runner that is doing the build expected to find the package sources/feed URLs if it's not the default https://api.nuget.org?
EDIT #1
Actually, got one step closer. Found nuget.config and added the feeds there. Now trying to change the yml to look at the nuget.config
name: Build and deploy ASP app to Azure Web App
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup MSBuild path
uses: microsoft/setup-msbuild@v1.0.2
- name: Setup NuGet
uses: NuGet/setup-nuget@v1.0.5
- name: Restore NuGet packages
run: nuget restore -ConfigFile 'nuget.config'
This gives an error File 'D:\a\MYAPP\nuget.config' does not exist. Any idea what syntax should be here?
I got the setup working in Azure pipelines... where the yaml is quite different so I can't really copy/paste.
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
feedsToUse : 'config'
nugetConfigPath: 'nuget.config'
Regards,