Skip to content

Commit f42d3cb

Browse files
authored
Durable Refactor: Storage, Netherite, SQL, & DTS (#4621)
* Durable Refactor: Netherite (Event Hubs & Storage Connections) (#4595) * Durable Refactor: SQL (#4619) * Durable Refactor: DTS (#4623)
1 parent 009e964 commit f42d3cb

File tree

107 files changed

+2496
-1748
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+2496
-1748
lines changed

src/commands/addBinding/settingSteps/LocalAppSettingListStep.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import { type BindingSettingValue } from '../../../funcConfig/function';
1111
import { getLocalSettingsJson, type ILocalSettingsJson } from '../../../funcConfig/local.settings';
1212
import { localize } from '../../../localize';
1313
import { ResourceType } from '../../../templates/IBindingTemplate';
14-
import { type IEventHubsConnectionWizardContext } from '../../appSettings/connectionSettings/eventHubs/IEventHubsConnectionWizardContext';
14+
import { type INetheriteConnectionWizardContext as IEventHubsConnectionWizardContext } from '../../appSettings/connectionSettings/netherite/INetheriteConnectionWizardContext';
15+
import { EventHubsNamespaceListStep } from '../../appSettings/connectionSettings/netherite/azure/EventHubsNamespaceListStep';
1516
import { getBindingSetting, type FunctionV2WizardContext, type IFunctionWizardContext } from '../../createFunction/IFunctionWizardContext';
16-
import { EventHubsNamespaceListStep } from '../../createFunction/durableSteps/netherite/EventHubsNamespaceListStep';
1717
import { BindingSettingStepBase } from './BindingSettingStepBase';
1818
import { LocalAppSettingCreateStep } from './LocalAppSettingCreateStep';
1919
import { LocalAppSettingNameStep } from './LocalAppSettingNameStep';

src/commands/addBinding/settingSteps/StorageConnectionCreateStep.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { type IStorageAccountWizardContext } from '@microsoft/vscode-azext-azureutils';
7-
import { getStorageConnectionString } from '../../appSettings/connectionSettings/getLocalConnectionSetting';
7+
import { getStorageConnectionString } from '../../appSettings/connectionSettings/azureWebJobsStorage/getStorageConnectionString';
88
import { type IFunctionWizardContext } from '../../createFunction/IFunctionWizardContext';
99
import { AzureConnectionCreateStepBase, type IConnection } from './AzureConnectionCreateStepBase';
1010

src/commands/addBinding/settingSteps/StorageTypePromptStep.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { AzureWizardPromptStep, type AzureWizardExecuteStep, type IAzureQuickPic
88
import { localize } from "../../../localize";
99
import { type IBindingSetting } from "../../../templates/IBindingTemplate";
1010
import { type ParsedInput } from "../../../templates/script/parseScriptTemplatesV2";
11-
import { type IEventHubsConnectionWizardContext } from "../../appSettings/connectionSettings/eventHubs/IEventHubsConnectionWizardContext";
11+
import { type INetheriteConnectionWizardContext as IEventHubsConnectionWizardContext } from "../../appSettings/connectionSettings/netherite/INetheriteConnectionWizardContext";
1212
import { type IFunctionWizardContext } from "../../createFunction/IFunctionWizardContext";
1313
import { StorageConnectionCreateStep } from "./StorageConnectionCreateStep";
1414

src/commands/addBinding/settingSteps/eventHub/IEventHubWizardContext.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { type AuthorizationRule, type EHNamespace } from '@azure/arm-eventhub';
6+
import { type AuthorizationRule, type EHNamespace, type Eventhub } from '@azure/arm-eventhub';
77
import { type IResourceGroupWizardContext } from '@microsoft/vscode-azext-azureutils';
88
import { type ISubscriptionActionContext } from '@microsoft/vscode-azext-utils';
99

@@ -15,6 +15,7 @@ export interface IEventHubWizardContext extends ISubscriptionActionContext, IRes
1515
newEventHubsNamespaceName?: string;
1616
eventHubsNamespace?: EHNamespace;
1717
newEventHubName?: string;
18+
eventHub?: Eventhub;
1819
newAuthRuleName?: string;
1920
authRule?: AuthorizationRule;
2021
isNamespaceAuthRule?: boolean;

src/commands/appSettings/connectionSettings/IConnectionPromptOptions.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/commands/appSettings/connectionSettings/ISetConnectionSettingContext.ts

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,46 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { type IActionContext } from "@microsoft/vscode-azext-utils";
7-
import { type CodeAction, type ConnectionKey } from "../../../constants";
7+
import { type CodeAction } from "../../../constants";
88
import { type IConnectionTypesContext } from "./IConnectionTypesContext";
99

10-
export interface ISetConnectionSettingContext extends IActionContext, IConnectionTypesContext {
10+
export interface ISetConnectionSettingContext extends IActionContext, IConnectionTypesContext, IDurableStorageProvidersSetSettingsContext {
1111
action: CodeAction;
1212
projectPath: string;
13+
}
14+
15+
// -- Durable Storage Provider contexts --
16+
17+
type IDurableStorageProvidersSetSettingsContext = IStorageConnectionSetSettingsContext & IEventHubsConnectionSetSettingsContext & IDTSConnectionSetSettingsContext & ISqlDbConnectionSetSettingsContext;
18+
19+
export interface IStorageConnectionSetSettingsContext {
20+
newStorageConnectionSettingKey?: string;
21+
newStorageConnectionSettingValue?: string;
22+
}
23+
24+
export interface IEventHubsConnectionSetSettingsContext {
25+
newEventHubsNamespaceConnectionSettingKey?: string;
26+
newEventHubsNamespaceConnectionSettingValue?: string;
27+
28+
/**
29+
* Explicitly `undefined` when the `host.json` sets this value for us (there will be no corresponding app or local settings)
30+
*/
31+
newEventHubConnectionSettingKey?: string | undefined;
32+
newEventHubConnectionSettingValue?: string;
33+
}
34+
35+
export interface IDTSConnectionSetSettingsContext {
36+
newDTSConnectionSettingKey?: string;
37+
newDTSConnectionSettingValue?: string;
38+
39+
/**
40+
* Explicitly `undefined` when the `host.json` sets this value for us (there will be no corresponding app or local settings)
41+
*/
42+
newDTSHubConnectionSettingKey?: string;
43+
newDTSHubConnectionSettingValue?: string;
44+
}
1345

14-
// Remote connections for deploy
15-
[ConnectionKey.Storage]?: string;
16-
[ConnectionKey.EventHubs]?: string;
17-
[ConnectionKey.DTS]?: string;
18-
[ConnectionKey.DTSHub]?: string;
19-
[ConnectionKey.SQL]?: string;
46+
export interface ISqlDbConnectionSetSettingsContext {
47+
newSQLStorageConnectionSettingKey?: string;
48+
newSQLStorageConnectionSettingValue?: string;
2049
}

src/commands/appSettings/connectionSettings/SetConnectionSettingStepBase.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/commands/appSettings/connectionSettings/azureWebJobsStorage/AzureWebJobsStorageExecuteStep.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/commands/appSettings/connectionSettings/azureWebJobsStorage/AzureWebJobsStoragePromptStep.ts

Lines changed: 0 additions & 105 deletions
This file was deleted.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { type StorageAccount } from "@azure/arm-storage";
7-
import { type ISubscriptionContext } from "@microsoft/vscode-azext-utils";
6+
import { type IStorageAccountWizardContext } from "@microsoft/vscode-azext-azureutils";
87
import { type StorageConnectionType } from "../IConnectionTypesContext";
98
import { type ISetConnectionSettingContext } from "../ISetConnectionSettingContext";
109

11-
export interface IAzureWebJobsStorageWizardContext extends ISetConnectionSettingContext, Partial<ISubscriptionContext> {
12-
storageAccount?: StorageAccount;
13-
newStorageAccountName?: string;
14-
10+
export interface IStorageConnectionWizardContext extends ISetConnectionSettingContext {
1511
azureWebJobsStorageType?: StorageConnectionType;
12+
13+
// All properties from `IStorageConnectionSetSettingsContext` apply
1614
}
15+
16+
export type IStorageAzureConnectionWizard = IStorageAccountWizardContext & IStorageConnectionWizardContext;

0 commit comments

Comments
 (0)