Skip to content
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
aaf27f2
Wip
MicroFish91 Feb 19, 2025
149eb14
WIP: Advanced create scaffold done
MicroFish91 Feb 24, 2025
2b14722
WIP: ContainerAppListStep
MicroFish91 Feb 27, 2025
42bc11a
WIP: First pass needs test
MicroFish91 Feb 27, 2025
7e0e6b3
Misc fixes
MicroFish91 Feb 28, 2025
9ab8315
Misc
MicroFish91 Feb 28, 2025
9a50407
WIP: Basic almost done
MicroFish91 Mar 2, 2025
5bad23c
WIP: Mostly working on all fronts minus updated pick filters
MicroFish91 Mar 2, 2025
069eda8
Misc changes and todos
MicroFish91 Mar 3, 2025
40b315e
Misc
MicroFish91 Mar 3, 2025
570c755
Core logic mostly working
MicroFish91 Mar 3, 2025
f7de2a0
Add name suggestion logic
MicroFish91 Mar 3, 2025
5a81bb5
Update location logic
MicroFish91 Mar 4, 2025
c1ef5fc
Move managed environment prompt first and update locations logic
MicroFish91 Mar 5, 2025
e13e6ae
Merge with main
MicroFish91 Jul 7, 2025
66ad27a
Most of the core logic, needs testing
MicroFish91 Jul 8, 2025
b749915
Clean up auto context population
MicroFish91 Jul 8, 2025
8f3b048
Rename pick strategies
MicroFish91 Jul 8, 2025
2fc34be
Remove some todos
MicroFish91 Jul 8, 2025
63f8333
API changes
MicroFish91 Jul 8, 2025
f9ef062
Update step order
MicroFish91 Jul 9, 2025
09025a0
Merge with main
MicroFish91 Aug 23, 2025
5275048
Nit formatting
MicroFish91 Aug 23, 2025
63de6ea
Remove readme
MicroFish91 Aug 23, 2025
4182ccf
Make sure tree item deployment still works well
MicroFish91 Aug 23, 2025
b1ebac5
Move step order
MicroFish91 Aug 23, 2025
4f67144
Small fix
MicroFish91 Aug 23, 2025
c4deb93
Use enum
MicroFish91 Aug 24, 2025
efd8a27
Update changelog
MicroFish91 Aug 25, 2025
f5cc187
Update managed environment list step
MicroFish91 Aug 25, 2025
4d843b2
Rename method
MicroFish91 Aug 25, 2025
993e38d
Simplify boolean expression
MicroFish91 Aug 25, 2025
34b9cc2
Add deployment mode telemetry
MicroFish91 Aug 25, 2025
48af602
Add more telemetry
MicroFish91 Aug 25, 2025
3c36a95
Formatting
MicroFish91 Aug 25, 2025
666b13d
Clean more stuff up
MicroFish91 Aug 25, 2025
6b22fe8
Update starting resources step
MicroFish91 Aug 25, 2025
c0a9fee
Reduce duplicates in telemetry
MicroFish91 Aug 25, 2025
4f49a71
Add flag
MicroFish91 Aug 26, 2025
301512e
Simplify setting related resources
MicroFish91 Aug 27, 2025
d0e61a4
Simplify some more
MicroFish91 Aug 27, 2025
18f3788
Misc changes
MicroFish91 Aug 28, 2025
e888533
Remove support for managed environment items
MicroFish91 Aug 28, 2025
f7fbfd7
Add more details for basic create
MicroFish91 Aug 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -862,9 +862,9 @@
"@azure/storage-blob": "^12.4.1",
"@fluentui/react-components": "^9.56.2",
"@fluentui/react-icons": "^2.0.265",
"@microsoft/vscode-azext-azureutils": "^3.3.3",
"@microsoft/vscode-azext-azureutils": "^3.5.0",
"@microsoft/vscode-azext-github": "^1.0.4",
"@microsoft/vscode-azext-utils": "^3.3.3",
"@microsoft/vscode-azext-utils": "^3.4.0",
"@microsoft/vscode-azureresources-api": "^2.0.2",
"@vscode/codicons": "0.0.38",
"buffer": "^6.0.3",
Expand Down
5 changes: 5 additions & 0 deletions src/commands/ManagedEnvironmentContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ export interface ManagedEnvironmentRequiredContext extends ISubscriptionActionCo
subscription: AzureSubscription;
managedEnvironment: ManagedEnvironment;
}

