Skip to content

Commit 333ec6a

Browse files
authored
Remove or fix azure* environment variables in live tests (#37815)
* Remove or fix azure* environment variables in live tests * try samples against tme
1 parent ba31df5 commit 333ec6a

File tree

23 files changed

+20
-99
lines changed

23 files changed

+20
-99
lines changed

common/smoketest/test-resources.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,4 @@
261261
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2019-06-01').keys[0].value, ';EndpointSuffix=', parameters('storageEndpointSuffix'))]"
262262
}
263263
}
264-
}
264+
}

eng/pipelines/templates/steps/build-test.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,11 @@ steps:
149149
condition: and(succeeded(), eq(variables['TestSamples'], 'true'))
150150
env:
151151
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
152+
# Enable samples tests that use DefaultAzureCredential to load the federated pipeline credential
153+
AZURE_POD_IDENTITY_AUTHORITY_HOST: 'https://FakeAuthorityHost'
152154
${{ insert }}: ${{ parameters.EnvVars }}
153155
inputs:
154-
azureSubscription: ${{ parameters.ServiceConnection }}
156+
azureSubscription: azure-sdk-tests-public
155157
azurePowerShellVersion: LatestVersion
156158
pwsh: true
157159
ScriptType: InlineScript

sdk/cognitivelanguage/tests.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ extends:
1818
AZURE_CONVERSATIONS_DEPLOYMENT_NAME: $(clu-project-deployment)
1919
AZURE_CONVERSATIONS_WORKFLOW_PROJECT_NAME: $(clu-workflow-project)
2020
AZURE_CONVERSATIONS_WORKFLOW_DEPLOYMENT_NAME: $(clu-workflow-project-deployment)
21-
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
22-
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
23-
AZURE_SUBSCRIPTION_ID: $(azure-subscription-id)
24-
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
21+
AZURE_SUBSCRIPTION_ID: $(COGNITIVELANGUAGE_SUBSCRIPTION_ID)
2522
TEST_MODE: "RunLiveNoRecord" # use when allowing preparers to create the rgs for you
2623
AZURE_TEST_RUN_LIVE: 'true'
2724
AZURE_SKIP_LIVE_RECORDING: 'true'

sdk/communication/azure-communication-email/test-resources.json

+1-11
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@
3030
"metadata": {
3131
"description": "The application client id used to run tests."
3232
}
33-
},
34-
"testApplicationSecret": {
35-
"type": "string",
36-
"metadata": {
37-
"description": "The application client secret used to run tests."
38-
}
3933
}
4034
},
4135
"variables": {
@@ -102,10 +96,6 @@
10296
"type": "string",
10397
"value": "[parameters('testApplicationId')]"
10498
},
105-
"AZURE_CLIENT_SECRET": {
106-
"type": "string",
107-
"value": "[parameters('testApplicationSecret')]"
108-
},
10999
"COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": {
110100
"type": "string",
111101
"value": "[listKeys(resourceId('Microsoft.Communication/CommunicationServices',variables('uniqueSubDomainName')), '2021-10-01-preview').primaryConnectionString]"
@@ -132,4 +122,4 @@
132122
}
133123
}
134124
}
135-
125+

sdk/communication/test-resources/test-resources-post.ps1

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
param (
1111
[hashtable] $DeploymentOutputs,
1212
[string] $TenantId,
13-
[string] $TestApplicationId,
14-
[string] $TestApplicationSecret
13+
[string] $TestApplicationId
1514
)
1615

1716
# By default stop for any error.

sdk/confidentialledger/tests.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ extends:
99
- TestSamples=.*/true
1010
MaxParallel: 1
1111
EnvVars:
12-
AZURE_SUBSCRIPTION_ID: $(provisioner-subscription)
13-
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
14-
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
15-
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
1612
TEST_MODE: "RunLiveNoRecord" # use when allowing preparers to create the rgs for you
1713
AZURE_TEST_RUN_LIVE: "true" # use when utilizing the New-TestResources Script
18-
AZURE_SKIP_LIVE_RECORDING: 'True'
14+
AZURE_SKIP_LIVE_RECORDING: 'True'

