This project aims to provide a reference implementation for creating a REST based package source for the winget client.
C#
317
149 commits
updated Oct 1, 2026
The Microsoft.WinGet.RestSource PowerShell module is provided for creating and managing Windows Package Manager REST sources.
Please visit Create a Windows Package Manager REST source for more details.
Open src\WinGet.RestSource.sln in Visual Studio and build. We currently only build using the solution; command line methods of building a VS solution should work as well.
The REST functions can be run locally, but to use winget with them, the functions must be run using HTTPS. This is pre-configured by the launchSettings.json file.
src\WinGet.RestSource.Functions directory, run generate_self_sign_cert.ps1 in PowerShell.
launchSettings.jsonWinGet and your Collection will be Manifestssrc\WinGet.RestSource.Functions\local.settings.template.json to local.settings.json and populate required fields from the above Keys section.WinGet.RestSource.Functions project locally in Visual Studio using F5.winget source add -n "winget-pkgs-restsource" -a https://localhost:7071/api/ -t "Microsoft.Rest"Your commands to winget will now use your locally running REST instance as a user added source.
Running tests are a great way to ensure that functionality is preserved across major changes. You can run these tests in Visual Studio Test Explorer. In Visual Studio, run the tests from the menu with Test > Run All Tests
WinGet.RestSource.UnitTest\Test.runsettings.template.json template configuration to Test.runsettings.json
WinGet.RestSource.IntegrationTest\Test.runsettings.template.json template configuration to Test.runsettings.json
RestSourceUrl property to point to a deployed REST source endpoint. You can use the below instructions to deploy a REST instance.AddRestSource property to true. Visual Studio must be running as admin in this case.RunWriteTests setting must be set to true. The FunctionsHostKey setting must also be set since the add/update/delete endpoints all require function authorization. We recommend creating a new pipeline-specific host key for this purpose.This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
117 followers · starred Apr 2023
1 followers · starred Oct 2024
C#
86.0%
PowerShell
14.0%
This project aims to provide a reference implementation for creating a REST based package source for the winget client.
C#
317
149 commits
updated Oct 1, 2026
The Microsoft.WinGet.RestSource PowerShell module is provided for creating and managing Windows Package Manager REST sources.
Please visit Create a Windows Package Manager REST source for more details.
Open src\WinGet.RestSource.sln in Visual Studio and build. We currently only build using the solution; command line methods of building a VS solution should work as well.
The REST functions can be run locally, but to use winget with them, the functions must be run using HTTPS. This is pre-configured by the launchSettings.json file.
src\WinGet.RestSource.Functions directory, run generate_self_sign_cert.ps1 in PowerShell.
launchSettings.jsonWinGet and your Collection will be Manifestssrc\WinGet.RestSource.Functions\local.settings.template.json to local.settings.json and populate required fields from the above Keys section.WinGet.RestSource.Functions project locally in Visual Studio using F5.winget source add -n "winget-pkgs-restsource" -a https://localhost:7071/api/ -t "Microsoft.Rest"Your commands to winget will now use your locally running REST instance as a user added source.
Running tests are a great way to ensure that functionality is preserved across major changes. You can run these tests in Visual Studio Test Explorer. In Visual Studio, run the tests from the menu with Test > Run All Tests
WinGet.RestSource.UnitTest\Test.runsettings.template.json template configuration to Test.runsettings.json
WinGet.RestSource.IntegrationTest\Test.runsettings.template.json template configuration to Test.runsettings.json
RestSourceUrl property to point to a deployed REST source endpoint. You can use the below instructions to deploy a REST instance.AddRestSource property to true. Visual Studio must be running as admin in this case.RunWriteTests setting must be set to true. The FunctionsHostKey setting must also be set since the add/update/delete endpoints all require function authorization. We recommend creating a new pipeline-specific host key for this purpose.This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
117 followers · starred Apr 2023
1 followers · starred Oct 2024
C#
86.0%
PowerShell
14.0%