export interface ManagedEnvironmentContext extends ISubscriptionActionContext {
subscription: AzureSubscription;
managedEnvironment?: ManagedEnvironment;
}
47 changes: 34 additions & 13 deletions src/commands/StartingResourcesLogStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@
*--------------------------------------------------------------------------------------------*/

import { type ContainerApp, type ManagedEnvironment } from "@azure/arm-appcontainers";
import { type Registry } from "@azure/arm-containerregistry";
import { type ResourceGroup } from "@azure/arm-resources";
import { LocationListStep, type ILocationWizardContext } from "@microsoft/vscode-azext-azureutils";
import { ActivityChildItem, ActivityChildType, activityInfoIcon, AzureWizardPromptStep, createContextValue, type ExecuteActivityContext, type IActionContext } from "@microsoft/vscode-azext-utils";
import { ActivityChildItem, ActivityChildType, activityInfoIcon, AzureWizardPromptStep, createContextValue, prependOrInsertAfterLastInfoChild, type ActivityInfoChild, type ExecuteActivityContext, type IActionContext } from "@microsoft/vscode-azext-utils";
import { activityInfoContext } from "../constants";
import { ext } from "../extensionVariables";
import { prependOrInsertAfterLastInfoChild } from "../utils/activityUtils";
import { localize } from "../utils/localize";

type StartingResourcesLogContext = IActionContext & Partial<ExecuteActivityContext> & ILocationWizardContext & {
resourceGroup?: ResourceGroup,
managedEnvironment?: ManagedEnvironment,
registry?: Registry;
containerApp?: ContainerApp
};

Expand All @@ -26,17 +27,13 @@ const startingResourcesContext: string = 'startingResourcesLogStepItem';
*/
export class StartingResourcesLogStep<T extends StartingResourcesLogContext> extends AzureWizardPromptStep<T> {
public hideStepCount: boolean = true;
protected hasLogged: boolean = false;

/**
* Implement if you require additional context loading before resource logging
*/
protected configureStartingResources?(context: T): void | Promise<void>;

public async configureBeforePrompt(context: T): Promise<void> {
if (this.hasLogged) {
return;
}
await this.configureStartingResources?.(context);
await this.logStartingResources(context);
}
Expand All @@ -50,47 +47,71 @@ export class StartingResourcesLogStep<T extends StartingResourcesLogContext> ext
}

protected async logStartingResources(context: T): Promise<void> {
// Resource group
if (context.resourceGroup) {
prependOrInsertAfterLastInfoChild(context,
new ActivityChildItem({
contextValue: createContextValue([startingResourcesContext, activityInfoContext]),
label: localize('useResourceGroup', 'Use resource group "{0}"', context.resourceGroup.name),
activityType: ActivityChildType.Info,
iconPath: activityInfoIcon
})
iconPath: activityInfoIcon,
stepId: this.id,
}) as ActivityInfoChild,
);
ext.outputChannel.appendLog(localize('usingResourceGroup', 'Using resource group "{0}".', context.resourceGroup.name));
}
context.telemetry.properties.existingResourceGroup = String(!!context.resourceGroup);

// Managed environment
if (context.managedEnvironment) {
prependOrInsertAfterLastInfoChild(context,
new ActivityChildItem({
label: localize('useManagedEnvironment', 'Use managed environment "{0}"', context.managedEnvironment.name),
contextValue: createContextValue([startingResourcesContext, activityInfoContext]),
activityType: ActivityChildType.Info,
iconPath: activityInfoIcon
}),
iconPath: activityInfoIcon,
stepId: this.id,
}) as ActivityInfoChild,
);
ext.outputChannel.appendLog(localize('usingManagedEnvironment', 'Using managed environment "{0}".', context.managedEnvironment.name));
}
context.telemetry.properties.existingEnvironment = String(!!context.managedEnvironment);

