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
10 changes: 8 additions & 2 deletions Composer/packages/lib/shared/src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ export const applyPublishingProfileToSettings = (settings: DialogSetting, profil

// apply the application insights resource from the publish profile
// to the telemetry setting
if (profile.settings.applicationInsights?.InstrumentationKey) {
if (
profile.settings.applicationInsights?.InstrumentationKey ||
profile.settings.applicationInsights?.connectionString
) {
settings.runtimeSettings.telemetry = {
instrumentationKey: profile.settings.applicationInsights.InstrumentationKey,
options: {
connectionString: profile.settings.applicationInsights.connectionString,
instrumentationKey: profile.settings.applicationInsights.InstrumentationKey,
},
};
}

Expand Down
1 change: 1 addition & 0 deletions Composer/packages/types/src/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export type PublishProfile = {
settings: {
applicationInsights?: {
InstrumentationKey: string;
connectionString?: string;
};
cosmosDb?: {
cosmosDBEndpoint: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,9 @@ export class AzureResourceMananger {
* Deploy application insights
* @param config
*/
public async deployAppInsightsResource(config: ApplicationInsightsConfig): Promise<{ instrumentationKey: string }> {
public async deployAppInsightsResource(
config: ApplicationInsightsConfig
): Promise<{ instrumentationKey: string; connectionString: string }> {
try {
this.logger({
status: BotProjectDeployLoggerType.PROVISION_INFO,
Expand Down Expand Up @@ -486,6 +488,7 @@ export class AzureResourceMananger {
// Update output and status
return {
instrumentationKey: deployResult.instrumentationKey,
connectionString: deployResult.connectionString,
};
} catch (err) {
this.logger({
Expand Down
2 changes: 2 additions & 0 deletions extensions/azurePublish/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ export default async (composer: IExtensionRegistration): Promise<void> => {
InstrumentationKey:
provisionResults.appInsights?.instrumentationKey ??
currentSettings?.applicationInsights?.InstrumentationKey,
connectionString:
provisionResults.appInsights?.connectionString ?? currentSettings?.applicationInsights?.connectionString,
},
cosmosDb: provisionResults.cosmosDB ?? currentSettings?.cosmosDb,
blobStorage: provisionResults.blobStorage ?? currentSettings?.blobStorage,
Expand Down
4 changes: 4 additions & 0 deletions extensions/azurePublish/src/node/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ const schema: JSONSchema7 = {
InstrumentationKey: {
type: 'string',
},
connectionString: {
type: 'string',
},
},
},
cosmosDb: {
Expand Down Expand Up @@ -149,6 +152,7 @@ const schema: JSONSchema7 = {
settings: {
applicationInsights: {
InstrumentationKey: '<Instrumentation Key>',
connectionString: '<connection string>',
},
cosmosDb: {
cosmosDBEndpoint: '<endpoint url>',
Expand Down