Skip to content

Commit 6238290

Browse files
committed
Skip checking workspace settings from api entry point
1 parent cc614bf commit 6238290

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/commands/deployWorkspaceProject/getDefaultValues/getDefaultContainerAppsResources/getDefaultContainerAppsResources.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
import { type ManagedEnvironment } from "@azure/arm-appcontainers";
77
import { type ResourceGroup } from "@azure/arm-resources";
88
import { type ISubscriptionActionContext } from "@microsoft/vscode-azext-utils";
9-
import { type SetTelemetryProps } from "../../../../telemetry/SetTelemetryProps";
10-
import { type DeployWorkspaceProjectTelemetryProps as TelemetryProps } from "../../../../telemetry/commandTelemetryProps";
119
import { type ContainerAppItem, type ContainerAppModel } from "../../../../tree/ContainerAppItem";
1210
import { type ManagedEnvironmentItem } from "../../../../tree/ManagedEnvironmentItem";
11+
import { type DeployWorkspaceProjectContext } from "../../DeployWorkspaceProjectContext";
1312
import { type DeployWorkspaceProjectSettings } from "../../deployWorkspaceProjectSettings";
1413
import { getContainerAppResourcesFromItem, getContainerAppResourcesFromSettings } from "./getDefaultResourcesFrom";
1514
import { promptForEnvironmentResources } from "./promptForEnvironmentResources";
@@ -21,21 +20,23 @@ export interface DefaultContainerAppsResources {
2120
}
2221

2322
export async function getDefaultContainerAppsResources(
24-
context: ISubscriptionActionContext & SetTelemetryProps<TelemetryProps>,
23+
context: ISubscriptionActionContext & Partial<DeployWorkspaceProjectContext>,
2524
settings: DeployWorkspaceProjectSettings,
2625
item?: ContainerAppItem | ManagedEnvironmentItem
2726
): Promise<DefaultContainerAppsResources> {
2827
context.telemetry.properties.promptedForEnvironment = 'false'; // Initialize the default value
2928

30-
// If a tree item is provided that can be used to deduce default context values, try to use those first
31-
if (item) {
32-
return await getContainerAppResourcesFromItem(context, item);
33-
}
29+
if (!context.apiEntryPoint) {
30+
// If a tree item is provided that can be used to deduce default context values, try to use those first
31+
if (item) {
32+
return await getContainerAppResourcesFromItem(context, item);
33+
}
3434

35-
// Otherwise try to obtain container app resources using any saved workspace settings
36-
const { resourceGroup, managedEnvironment, containerApp } = await getContainerAppResourcesFromSettings(context, settings);
37-
if (resourceGroup && managedEnvironment && containerApp) {
38-
return { resourceGroup, managedEnvironment, containerApp };
35+
// Otherwise try to obtain container app resources using any saved workspace settings
36+
const { resourceGroup, managedEnvironment, containerApp } = await getContainerAppResourcesFromSettings(context, settings);
37+
if (resourceGroup && managedEnvironment && containerApp) {
38+
return { resourceGroup, managedEnvironment, containerApp };
39+
}
3940
}
4041

4142
// Otherwise prompt the user for managed environment resources to use

0 commit comments

Comments
 (0)