Skip to content
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
1d32cd2
Scaffold BDP.
philliphoff Jan 13, 2025
4d9864d
Refactor type hierarchy.
philliphoff Jan 13, 2025
7df4864
Sketch retrieval of task hubs.
philliphoff Jan 14, 2025
9212ddc
Update task hub icon.
philliphoff Jan 14, 2025
c59c09a
Enable "open in portal" command for task hubs.
philliphoff Jan 14, 2025
97ab3c7
Scaffold "open in dashboard" command.
philliphoff Jan 14, 2025
ad68a74
Sketch "open in dashboard" implementation.
philliphoff Jan 14, 2025
9f457a5
Move DTS management to separate client type.
philliphoff Jan 14, 2025
44c4d45
Support viewing task hub properties.
philliphoff Jan 14, 2025
045a889
Split apart types.
philliphoff Jan 14, 2025
56e0657
Add file headers.
philliphoff Jan 14, 2025
872b8fb
Consolidate client logic and add localizable strings.
philliphoff Jan 14, 2025
f3d7506
Merge branch 'main' into philliphoff-dts-nodes
philliphoff Jan 14, 2025
bb92c76
Scaffold creation of task hub.
philliphoff Jan 25, 2025
f36b3c3
Sketch creation of schedulers.
philliphoff Jan 27, 2025
c986f37
Merge branch 'main' into philliphoff-manage-schedulers
philliphoff Jan 27, 2025
5008def
Expose DTS creation from common new menu.
philliphoff Jan 27, 2025
b22d97d
Sketch deletion of task hubs.
philliphoff Jan 28, 2025
2bf4748
Sketch deletion of schedulers.
philliphoff Jan 28, 2025
c741264
Sketch refreshing models post-creation.
philliphoff Jan 30, 2025
e3f1125
Add tree refresh to remainder of DTS commands.
philliphoff Jan 30, 2025
0fe25f8
Provide extended schduler properties.
philliphoff Jan 30, 2025
18fca77
Add provisioning state when not "normal".
philliphoff Jan 30, 2025
19f70c2
Move creation command to top of context menu.
philliphoff Jan 30, 2025
db2d957
Add copy scheduler endpoint command.
philliphoff Jan 30, 2025
5e7d1ea
Sketch copy connections string command.
philliphoff Jan 31, 2025
b61e5f5
Add task hub selection for connection string.
philliphoff Jan 31, 2025
abe8d29
Add async waits.
philliphoff Jan 31, 2025
92c3f12
Wrap deletion in an activity.
philliphoff Feb 3, 2025
bbc47c0
Add some robustness to API call failures.
philliphoff Feb 3, 2025
992c2f8
Tweak strings for task hub selection.
philliphoff Feb 3, 2025
b3f2022
Wrap task hub creation with activity.
philliphoff Feb 3, 2025
0d5ee1a
Wrap task hub deletion with activity.
philliphoff Feb 3, 2025
3b52269
Add retry for task hub retrieval.
philliphoff Feb 3, 2025
1eb351e
Scaffold DTS emulators workspace tree.
philliphoff Feb 3, 2025
7f29265
Sketch display of running DTS emulators.
philliphoff Feb 4, 2025
9678041
Scaffold start/stop emulator commands.
philliphoff Feb 4, 2025
59eb3e5
Implement stop emulator command.
philliphoff Feb 4, 2025
e34cdde
Implement start emulator command.
philliphoff Feb 4, 2025
02092f9
Add open dashboard for emulator task hub.
philliphoff Feb 4, 2025
2c9cd5f
Hide DTS commands from palette.
philliphoff Feb 4, 2025
85fe2bc
Add verify providers step to scheduler creation.
philliphoff Feb 4, 2025
dc569e8
Un-hide create scheduler command.
philliphoff Feb 4, 2025
6407f41
Sketch DTS setting.
philliphoff Feb 4, 2025
0370550
Refactor DTS preview setting name.
philliphoff Feb 4, 2025
b8ae76e
Add preview features enabled check during create.
philliphoff Feb 4, 2025
0c37245
Merge branch 'philliphoff-manage-schedulers' into philliphoff-emulato…
philliphoff Feb 5, 2025
e0f438c
Stop local emulators on shutdown.
philliphoff Feb 5, 2025
837a90c
Add copy endpoint command to emulator items.
philliphoff Feb 5, 2025
9061445
Add copy connection string for emulators.
philliphoff Feb 7, 2025
5f3e223
Move emulator image details/defaults to configuration.
philliphoff Feb 7, 2025
d5b6867
Exclude stopped/paused emulator containers.
philliphoff Feb 7, 2025
0512e95
Merge branch 'main' into philliphoff-emulator-integration
philliphoff Feb 11, 2025
ee0288f
Tweak emulator shutdown.
philliphoff Mar 8, 2025
66dda84
Merge branch 'main' into philliphoff-emulator-integration
philliphoff Mar 8, 2025
49d5100
Hide emulator commands from palette.
philliphoff Mar 8, 2025
8446d46
Add missing headers.
philliphoff Mar 9, 2025
b14fd22
Improve container command error handling.
philliphoff Mar 14, 2025
3aa7ba1
Auto-expand when emulators are running.
philliphoff Mar 14, 2025
7c2d12b
Make primary commands more prominent.
philliphoff Apr 9, 2025
3280a62
Merge branch 'main' into philliphoff-emulator-integration
philliphoff Apr 9, 2025
068f326
Fixup bad merge.
philliphoff Apr 9, 2025
5320cc1
Updates per PR feedback.
philliphoff May 14, 2025
2cc041d
More updates per PR feedback.
philliphoff May 16, 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
28 changes: 28 additions & 0 deletions package-lock.json

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