// Container registry
if (context.registry) {
prependOrInsertAfterLastInfoChild(context,
new ActivityChildItem({
label: localize('useAcr', 'Use container registry "{0}"', context.registry.name),
contextValue: createContextValue([startingResourcesContext, activityInfoContext]),
activityType: ActivityChildType.Info,
iconPath: activityInfoIcon,
stepId: this.id,
}) as ActivityInfoChild,
);
ext.outputChannel.appendLog(localize('usingAcr', 'Using Azure Container Registry "{0}".', context.registry.name));
}
context.telemetry.properties.existingRegistry = String(!!context.registry);

// Container app
if (context.containerApp) {
prependOrInsertAfterLastInfoChild(context,
new ActivityChildItem({
label: localize('useContainerApp', 'Use container app "{0}"', context.containerApp.name),
contextValue: createContextValue([startingResourcesContext, activityInfoContext]),
activityType: ActivityChildType.Info,
iconPath: activityInfoIcon,
}),
stepId: this.id,
}) as ActivityInfoChild,
);
ext.outputChannel.appendLog(localize('usingContainerApp', 'Using container app "{0}".', context.containerApp.name));
}
context.telemetry.properties.existingContainerApp = String(!!context.containerApp);

// Location
if (LocationListStep.hasLocation(context)) {
const location: string = (await LocationListStep.getLocation(context)).name;
ext.outputChannel.appendLog(localize('usingLocation', 'Using location: "{0}".', location));
}

this.hasLogged = true;
context.telemetry.properties.existingLocation = String(!!LocationListStep.hasLocation(context));
}
}
11 changes: 6 additions & 5 deletions src/commands/api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# Change Log

