66import { type ManagedEnvironment } from "@azure/arm-appcontainers" ;
77import { type ResourceGroup } from "@azure/arm-resources" ;
88import { type ISubscriptionActionContext } from "@microsoft/vscode-azext-utils" ;
9- import { type SetTelemetryProps } from "../../../../telemetry/SetTelemetryProps" ;
10- import { type DeployWorkspaceProjectTelemetryProps as TelemetryProps } from "../../../../telemetry/commandTelemetryProps" ;
119import { type ContainerAppItem , type ContainerAppModel } from "../../../../tree/ContainerAppItem" ;
1210import { type ManagedEnvironmentItem } from "../../../../tree/ManagedEnvironmentItem" ;
11+ import { type DeployWorkspaceProjectContext } from "../../DeployWorkspaceProjectContext" ;
1312import { type DeployWorkspaceProjectSettings } from "../../deployWorkspaceProjectSettings" ;
1413import { getContainerAppResourcesFromItem , getContainerAppResourcesFromSettings } from "./getDefaultResourcesFrom" ;
1514import { promptForEnvironmentResources } from "./promptForEnvironmentResources" ;
@@ -21,21 +20,23 @@ export interface DefaultContainerAppsResources {
2120}
2221
2322export 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