Skip to content

Commit

Permalink
[Communication]: Cleaned up ACS samples (#18656)
Browse files Browse the repository at this point in the history
* Cleaned up ACS samples

* Updated ACS account to ACS resource
  • Loading branch information
lsundaralingam authored May 12, 2021
1 parent 69e2e21 commit 802c887
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
USAGE:
python identity_samples.py
Set the environment variables with your own values before running the sample:
2) COMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS account
3) AZURE_CLIENT_ID - the client ID of your active directory application
4) AZURE_CLIENT_SECRET - the secret of your active directory application
5) AZURE_TENANT_ID - the tenant ID of your active directory application
1) COMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS resource
2) AZURE_CLIENT_ID - the client ID of your active directory application
3) AZURE_CLIENT_SECRET - the secret of your active directory application
4) AZURE_TENANT_ID - the tenant ID of your active directory application
"""
import os
from azure.communication.identity._shared.utils import parse_connection_str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
python identity_samples_async.py
Set the environment variables with your own values before running the sample:
1) AZURE_COMMUNICATION_SERVICE_ENDPOINT - Communication Service endpoint url
2) COMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS account
2) COMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS resource
3) AZURE_CLIENT_ID - the client ID of your active directory application
4) AZURE_CLIENT_SECRET - the secret of your active directory application
5) AZURE_TENANT_ID - the tenant ID of your active directory application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
python purchase_phone_number_sample.py
Set the environment variables with your own values before running the sample:
1) COMMUNICATION_SAMPLES_CONNECTION_STRING - The connection string including your endpoint and
access key of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_SEARCH_ID_TO_PURCHASE - The search id for the phone number you reserved and want to purchase
access key of your Azure Communication Service
2) AZURE_COMMUNICATION_SERVICE_SEARCH_ID_TO_PURCHASE - The search id for the phone number you
reserved and want to purchase
"""

import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
USAGE:
python send_sms_to_multiple_recipients_sample.py
Set the environment variable with your own value before running the sample:
1) COMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS account
1) COMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS resource
2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER - a phone number with SMS capabilities in your ACS resource
"""

import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
USAGE:
python send_sms_to_multiple_recipients_sample_async.py
Set the environment variable with your own value before running the sample:
1) COMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS account
1) COMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS resource
2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER - a phone number with SMS capabilities in your ACS resource
"""

import os
Expand All @@ -37,7 +38,7 @@ async def send_sms_to_multiple_recipients_async(self):
# calling send() with sms values
sms_responses = await sms_client.send(
from_=self.phone_number,
to=[self.phone_number,self.phone_number],
to=[self.phone_number, self.phone_number],
message="Hello World via SMS",
enable_delivery_report=True, # optional property
tag="custom-tag") # optional property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
USAGE:
python send_sms_to_single_recipient_sample.py
Set the environment variable with your own value before running the sample:
1) COMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS account
1) COMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS resource
2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER - a phone number with SMS capabilities in your ACS resource
"""

import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
USAGE:
python send_sms_to_single_recipient_sample_async.py
Set the environment variable with your own value before running the sample:
1) COMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS account
1) COMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS resource
2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER - a phone number with SMS capabilities in your ACS resource
"""

import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
USAGE:
python sms_token_credential_auth_sample.py
Set the environment variable with your own value before running the sample:
1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - the connection string in your ACS account
1) COMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS resource
2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER - a phone number with SMS capabilities in your ACS resource
"""

import os
Expand All @@ -27,7 +28,7 @@

class SmsTokenCredentialAuthSample(object):

connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING')
connection_str = os.getenv('COMMUNICATION_SAMPLES_CONNECTION_STRING')
phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER")

def sms_token_credential_auth(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
USAGE:
python sms_token_credential_auth_sample_async.py
Set the environment variable with your own value before running the sample:
1) COMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS account
1) COMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS resource
2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER - a phone number with SMS capabilities in your ACS resource
"""

import os
Expand Down

0 comments on commit 802c887

Please sign in to comment.