Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing communication test scripts #39355

Merged
merged 2 commits into from
Oct 18, 2023
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
19 changes: 19 additions & 0 deletions sdk/communication/test-resources/test-resources-post.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,33 @@ function Log($Message) {

Log 'Starting sdk\communication\test-resources\test-resources-post.ps1'

if($DeploymentOutputs.ContainsKey('COMMUNICATION_SERVICE_ENDPOINT')){
Write-Host "COMMUNICATION_SERVICE_ENDPOINT exists, proceeding."
}else{
Write-Host "COMMUNICATION_SERVICE_ENDPOINT does not exist, ending."
exit
}
$communicationServiceEndpoint = $DeploymentOutputs["COMMUNICATION_SERVICE_ENDPOINT"]

if ($communicationServiceEndpoint -notmatch '\/$') {
Log "adding trailing slash to $communicationServiceEndpoint"
$communicationServiceEndpoint = $communicationServiceEndpoint + "/"
}

if($DeploymentOutputs.ContainsKey('COMMUNICATION_SERVICE_ACCESS_KEY')){
Write-Host "COMMUNICATION_SERVICE_ACCESS_KEY exists, proceeding."
}else{
Write-Host "COMMUNICATION_SERVICE_ACCESS_KEY does not exist, ending."
exit
}
$communicationServiceApiKey = $DeploymentOutputs["COMMUNICATION_SERVICE_ACCESS_KEY"]

if($DeploymentOutputs.ContainsKey('AZURE_TEST_DOMAIN')){
Write-Host "AZURE_TEST_DOMAIN exists, proceeding."
}else{
Write-Host "AZURE_TEST_DOMAIN does not exist, ending."
exit
}
$testDomain = $DeploymentOutputs["AZURE_TEST_DOMAIN"]

$payload = @"
Expand Down
12 changes: 12 additions & 0 deletions sdk/communication/test-resources/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"defaultValue": "communication",
"type": "string"
},
"communicationServicesEndpointSuffix": {
"defaultValue": ".communication.azure.com",
"type": "string"
},
"testApplicationOid": {
"type": "string",
"metadata": {
Expand Down Expand Up @@ -80,6 +84,14 @@
"type": "string",
"value": "[listKeys(resourceId('Microsoft.Communication/CommunicationServices',variables('uniqueSubDomainName')), '2023-03-31').primaryConnectionString]"
},
"COMMUNICATION_SERVICE_ENDPOINT": {
"type": "string",
"value": "[concat('https://', parameters('baseName'), '-', parameters('endpointPrefix'), parameters('communicationServicesEndpointSuffix'))]"
},
"COMMUNICATION_SERVICE_ACCESS_KEY": {
"type": "string",
"value": "[listKeys(resourceId('Microsoft.Communication/CommunicationServices',variables('uniqueSubDomainName')), '2023-03-31').primaryKey]"
},
"RESOURCE_GROUP_NAME": {
"type": "string",
"value": "[resourceGroup().Name]"
Expand Down