82 changes: 79 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
"branches": [
{
"type": "func"
},
{
"type": "DurableTaskSchedulerEmulator"
}
],
"resources": true
Expand Down Expand Up @@ -407,6 +410,11 @@
"title": "%azureFunctions.enableSystemIdentity%",
"category": "Azure Functions"
},
{
"command": "azureFunctions.durableTaskScheduler.copyEmulatorConnectionString",
"title": "%azureFunctions.durableTaskScheduler.copyEmulatorConnectionString%",
"category": "Azure Functions"
},
{
"command": "azureFunctions.durableTaskScheduler.copySchedulerConnectionString",
"title": "%azureFunctions.durableTaskScheduler.copySchedulerConnectionString%",
Expand Down Expand Up @@ -440,7 +448,20 @@
{
"command": "azureFunctions.durableTaskScheduler.openTaskHubDashboard",
"title": "%azureFunctions.durableTaskScheduler.openTaskHubDashboard%",
"category": "Azure Functions"
"category": "Azure Functions",
"icon": "$(dashboard)"
},
{
"command": "azureFunctions.durableTaskScheduler.startEmulator",
"title": "%azureFunctions.durableTaskScheduler.startEmulator%",
"category": "Azure Functions",
"icon": "$(debug-start)"
},
{
"command": "azureFunctions.durableTaskScheduler.stopEmulator",
"title": "%azureFunctions.durableTaskScheduler.stopEmulator%",
"category": "Azure Functions",
"icon": "$(debug-stop)"
}
],
"submenus": [
Expand Down Expand Up @@ -765,14 +786,19 @@
"when": "view =~ /(azureResourceGroups|azureFocusView)/ && viewItem =~ /userAssignedIdentity/",
"group": "1@1"
},
{
"command": "azureFunctions.durableTaskScheduler.copyEmulatorConnectionString",
"when": "view =~ /(azureWorkspace|azureFocusView)/ && viewItem =~ /azFunc.dts.emulatorInstance/",
"group": "3@1"
},
{
"command": "azureFunctions.durableTaskScheduler.copySchedulerConnectionString",
"when": "view =~ /(azureResourceGroups|azureFocusView)/ && viewItem =~ /azFunc.dts.scheduler/",
"group": "3@1"
},
{
"command": "azureFunctions.durableTaskScheduler.copySchedulerEndpoint",
"when": "view =~ /(azureResourceGroups|azureFocusView)/ && viewItem =~ /azFunc.dts.scheduler/",
"when": "view =~ /(azureResourceGroups|azureWorkspace|azureFocusView)/ && viewItem =~ /azFunc.dts.schedulerEndpoint/",
"group": "3@2"
},
{
Expand All @@ -797,8 +823,33 @@
},
{
"command": "azureFunctions.durableTaskScheduler.openTaskHubDashboard",
"when": "view =~ /(azureResourceGroups|azureFocusView)/ && viewItem =~ /azFunc.dts.taskHub/",
"when": "view =~ /(azureResourceGroups|azureWorkspace|azureFocusView)/ && viewItem =~ /azFunc.dts.taskHubDashboard/",
"group": "1@1"
},
{
"command": "azureFunctions.durableTaskScheduler.openTaskHubDashboard",
"when": "view =~ /(azureResourceGroups|azureWorkspace|azureFocusView)/ && viewItem =~ /azFunc.dts.taskHubDashboard/",
"group": "inline"
},
{
"command": "azureFunctions.durableTaskScheduler.startEmulator",
"when": "view == azureWorkspace && viewItem =~ /azFunc.dts.emulators/",
"group": "1@1"
},
{
"command": "azureFunctions.durableTaskScheduler.startEmulator",
"when": "view =~ /(azureWorkspace|azureFocusView)/ && viewItem =~ /azFunc.dts.emulators/",
"group": "inline"
},
{
"command": "azureFunctions.durableTaskScheduler.stopEmulator",
"when": "view =~ /(azureWorkspace|azureFocusView)/ && viewItem =~ /azFunc.dts.emulatorInstance/",
"group": "1@1"
},
{
"command": "azureFunctions.durableTaskScheduler.stopEmulator",
"when": "view =~ /(azureWorkspace|azureFocusView)/ && viewItem =~ /azFunc.dts.emulatorInstance/",
"group": "inline"
}
],
"explorer/context": [
Expand Down Expand Up @@ -852,6 +903,10 @@
"command": "azureFunctions.viewProperties",
"when": "never"
},
{
"command": "azureFunctions.durableTaskScheduler.copyEmulatorConnectionString",
"when": "never"
},
{
"command": "azureFunctions.durableTaskScheduler.copySchedulerConnectionString",
"when": "never"
Expand Down Expand Up @@ -880,6 +935,10 @@
"command": "azureFunctions.durableTaskScheduler.openTaskHubDashboard",
"when": "never"
},
{
"command": "azureFunctions.durableTaskScheduler.stopEmulator",
"when": "never"
},
{
"command": "azureFunctions.unassignManagedIdentity",
"when": "never"
Expand Down Expand Up @@ -997,6 +1056,21 @@
"type": "boolean",
"default": false,
"description": "%azureFunctions.durableTaskScheduler.enablePreviewFeatures%"
},
"azureFunctions.durableTaskScheduler.emulatorRegistry": {
"type": "string",
"description": "%azureFunctions.durableTaskScheduler.emulatorRegistry%",
"default": "mcr.microsoft.com"
},
"azureFunctions.durableTaskScheduler.emulatorImage": {
"type": "string",
"description": "%azureFunctions.durableTaskScheduler.emulatorImage%",
"default": "dts/dts-emulator"
},
"azureFunctions.durableTaskScheduler.emulatorTag": {
"type": "string",
"description": "%azureFunctions.durableTaskScheduler.emulatorTag%",
"default": "latest"
}
}
},
Expand Down Expand Up @@ -1395,6 +1469,7 @@
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0",
"vscode-azurekudu": "^0.2.0",
"vscode-jsonrpc": "^8.2.1",
"webpack": "^5.96.1",
"webpack-cli": "^4.6.0"
},
Expand All @@ -1415,6 +1490,7 @@
"@microsoft/vscode-azext-azureutils": "^3.1.7",
"@microsoft/vscode-azext-utils": "^2.6.6",
"@microsoft/vscode-azureresources-api": "^2.0.4",
"@microsoft/vscode-container-client": "^0.1.2",
"cross-fetch": "^4.0.0",
"escape-string-regexp": "^4.0.0",
"extract-zip": "^2.0.1",
Expand Down
8 changes: 7 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
"azureFunctions.walkthrough.functionsStart.scenarios.description": "Learn how you can use Azure Functions to build event-driven systems.\n\nIf you're just getting started with Azure Functions, you can [learn about the anatomy of an Azure Functions application](https://aka.ms/functions-getstarted-devguide).",
"azureFunctions.walkthrough.functionsStart.scenarios.title": "Explore common scenarios",
"azureFunctions.walkthrough.functionsStart.title": "Get Started with Azure Functions",
"azureFunctions.durableTaskScheduler.copyEmulatorConnectionString": "Copy Connection String",
"azureFunctions.durableTaskScheduler.copySchedulerConnectionString": "Copy Connection String",
"azureFunctions.durableTaskScheduler.copySchedulerEndpoint": "Copy Endpoint",
"azureFunctions.durableTaskScheduler.createScheduler": "Create Durable Task Scheduler...",
Expand All @@ -133,5 +134,10 @@
"azureFunctions.durableTaskScheduler.deleteScheduler": "Delete Scheduler...",
"azureFunctions.durableTaskScheduler.deleteTaskHub": "Delete Task Hub...",
"azureFunctions.durableTaskScheduler.openTaskHubDashboard": "Open in Dashboard",
"azureFunctions.durableTaskScheduler.enablePreviewFeatures": "Enable Durable Task Scheduler preview features"
"azureFunctions.durableTaskScheduler.startEmulator": "Start Durable Task Emulator",
"azureFunctions.durableTaskScheduler.stopEmulator": "Stop Emulator",
"azureFunctions.durableTaskScheduler.enablePreviewFeatures": "Enable Durable Task Scheduler preview features",
"azureFunctions.durableTaskScheduler.emulatorRegistry": "The registry of the Durable Task Scheduler emulator image.",
"azureFunctions.durableTaskScheduler.emulatorImage": "The name of the Durable Task Scheduler emulator image.",
"azureFunctions.durableTaskScheduler.emulatorTag": "The tag of the Durable Task Scheduler emulator image."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { type IActionContext } from "@microsoft/vscode-azext-utils";
import { localize } from "../../localize";
import { ext } from "../../extensionVariables";
import { env, QuickPickItemKind, type QuickPickItem } from "vscode";
import { type DurableTaskSchedulerEmulatorWorkspaceResourceModel } from "../../tree/durableTaskScheduler/DurableTaskSchedulerEmulatorWorkspaceResourceModel";