### 0.0.3
## 1.0.0
### Changed
* [[961](https://github.com/microsoft/vscode-azurecontainerapps/pull/961)] Add a new resource location parameter to the `deployWorkspaceProjectApi` definition. If no location is provided, try to infer location via other provided resources.
* [[961](https://github.com/microsoft/vscode-azurecontainerapps/pull/961)] Suppress registry prompting by default and remove associated flag (`suppressRegistryPrompt`)

## 0.0.3
### Added
* [[817]](https://github.com/microsoft/vscode-azurecontainerapps/pull/817) Added an API entry-point and compat wrapper for existing `deployImageApi` command

### Changed
* [[816]](https://github.com/microsoft/vscode-azurecontainerapps/pull/816) Added backward compatibility to ensure existing functionality remains unaffected by new managed identity features.

### 0.0.2

## 0.0.2
### Changed
* [[615]](https://github.com/microsoft/vscode-azurecontainerapps/pull/615) Removed ability to set option `ignoreExistingDeploySettings`. This will now happen automatically by default.

## 0.0.1
* Initial release

### Added
* [[578]](https://github.com/microsoft/vscode-azurecontainerapps/pull/578) Added an API entry-point to the `deployWorkspaceProject` command
13 changes: 9 additions & 4 deletions src/commands/api/deployWorkspaceProjectApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*--------------------------------------------------------------------------------------------*/

import { type ResourceGroup } from "@azure/arm-resources";
import { ResourceGroupListStep, parseAzureResourceGroupId } from "@microsoft/vscode-azext-azureutils";
import { callWithTelemetryAndErrorHandling, createSubscriptionContext, subscriptionExperience, type IActionContext, type ISubscriptionActionContext, type ISubscriptionContext } from "@microsoft/vscode-azext-utils";
import { LocationListStep, ResourceGroupListStep, parseAzureResourceGroupId } from "@microsoft/vscode-azext-azureutils";
import { callWithTelemetryAndErrorHandling, createSubscriptionContext, nonNullValueAndProp, subscriptionExperience, type IActionContext, type ISubscriptionActionContext, type ISubscriptionContext } from "@microsoft/vscode-azext-utils";
import { type AzureSubscription } from "@microsoft/vscode-azureresources-api";
import { Uri, type WorkspaceFolder } from "vscode";
import { ext } from "../../extensionVariables";
Expand All @@ -22,10 +22,10 @@ export async function deployWorkspaceProjectApi(deployWorkspaceProjectOptions: a
return await callWithTelemetryAndErrorHandling('containerApps.api.deployWorkspaceProject', async (context: IActionContext): Promise<DeployWorkspaceProjectResults> => {
const {
resourceGroupId,
location,
rootPath,
dockerfilePath,
srcPath,
suppressRegistryPrompt,
suppressConfirmation,
suppressContainerAppCreation,
shouldSaveDeploySettings
Expand All @@ -52,10 +52,15 @@ export async function deployWorkspaceProjectApi(deployWorkspaceProjectOptions: a
shouldSaveDeploySettings: !!shouldSaveDeploySettings,
});

if (location || deployWorkspaceProjectInternalContext.resourceGroup) {
const autoSelectLocation = location ?? nonNullValueAndProp(deployWorkspaceProjectInternalContext.resourceGroup, 'location');
await LocationListStep.setAutoSelectLocation(deployWorkspaceProjectInternalContext, autoSelectLocation);
Copy link
Copy Markdown
Contributor Author

@MicroFish91 MicroFish91 Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a few places I've added or switched usage to the new setAutoSelectLocation. This is because I think it's often times a safer pattern than setting the location directly. This is because setting the location manually doesn't respect when new resource providers are potentially added in the future.

}

const deployWorkspaceProjectContext: DeployWorkspaceProjectContext = await deployWorkspaceProjectInternal(deployWorkspaceProjectInternalContext, {
advancedCreate: false,
suppressActivity: true,
suppressConfirmation,
suppressRegistryPrompt: suppressRegistryPrompt ?? true,
suppressContainerAppCreation,
suppressProgress: true,
suppressWizardTitle: true,
Expand Down
4 changes: 1 addition & 3 deletions src/commands/api/getAzureContainerAppsApiProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import type * as api from "./vscode-azurecontainerapps.api";

export function getAzureContainerAppsApiProvider(): apiUtils.AzureExtensionApiProvider {
return createApiProvider([<api.AzureContainerAppsExtensionApi>{
// Todo: Change this to 0.0.3 later. 0.0.3 is backwards compatible anyway so this change should be fine either way.
// For some reason it's causing a block on Function side, so just keep it at 0.0.1 until we figure out why
apiVersion: '0.0.1',
apiVersion: '1.0.0',
Copy link
Copy Markdown
Contributor Author

@MicroFish91 MicroFish91 Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump to 1.0.0 because we were running into issues with semver not picking up newer versions when consuming in Functions... something related to needing to start from the first major release version.

deployImage: deployImageApi,
deployWorkspaceProject: deployWorkspaceProjectApi,
}]);
Expand Down
2 changes: 1 addition & 1 deletion src/commands/api/vscode-azurecontainerapps.api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ export interface DeployWorkspaceProjectOptionsContract {
// Existing resources
subscriptionId?: string;
resourceGroupId?: string;
location?: string;

// Workspace deployment paths (absolute fs path)
rootPath?: string;
srcPath?: string;
dockerfilePath?: string;

// Options
suppressRegistryPrompt?: boolean;
suppressConfirmation?: boolean; // Suppress any [resource] confirmation prompts
suppressContainerAppCreation?: boolean;
shouldSaveDeploySettings?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/commands/createContainerApp/ContainerAppCreateStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { KnownActiveRevisionsMode, type ContainerAppsAPIClient, type Ingress } f
import { LocationListStep } from "@microsoft/vscode-azext-azureutils";
import { AzureWizardExecuteStepWithActivityOutput, nonNullProp, nonNullValueAndProp, type AzureWizardExecuteStep } from "@microsoft/vscode-azext-utils";
import { type Progress } from "vscode";
import { containerAppsWebProvider, ImageSource } from "../../constants";
import { ImageSource } from "../../constants";
import { ContainerAppItem } from "../../tree/ContainerAppItem";
import { createContainerAppsAPIClient } from "../../utils/azureClients";
import { localize } from "../../utils/localize";
Expand Down Expand Up @@ -37,7 +37,7 @@ export class ContainerAppCreateStep<T extends ContainerAppCreateContext> extends
} : undefined;

context.containerApp = ContainerAppItem.CreateContainerAppModel(await appClient.containerApps.beginCreateOrUpdateAndWait(resourceGroupName, containerAppName, {
location: (await LocationListStep.getLocation(context, containerAppsWebProvider)).name,
location: (await LocationListStep.getLocation(context)).name,
managedEnvironmentId: context.managedEnvironment?.id,
configuration: {
ingress,
Expand Down
Loading