sdk/documentintelligence/tests.yml

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ extends:
1313
Public:
1414
Location: eastus
1515
EnvVars:
16-
AZURE_SUBSCRIPTION_ID: $(provisioner-subscription)
1716
TEST_MODE: 'RunLiveNoRecord'
1817
AZURE_SKIP_LIVE_RECORDING: 'True'
1918
AZURE_TEST_RUN_LIVE: 'true'

sdk/evaluation/tests.yml

-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,5 @@ extends:
77
MatrixReplace:
88
- TestSamples=.*/true
99
EnvVars:
10-
AZURE_CLIENT_ID: $(EVALUATION_CLIENT_ID)
11-
AZURE_CLIENT_SECRET: $(EVALUATION_CLIENT_SECRET)
12-
AZURE_TENANT_ID: $(EVALUATION_TENANT_ID)
13-
AZURE_SUBSCRIPTION_ID: $(EVALUATION_SUBSCRIPTION_ID)
1410
TEST_MODE: 'RunLiveNoRecord' # use when allowing preparers to create the rgs for you
1511
AZURE_TEST_RUN_LIVE: 'true' # use when utilizing the New-TestResources Script
+1-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
trigger: none
22

33
extemds:
4-
template: ../../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
4+
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
55
parameters:
66
ServiceDirectory: eventhub
77
BuildTargetingString: azure-mgmt-eventhub
88
EnvVars:
9-
AZURE_CLIENT_ID: $(python-eh-livetest-event-hub-aad-client-id)
10-
AZURE_TENANT_ID: $(python-eh-livetest-event-hub-aad-tenant-id)
11-
AZURE_CLIENT_SECRET: $(python-eh-livetest-event-hub-aad-secret)
12-
AZURE_SUBSCRIPTION_ID: $(python-eh-livetest-event-hub-subscription-id)
139
TEST_MODE: 'RunLiveNoRecord'
1410
AZURE_TEST_RUN_LIVE: 'true'
1511
AZURE_SKIP_LIVE_RECORDING: 'True'

sdk/formrecognizer/tests.yml

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ extends:
1717
ServiceConnection: azure-sdk-tests
1818
Location: 'centraluseuap'
1919
EnvVars:
20-
AZURE_SUBSCRIPTION_ID: $(provisioner-subscription)
2120
TEST_MODE: 'RunLiveNoRecord'
2221
AZURE_SKIP_LIVE_RECORDING: 'True'
2322
AZURE_TEST_RUN_LIVE: 'true'

sdk/healthdataaiservices/azure-health-deidentification/test-resources-post.ps1

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
param (
1111
[hashtable] $DeploymentOutputs,
1212
[string] $TenantId,
13-
[string] $TestApplicationId,
14-
[string] $TestApplicationSecret
13+
[string] $TestApplicationId
1514
)
1615

1716
# Retrieve the connection string from environment variables
@@ -59,4 +58,4 @@ Get-ChildItem -Path $localFolderPath -Recurse | ForEach-Object {
5958
Set-AzStorageBlobContent -File $_.FullName -Container $containerName -Blob $destinationBlob -Context $storageContext -Force
6059
}
6160

62-
Write-Host "Folder '$localFolderPath' uploaded to container '$containerName' successfully."
61+
Write-Host "Folder '$localFolderPath' uploaded to container '$containerName' successfully."

sdk/keyvault/tests.yml

-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ extends:
2222
China:
2323
MatrixFilters:
2424
- ArmTemplateParameters=^(?!.*enableHsm.*true)
25-
Location: chinanorth3
2625
EnvVars:
2726
AZURE_TEST_RUN_LIVE: true
2827
AZURE_SKIP_LIVE_RECORDING: 'True'
29-
AZURE_SUBSCRIPTION_ID: $(azure-subscription-id)
30-
AZURE_CLIENT_OID: $(aad-azure-sdk-test-client-oid)

sdk/maps/test-resources.json

