Skip to content

Commit f858ce0

Browse files
[communication] use correct connection string env var (Azure#14220)
1 parent f1dc4f7 commit f858ce0

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

sdk/communication/communication-phone-numbers/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = function(config) {
5858
// https://www.npmjs.com/package/karma-env-preprocessor
5959
envPreprocessor: [
6060
"TEST_MODE",
61-
"COMMUNICATION_CONNECTION_STRING",
61+
"AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING",
6262
"INCLUDE_PHONENUMBER_LIVE_TESTS",
6363
"AZURE_PHONE_NUMBER",
6464
"COMMUNICATION_ENDPOINT"

sdk/communication/communication-phone-numbers/sample.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Used in most samples. Retrieve these values from a Communication Services resource
22
# in the Azure Portal.
3-
COMMUNICATION_CONNECTION_STRING="endpoint=<endpoint>;accessKey=<accessKey>"
3+
AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING="endpoint=<endpoint>;accessKey=<accessKey>"
44

55
# Our tests assume that TEST_MODE is "playback" by default. You can
66
# change it to "record" to generate new recordings, or "live" to bypass the recorder entirely.

sdk/communication/communication-phone-numbers/test/utils/recordedClient.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface RecordedClient<T> {
2626
}
2727

2828
const replaceableVariables: { [k: string]: string } = {
29-
COMMUNICATION_CONNECTION_STRING: "endpoint=https://endpoint/;accesskey=banana",
29+
AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING: "endpoint=https://endpoint/;accesskey=banana",
3030
INCLUDE_PHONENUMBER_LIVE_TESTS: "false",
3131
COMMUNICATION_ENDPOINT: "https://endpoint/",
3232
AZURE_CLIENT_ID: "SomeClientId",
@@ -54,7 +54,7 @@ export function createRecordedClient(
5454
const recorder = record(context, environmentSetup);
5555

5656
return {
57-
client: new PhoneNumbersClient(env.COMMUNICATION_CONNECTION_STRING),
57+
client: new PhoneNumbersClient(env.AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING),
5858
recorder,
5959
includePhoneNumberLiveTests: env.INCLUDE_PHONENUMBER_LIVE_TESTS == "true"
6060
};
@@ -69,7 +69,8 @@ export function createRecordedClientWithToken(
6969
| undefined {
7070
const recorder = record(context, environmentSetup);
7171
let credential: TokenCredential;
72-
const endpoint = parseConnectionString(env.COMMUNICATION_CONNECTION_STRING).endpoint;
72+
const endpoint = parseConnectionString(env.AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING)
73+
.endpoint;
7374
if (isPlaybackMode()) {
7475
credential = {
7576
getToken: async (_scopes) => {

0 commit comments

Comments
 (0)