Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ export class AzureResourceMananger {
},
{
name: 'FUNCTIONS_WORKER_RUNTIME',
value: 'dotnet',
value: config.workerRuntime || 'dotnet',
},
{
name: 'APPINSIGHTS_INSTRUMENTATIONKEY',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ export interface AzureFunctionsConfig {
appId?: string;
appPwd?: string;
instrumentationKey?: string;
/**
* The worker runtime language.
* Currently documented values: dotnet, node, java, python, or powershell
*/
workerRuntime?: string;
}

export interface DeploymentsConfig {
Expand Down
26 changes: 16 additions & 10 deletions extensions/azurePublish/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,14 @@ export default async (composer: IExtensionRegistration): Promise<void> => {
/* These methods provision resources to azure async */
/*******************************************************************************************************************************/
asyncProvision = async (jobId: string, config: ProvisionConfig, project: IBotProject, user): Promise<void> => {
const { subscription, name } = config;
const { runtimeLanguage } = parseRuntimeKey(project.settings?.runtime?.key);
const provisionConfig: ProvisionConfig = { ...config, workerRuntime: runtimeLanguage };

const { name } = provisionConfig;

// Create the object responsible for actually taking the provision actions.
const azureProvisioner = new BotProjectProvision({
...config,
...provisionConfig,
logger: (msg: any) => {
this.logger(msg);
BackgroundProcessManager.updateProcess(jobId, 202, msg.message);
Expand All @@ -287,26 +291,28 @@ export default async (composer: IExtensionRegistration): Promise<void> => {
// perform the provision using azureProvisioner.create.
// this will start the process, then return.
// However, the process will continue in the background
const provisionResults = await azureProvisioner.create(config);
const provisionResults = await azureProvisioner.create(provisionConfig);

// cast this into the right form for a publish profile
let currentProfile = null;
if (config.currentProfile) {
currentProfile = JSON.parse(config.currentProfile.configuration);
if (provisionConfig.currentProfile) {
currentProfile = JSON.parse(provisionConfig.currentProfile.configuration);
}
const currentSettings = currentProfile?.settings;

const publishProfile = {
name: currentProfile?.name ?? config.hostname,
name: currentProfile?.name ?? provisionConfig.hostname,
environment: currentProfile?.environment ?? 'composer',
tenantId: provisionResults?.tenantId ?? currentProfile?.tenantId,
subscriptionId: provisionResults.subscriptionId ?? currentProfile?.subscriptionId,
resourceGroup: currentProfile?.resourceGroup ?? provisionResults.resourceGroup?.name,
botName: currentProfile?.botName ?? provisionResults.botName,
hostname: config.hostname ?? currentProfile?.hostname,
luisResource: provisionResults.luisPrediction ? `${config.hostname}-luis` : currentProfile?.luisResource,
hostname: provisionConfig.hostname ?? currentProfile?.hostname,
luisResource: provisionResults.luisPrediction
? `${provisionConfig.hostname}-luis`
: currentProfile?.luisResource,
runtimeIdentifier: currentProfile?.runtimeIdentifier ?? 'win-x64',
region: config.location,
region: provisionConfig.location,
settings: {
applicationInsights: {
InstrumentationKey:
Expand Down Expand Up @@ -355,7 +361,7 @@ export default async (composer: IExtensionRegistration): Promise<void> => {
await this.persistProvisionHistory(jobId, name, provisionHistoryPath);

// add in history
this.addProvisionHistory(project.id, config.name, BackgroundProcessManager.getStatus(jobId));
this.addProvisionHistory(project.id, provisionConfig.name, BackgroundProcessManager.getStatus(jobId));
BackgroundProcessManager.removeProcess(jobId);
};

Expand Down
6 changes: 6 additions & 0 deletions extensions/azurePublish/src/node/provision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ export interface ProvisionConfig {
logger?: (string) => any;
name: string; // profile name
type: string; // webapp or function
/**
* The worker runtime language for Azure functions.
* Currently documented values: dotnet, node, java, python, or powershell
*/
workerRuntime?: string;
choice?: string;
[key: string]: any;
}
Expand Down Expand Up @@ -326,6 +331,7 @@ export class BotProjectProvision {
resourceGroupName: resourceGroupName,
location: config.location ?? provisionResults.resourceGroup.location,
name: config.hostname,
workerRuntime: config.workerRuntime,
});
provisionResults.webApp = {
hostname: functionsHostName,
Expand Down