-10
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@
2626
"metadata": {
2727
"description": "The application client id used to run tests."
2828
}
29-
},
30-
"testApplicationSecret": {
31-
"type": "string",
32-
"metadata": {
33-
"description": "The application client secret used to run tests."
34-
}
3529
}
3630
},
3731
"variables": {
@@ -84,10 +78,6 @@
8478
"type": "string",
8579
"value": "[parameters('testApplicationId')]"
8680
},
87-
"AZURE_CLIENT_SECRET": {
88-
"type": "string",
89-
"value": "[parameters('testApplicationSecret')]"
90-
},
9181
"AZURE_MAPS_CLIENT_ID": {
9282
"type": "string",
9383
"value": "[reference(resourceId('Microsoft.Maps/accounts',variables('mapsAccountName'))).uniqueId]"

sdk/metricsadvisor/tests.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
trigger: none
22

33
extends:
4-
template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
4+
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
55
parameters:
66
BuildTargetingString: azure-ai-metricsadvisor
77
ServiceDirectory: metricsadvisor
88
EnvVars:
9-
AZURE_SUBSCRIPTION_ID: $(provisioner-subscription)
10-
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
11-
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
12-
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
139
METRICS_ADVISOR_ENDPOINT: $(metricsadvisor-test-service-endpoint)
1410
METRICS_ADVISOR_SUBSCRIPTION_KEY: $(metricsadvisor-test-subscription-key)
1511
METRICS_ADVISOR_API_KEY: $(python-metricsadvisor-test-api-key)

sdk/personalizer/tests.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
trigger: none
22

33
extends:
4-
template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
4+
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
55
parameters:
66
BuildTargetingString: azure-ai-personalizer
77
ServiceDirectory: personalizer
88
Clouds: Canary
99
MatrixReplace:
1010
- TestSamples=.*/true
1111
EnvVars:
12-
AZURE_CLIENT_ID: $(PERSONALIZER_CLIENT_ID)
13-
AZURE_TENANT_ID: $(PERSONALIZER_TENANT_ID)
14-
AZURE_SUBSCRIPTION_ID: $(PERSONALIZER_SUBSCRIPTION_ID)
15-
AZURE_CLIENT_SECRET: $(PERSONALIZER_CLIENT_SECRET)
1612
TEST_MODE: 'RunLiveNoRecord'
1713
AZURE_SKIP_LIVE_RECORDING: 'True'
1814
AZURE_TEST_RUN_LIVE: 'true'
1915
PERSONALIZER_PRESET_ENDPOINT_SINGLE_SLOT: $(java-personalizer-test-singleslot-endpoint)
2016
PERSONALIZER_PRESET_API_KEY_SINGLE_SLOT: $(java-personalizer-test-singleslot-api-key)
2117
PERSONALIZER_PRESET_ENDPOINT_MULTI_SLOT: $(java-personalizer-test-multislot-endpoint)
22-
PERSONALIZER_PRESET_API_KEY_MULTI_SLOT: $(java-personalizer-test-multislot-api-key)
18+
PERSONALIZER_PRESET_API_KEY_MULTI_SLOT: $(java-personalizer-test-multislot-api-key)

sdk/remoterendering/test-resources-post.ps1

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
param (
1010
[hashtable] $DeploymentOutputs,
1111
[string] $TenantId,
12-
[string] $TestApplicationId,
13-
[string] $TestApplicationSecret
12+
[string] $TestApplicationId
1413
)
1514

1615
# outputs from the ARM deployment passed in from New-TestResources

sdk/remoterendering/tests.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
trigger: none
22

33
extends:
4-
template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
4+
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
55
parameters:
66
ServiceDirectory: remoterendering
77
Location: westus2
88
EnvVars:
9-
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
10-
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
11-
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
129
TEST_MODE: 'RunLiveNoRecord'
1310
AZURE_SKIP_LIVE_RECORDING: 'true'
1411
AZURE_TEST_RUN_LIVE: 'true'

sdk/schemaregistry/tests.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
trigger: none
22

33
extends:
4-
template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
4+
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
55
parameters:
66
ServiceDirectory: schemaregistry
77
TestTimeoutInMinutes: 300
88
BuildTargetingString: azure-schemaregistry*
99
EnvVars:
10-
AZURE_SUBSCRIPTION_ID: $(azure-subscription-id)
1110
AZURE_SKIP_LIVE_RECORDING: 'True'
1211
AZURE_TEST_RUN_LIVE: 'true'
1312
MatrixFilters:

sdk/storage/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ parameters:
1212
extends:
1313
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
1414
parameters:
15-
Location: 'canadacentral'
15+
Location: 'westus2'
1616
# All 5 service stages run in parallel, and with no parallel limits the tests may get throttled.
1717
MaxParallel: 2
1818
ServiceDirectory: storage

sdk/template/tests.yml

-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,5 @@ extends:
77
MatrixReplace:
88
- TestSamples=.*/true
99
EnvVars:
10-
AZURE_CLIENT_ID: $(TEMPLATE_CLIENT_ID)
11-
AZURE_CLIENT_SECRET: $(TEMPLATE_CLIENT_SECRET)
12-
AZURE_TENANT_ID: $(TEMPLATE_TENANT_ID)
13-
AZURE_SUBSCRIPTION_ID: $(TEMPLATE_SUBSCRIPTION_ID)
1410
TEST_MODE: 'RunLiveNoRecord' # use when allowing preparers to create the rgs for you
1511
AZURE_TEST_RUN_LIVE: 'true' # use when utilizing the New-TestResources Script

sdk/textanalytics/test-resources.json

-10
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@
3636
"description": "The application client id used to run tests."
3737
}
3838
},
39-
"testApplicationSecret": {
40-
"type": "String",
41-
"metadata": {
42-
"description": "The application client secret used to run tests."
43-
}
44-
},
4539
"cognitiveServicesEndpointSuffix": {
4640
"defaultValue": ".cognitiveservices.azure.com",
4741
"type": "String"
@@ -90,10 +84,6 @@
9084
"type": "String",
9185
"value": "[parameters('testApplicationId')]"
9286
},
93-
"AZURE_CLIENT_SECRET": {
94-
"type": "String",
95-
"value": "[parameters('testApplicationSecret')]"
96-
},
9787
"TEXTANALYTICS_TEST_API_KEY": {
9888
"type": "string",
9989
"value": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('textAnalyticsBaseName')), variables('cognitiveApiVersion')).key1]"

