Skip to content

Commit cd59e34

Browse files
authored
Use staticProperties for default version range (#4653)
1 parent 602f32a commit cd59e34

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

src/utils/bundleFeedUtils.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import { type IActionContext } from '@microsoft/vscode-azext-utils';
77
import * as semver from 'semver';
8-
import { ext, TemplateSource } from '../extensionVariables';
98
import { type IBundleMetadata, type IHostJsonV2 } from '../funcConfig/host';
109
import { localize } from '../localize';
1110
import { type IBindingTemplate } from '../templates/IBindingTemplate';
@@ -86,7 +85,7 @@ export namespace bundleFeedUtils {
8685
}
8786

8887
export async function getLatestVersionRange(context: IActionContext): Promise<string> {
89-
const feed: IBundleFeed = await getBundleFeed(context, undefined);
88+
const feed: IBundleFeed = await getBundleFeed(context);
9089
return feed.defaultVersionRange;
9190
}
9291

@@ -108,21 +107,8 @@ export namespace bundleFeedUtils {
108107
return !!template.id?.toLowerCase().includes(templateType.toLowerCase());
109108
}
110109

111-
async function getBundleFeed(context: IActionContext, bundleMetadata: IBundleMetadata | undefined): Promise<IBundleFeed> {
112-
const bundleId: string = bundleMetadata && bundleMetadata.id || defaultBundleId;
113-
114-
const envVarUri: string | undefined = process.env.FUNCTIONS_EXTENSIONBUNDLE_SOURCE_URI;
115-
// Only use an aka.ms link for the most common case, otherwise we will dynamically construct the url
116-
let url: string;
117-
const templateProvider = ext.templateProvider.get(context);
118-
if (!envVarUri && bundleId === defaultBundleId && templateProvider.templateSource !== TemplateSource.Staging) {
119-
url = 'https://aka.ms/bundleFeedUtilsV2';
120-
} else {
121-
const suffix: string = templateProvider.templateSource === TemplateSource.Staging ? '-staging' : '';
122-
const baseUrl: string = envVarUri || `https://cdn${suffix}.functions.azure.com/public`;
123-
url = `${baseUrl}/ExtensionBundles/${bundleId}/index-v2.json`;
124-
}
125-
110+
async function getBundleFeed(context: IActionContext): Promise<IBundleFeed> {
111+
const url: string = 'https://aka.ms/funcStaticProperties';
126112
return feedUtils.getJsonFeed(context, url);
127113
}
128114

0 commit comments

Comments
 (0)