export function copyEmulatorConnectionStringCommandFactory() {
return async (actionContext: IActionContext, scheduler: DurableTaskSchedulerEmulatorWorkspaceResourceModel | undefined): Promise<void> => {
if (!scheduler) {
throw new Error(localize('noSchedulerSelectedErrorMessage', 'No scheduler was selected.'));
}

const { endpointUrl } = scheduler;

let connectionString = `Endpoint=${endpointUrl};Authentication=None`;

const taskHubs = scheduler.taskHubs;

if (taskHubs.length > 0) {

const noTaskHubItem: QuickPickItem = {
detail: localize('noTaskHubDetail', 'Do not connect to a specific task hub.'),
label: localize('noTaskHubLabel', 'None')
}

const taskHubItems: QuickPickItem[] =
taskHubs.map(taskHub => ({ label: taskHub }));

const taskHubResult = await actionContext.ui.showQuickPick(
[
noTaskHubItem,
{
kind: QuickPickItemKind.Separator,
label: localize('taskHubSepratorLabel', 'Task Hubs')
},
...taskHubItems
],
{
canPickMany: false,
placeHolder: localize('taskHubSelectionPlaceholder', 'Select a task hub to connect to')
});

if (taskHubResult && taskHubResult !== noTaskHubItem) {
connectionString += `;TaskHub=${taskHubResult.label}`;
}
}

await env.clipboard.writeText(connectionString);

ext.outputChannel.show();
ext.outputChannel.appendLog(localize('schedulerConnectionStringCopiedMessage', 'Connection string copied to clipboard: {0}', connectionString));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,7 @@ export function copySchedulerConnectionStringCommandFactory(schedulerClient: Dur
throw new Error(localize('noSchedulerSelectedErrorMessage', 'No scheduler was selected.'));
}

const schedulerJson = await schedulerClient.getScheduler(
scheduler.subscription,
scheduler.resourceGroup,
scheduler.name);

if (!schedulerJson) {
throw new Error(localize('schedulerNotFoundErrorMessage', 'Scheduler does not exist.'));
}

const { endpoint } = schedulerJson.properties;
const { endpointUrl } = scheduler;

const noAuthentication: QuickPickItem = {
detail: localize('noAuthenticationDetail', 'No credentials will be used.'),
Expand Down Expand Up @@ -59,7 +50,7 @@ export function copySchedulerConnectionStringCommandFactory(schedulerClient: Dur
placeHolder: localize('authenticationTypePlaceholder', 'Select the credentials to be used to connect to the scheduler')
});

let connectionString = `Endpoint=${endpoint};Authentication=`
let connectionString = `Endpoint=${endpointUrl};Authentication=`

if (result === noAuthentication) {
connectionString += 'None';
Expand Down
22 changes: 6 additions & 16 deletions src/commands/durableTaskScheduler/copySchedulerEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,22 @@
*--------------------------------------------------------------------------------------------*/

import { type IActionContext } from "@microsoft/vscode-azext-utils";
import { type DurableTaskSchedulerClient } from "../../tree/durableTaskScheduler/DurableTaskSchedulerClient";
import { type DurableTaskSchedulerResourceModel } from "../../tree/durableTaskScheduler/DurableTaskSchedulerResourceModel";
import { localize } from "../../localize";
import { ext } from "../../extensionVariables";
import { env } from "vscode";
import { type DurableTaskSchedulerEndpointModel } from "../../tree/durableTaskScheduler/DurableTaskSchedulerEndpointModel";

export function copySchedulerEndpointCommandFactory(schedulerClient: DurableTaskSchedulerClient) {
return async (_: IActionContext, scheduler: DurableTaskSchedulerResourceModel | undefined): Promise<void> => {
export function copySchedulerEndpointCommandFactory() {
return async (_: IActionContext, scheduler: DurableTaskSchedulerEndpointModel | undefined): Promise<void> => {
if (!scheduler) {
throw new Error(localize('noSchedulerSelectedErrorMessage', 'No scheduler was selected.'));
}

const schedulerJson = await schedulerClient.getScheduler(
scheduler.subscription,
scheduler.resourceGroup,
scheduler.name);
const { endpointUrl } = scheduler;

if (!schedulerJson) {
throw new Error(localize('schedulerNotFoundErrorMessage', 'Scheduler does not exist.'));
}

const { endpoint } = schedulerJson.properties;

await env.clipboard.writeText(endpoint);
await env.clipboard.writeText(endpointUrl.toString());

ext.outputChannel.show();
ext.outputChannel.appendLog(localize('schedulerEndpointCopiedMessage', 'Endpoint copied to clipboard: {0}', endpoint));
ext.outputChannel.appendLog(localize('schedulerEndpointCopiedMessage', 'Endpoint copied to clipboard: {0}', endpointUrl.toString()));
}
}
4 changes: 2 additions & 2 deletions src/commands/durableTaskScheduler/openTaskHubDashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*--------------------------------------------------------------------------------------------*/

import { openUrl, type IActionContext } from "@microsoft/vscode-azext-utils";
import { type DurableTaskHubResourceModel } from "../../tree/durableTaskScheduler/DurableTaskHubResourceModel";
import { localize } from '../../localize';
import { type DurableTaskSchedulerDashboardModel } from "../../tree/durableTaskScheduler/DurableTaskSchedulerDashboardModel";

export async function openTaskHubDashboard(_: IActionContext, taskHub: DurableTaskHubResourceModel | undefined): Promise<void> {
export async function openTaskHubDashboard(_: IActionContext, taskHub: DurableTaskSchedulerDashboardModel | undefined): Promise<void> {
if (!taskHub) {
throw new Error(localize('noTaskHubSelectedErrorMessage', 'No task hub was selected.'));
}
Expand Down
13 changes: 13 additions & 0 deletions src/commands/durableTaskScheduler/startEmulator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { type IActionContext } from "@microsoft/vscode-azext-utils";
import { type DurableTaskSchedulerEmulatorClient } from "../../tree/durableTaskScheduler/DurableTaskSchedulerEmulatorClient";

export function startEmulatorCommandFactory(emulatorClient: DurableTaskSchedulerEmulatorClient) {
return async (_: IActionContext) => {
await emulatorClient.startEmulator();
};
}
Loading