sdk/textanalytics/tests.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
trigger: none
22

33
extends:
4-
template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
4+
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
55
parameters:
66
BuildTargetingString: azure-ai-textanalytics
77
ServiceDirectory: textanalytics
@@ -17,10 +17,6 @@ extends:
1717
Location: chinanorth3
1818
SupportedClouds: 'Public,UsGov,China'
1919
EnvVars:
20-
AZURE_SUBSCRIPTION_ID: $(TEXTANALYTICS_SUBSCRIPTION_ID)
21-
AZURE_TENANT_ID: $(TEXTANALYTICS_TENANT_ID)
22-
AZURE_CLIENT_SECRET: $(TEXTANALYTICS_CLIENT_SECRET)
23-
AZURE_CLIENT_ID: $(TEXTANALYTICS_CLIENT_ID)
2420
TEST_MODE: 'RunLiveNoRecord'
2521
AZURE_SKIP_LIVE_RECORDING: 'True'
2622
AZURE_TEST_RUN_LIVE: 'true'

sdk/webpubsub/tests.yml

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
trigger: none
22

33
extends:
4-
template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
4+
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
55
parameters:
66
BuildTargetingString: azure*
77
ServiceDirectory: webpubsub
88
MatrixReplace:
99
- TestSamples=.*/true
1010
EnvVars:
11-
WEBPUBSUB_TENANT_ID: $(webpubsub-tenant-id)
12-
WEBPUBSUB_CLIENT_ID: $(webpubsub-client-id)
13-
WEBPUBSUB_CLIENT_SECRET: $(webpubsub-client-secret)
14-
WEBPUBSUB_SUBSCRIPTION_ID: $(webpubsub-subscription-id)
15-
AZURE_TENANT_ID: $(webpubsub-tenant-id)
16-
AZURE_CLIENT_ID: $(webpubsub-client-id)
17-
AZURE_CLIENT_SECRET: $(webpubsub-client-secret)
18-
AZURE_SUBSCRIPTION_ID: $(webpubsub-subscription-id)
1911
WEBPUBSUB_REVERSE_PROXY_ENDPOINT: $(webpubsub-reverse-proxy-endpoint)
2012
WEBPUBSUB_ENDPOINT: $(webpubsub-endpoint)
2113
WEBPUBSUB_CONNECTION_STRING: $(webpubsub-connection-string)

0 commit comments

Comments
 (0)