-
Notifications
You must be signed in to change notification settings - Fork 149
Expand file tree
/
Copy pathmanagedIdentityUtils.ts
More file actions
29 lines (26 loc) · 1.39 KB
/
managedIdentityUtils.ts
File metadata and controls
29 lines (26 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { type NameValuePair } from "@azure/arm-appservice";
import { type IFunctionAppWizardContext } from "../commands/createFunctionApp/IFunctionAppWizardContext";
import { ConnectionKey } from "../constants";
export function createAzureWebJobsStorageManagedIdentitySettings(context: IFunctionAppWizardContext): NameValuePair[] {
const appSettings: NameValuePair[] = [];
const storageAccountName = context.newStorageAccountName ?? context.storageAccount?.name;
if (context.managedIdentity) {
appSettings.push({
name: `${ConnectionKey.Storage}__blobServiceUri`,
value: `https://${storageAccountName}.blob.core.windows.net`
});
appSettings.push({
name: `${ConnectionKey.Storage}__queueServiceUri`,
value: `https://${storageAccountName}.queue.core.windows.net`
});
appSettings.push({
name: `${ConnectionKey.Storage}__tableServiceUri`,
value: `https://${storageAccountName}.table.core.windows.net`
});
}
return appSettings;
}