Skip to content

Commit

Permalink
[communication] use correct connection string env var (#14220)
Browse files Browse the repository at this point in the history
  • Loading branch information
0rland0Wats0n authored Mar 10, 2021
1 parent f1dc4f7 commit f858ce0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-phone-numbers/sample.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Used in most samples. Retrieve these values from a Communication Services resource
# in the Azure Portal.
COMMUNICATION_CONNECTION_STRING="endpoint=<endpoint>;accessKey=<accessKey>"
AZURE_COMMUNICATION_LIVETEST_CONNECTION_STRING="endpoint=<endpoint>;accessKey=<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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface RecordedClient<T> {
}

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",
Expand Down Expand Up @@ -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"
};
Expand All @@ -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) => {
Expand Down

0 comments on commit f858ce0

Please sign in to comment.