From 701c4877422acdb885792f29020aeaefbbb3b990 Mon Sep 17 00:00:00 2001 From: Jiri Burant Date: Wed, 18 Oct 2023 13:34:37 +0200 Subject: [PATCH 1/2] Updated test-resources template to contain necessary properties. --- sdk/communication/test-resources/test-resources.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sdk/communication/test-resources/test-resources.json b/sdk/communication/test-resources/test-resources.json index 3321f762d040d..0e1d5f885b259 100644 --- a/sdk/communication/test-resources/test-resources.json +++ b/sdk/communication/test-resources/test-resources.json @@ -13,6 +13,10 @@ "defaultValue": "communication", "type": "string" }, + "communicationServicesEndpointSuffix": { + "defaultValue": ".communication.azure.com", + "type": "string" + }, "testApplicationOid": { "type": "string", "metadata": { @@ -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]" From 8d89d731432be0ea82b2f7d4c51b2bdd502f11a2 Mon Sep 17 00:00:00 2001 From: Jiri Burant Date: Wed, 18 Oct 2023 13:52:08 +0200 Subject: [PATCH 2/2] Added logging for test environment variables for better troubleshooting. --- .../test-resources/test-resources-post.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sdk/communication/test-resources/test-resources-post.ps1 b/sdk/communication/test-resources/test-resources-post.ps1 index 0d88ef2cfb331..faf954a0c94a9 100644 --- a/sdk/communication/test-resources/test-resources-post.ps1 +++ b/sdk/communication/test-resources/test-resources-post.ps1 @@ -25,6 +25,12 @@ 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 '\/$') { @@ -32,7 +38,20 @@ if ($communicationServiceEndpoint -notmatch '\/$') { $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 = @"