From f858ce019bbd6f654f50705681d9b413180fc406 Mon Sep 17 00:00:00 2001 From: Orlando Watson Date: Wed, 10 Mar 2021 10:58:51 -0800 Subject: [PATCH] [communication] use correct connection string env var (#14220) --- .../communication-phone-numbers/karma.conf.js | 2 +- sdk/communication/communication-phone-numbers/sample.env | 2 +- .../test/utils/recordedClient.ts | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sdk/communication/communication-phone-numbers/karma.conf.js b/sdk/communication/communication-phone-numbers/karma.conf.js index 6193684c1add..2b047521265f 100644 --- a/sdk/communication/communication-phone-numbers/karma.conf.js +++ b/sdk/communication/communication-phone-numbers/karma.conf.js @@ -58,7 +58,7 @@ module.exports = function(config) { // https://www.npmjs.com/package/karma-env-preprocessor envPreprocessor: [ "TEST_MODE", - "COMMUNICATION_CONNECTION_STRING", + "AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING", "INCLUDE_PHONENUMBER_LIVE_TESTS", "AZURE_PHONE_NUMBER", "COMMUNICATION_ENDPOINT" diff --git a/sdk/communication/communication-phone-numbers/sample.env b/sdk/communication/communication-phone-numbers/sample.env index 5d6b667d81f6..3e4072ee4d15 100644 --- a/sdk/communication/communication-phone-numbers/sample.env +++ b/sdk/communication/communication-phone-numbers/sample.env @@ -1,6 +1,6 @@ # Used in most samples. Retrieve these values from a Communication Services resource # in the Azure Portal. -COMMUNICATION_CONNECTION_STRING="endpoint=;accessKey=" +AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING="endpoint=;accessKey=" # Our tests assume that TEST_MODE is "playback" by default. You can # change it to "record" to generate new recordings, or "live" to bypass the recorder entirely. diff --git a/sdk/communication/communication-phone-numbers/test/utils/recordedClient.ts b/sdk/communication/communication-phone-numbers/test/utils/recordedClient.ts index a95350253495..e0fe4ff73ec3 100644 --- a/sdk/communication/communication-phone-numbers/test/utils/recordedClient.ts +++ b/sdk/communication/communication-phone-numbers/test/utils/recordedClient.ts @@ -26,7 +26,7 @@ export interface RecordedClient { } const replaceableVariables: { [k: string]: string } = { - COMMUNICATION_CONNECTION_STRING: "endpoint=https://endpoint/;accesskey=banana", + AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING: "endpoint=https://endpoint/;accesskey=banana", INCLUDE_PHONENUMBER_LIVE_TESTS: "false", COMMUNICATION_ENDPOINT: "https://endpoint/", AZURE_CLIENT_ID: "SomeClientId", @@ -54,7 +54,7 @@ export function createRecordedClient( const recorder = record(context, environmentSetup); return { - client: new PhoneNumbersClient(env.COMMUNICATION_CONNECTION_STRING), + client: new PhoneNumbersClient(env.AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING), recorder, includePhoneNumberLiveTests: env.INCLUDE_PHONENUMBER_LIVE_TESTS == "true" }; @@ -69,7 +69,8 @@ export function createRecordedClientWithToken( | undefined { const recorder = record(context, environmentSetup); let credential: TokenCredential; - const endpoint = parseConnectionString(env.COMMUNICATION_CONNECTION_STRING).endpoint; + const endpoint = parseConnectionString(env.AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING) + .endpoint; if (isPlaybackMode()) { credential = { getToken: async (_scopes) => {