@@ -42,7 +42,7 @@ export namespace bundleFeedUtils {
4242
4343 const feed : IBundleFeed = await getBundleFeed ( context , bundleMetadata ) ;
4444 const validVersions : string [ ] = Object . keys ( feed . bundleVersions ) . filter ( ( v : string ) => ! ! semver . valid ( v ) ) ;
45- const bundleVersion : string | undefined = nugetUtils . tryGetMaxInRange ( bundleMetadata . version || feed . defaultVersionRange , validVersions ) ;
45+ const bundleVersion : string | undefined = nugetUtils . tryGetMaxInRange ( bundleMetadata . version || await getLatestVersionRange ( context ) , validVersions ) ;
4646 if ( ! bundleVersion ) {
4747 throw new Error ( localize ( 'failedToFindBundleVersion' , 'Failed to find bundle version satisfying range "{0}".' , bundleMetadata . version ) ) ;
4848 } else {
@@ -60,9 +60,12 @@ export namespace bundleFeedUtils {
6060 return ( ! template . isHttpTrigger && ! template . isTimerTrigger ) || bundleTemplateTypes . some ( t => isTemplateOfType ( template , t ) ) ;
6161 }
6262
63- export async function getLatestVersionRange ( context : IActionContext ) : Promise < string > {
64- const feed : IBundleFeed = await getBundleFeed ( context , undefined ) ;
65- return feed . defaultVersionRange ;
63+ export async function getLatestVersionRange ( _context : IActionContext ) : Promise < string > {
64+ // const feed: IBundleFeed = await getBundleFeed(context, undefined);
65+ // return feed.defaultVersionRange;
66+ // New default bundle version causes issues (ex: https://github.com/microsoft/vscode-azurefunctions/issues/3711)
67+ // Using old version range as seen in https://github.com/Azure/azure-functions-host/pull/9324
68+ return '[3.*, 4.0.0)' ;
6669 }
6770
6871 export async function addDefaultBundle ( context : IActionContext , hostJson : IHostJsonV2 ) : Promise < void > {
0 commit comments