Skip to content

Remove or fix azure* environment variables in live tests #37815

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

Merged
merged 2 commits into from
Nov 14, 2024
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
2 changes: 1 addition & 1 deletion common/smoketest/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,4 +261,4 @@
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2019-06-01').keys[0].value, ';EndpointSuffix=', parameters('storageEndpointSuffix'))]"
}
}
}
}
4 changes: 3 additions & 1 deletion eng/pipelines/templates/steps/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,11 @@ steps:
condition: and(succeeded(), eq(variables['TestSamples'], 'true'))
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
# Enable samples tests that use DefaultAzureCredential to load the federated pipeline credential
AZURE_POD_IDENTITY_AUTHORITY_HOST: 'https://FakeAuthorityHost'
${{ insert }}: ${{ parameters.EnvVars }}
inputs:
azureSubscription: ${{ parameters.ServiceConnection }}
azureSubscription: azure-sdk-tests-public
azurePowerShellVersion: LatestVersion
pwsh: true
ScriptType: InlineScript
Expand Down
5 changes: 1 addition & 4 deletions sdk/cognitivelanguage/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ extends:
AZURE_CONVERSATIONS_DEPLOYMENT_NAME: $(clu-project-deployment)
AZURE_CONVERSATIONS_WORKFLOW_PROJECT_NAME: $(clu-workflow-project)
AZURE_CONVERSATIONS_WORKFLOW_DEPLOYMENT_NAME: $(clu-workflow-project-deployment)
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
AZURE_SUBSCRIPTION_ID: $(azure-subscription-id)
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
AZURE_SUBSCRIPTION_ID: $(COGNITIVELANGUAGE_SUBSCRIPTION_ID)
TEST_MODE: "RunLiveNoRecord" # use when allowing preparers to create the rgs for you
AZURE_TEST_RUN_LIVE: 'true'
AZURE_SKIP_LIVE_RECORDING: 'true'
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@
"metadata": {
"description": "The application client id used to run tests."
}
},
"testApplicationSecret": {
"type": "string",
"metadata": {
"description": "The application client secret used to run tests."
}
}
},
"variables": {
Expand Down Expand Up @@ -102,10 +96,6 @@
"type": "string",
"value": "[parameters('testApplicationId')]"
},
"AZURE_CLIENT_SECRET": {
"type": "string",
"value": "[parameters('testApplicationSecret')]"
},
"COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING": {
"type": "string",
"value": "[listKeys(resourceId('Microsoft.Communication/CommunicationServices',variables('uniqueSubDomainName')), '2021-10-01-preview').primaryConnectionString]"
Expand All @@ -132,4 +122,4 @@
}
}
}

3 changes: 1 addition & 2 deletions sdk/communication/test-resources/test-resources-post.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
param (
[hashtable] $DeploymentOutputs,
[string] $TenantId,
[string] $TestApplicationId,
[string] $TestApplicationSecret
[string] $TestApplicationId
)

# By default stop for any error.
Expand Down
6 changes: 1 addition & 5 deletions sdk/confidentialledger/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ extends:
- TestSamples=.*/true
MaxParallel: 1
EnvVars:
AZURE_SUBSCRIPTION_ID: $(provisioner-subscription)
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
TEST_MODE: "RunLiveNoRecord" # use when allowing preparers to create the rgs for you
AZURE_TEST_RUN_LIVE: "true" # use when utilizing the New-TestResources Script
AZURE_SKIP_LIVE_RECORDING: 'True'
AZURE_SKIP_LIVE_RECORDING: 'True'
1 change: 0 additions & 1 deletion sdk/documentintelligence/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ extends:
Public:
Location: eastus
EnvVars:
AZURE_SUBSCRIPTION_ID: $(provisioner-subscription)
TEST_MODE: 'RunLiveNoRecord'
AZURE_SKIP_LIVE_RECORDING: 'True'
AZURE_TEST_RUN_LIVE: 'true'
4 changes: 0 additions & 4 deletions sdk/evaluation/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,5 @@ extends:
MatrixReplace:
- TestSamples=.*/true
EnvVars:
AZURE_CLIENT_ID: $(EVALUATION_CLIENT_ID)
AZURE_CLIENT_SECRET: $(EVALUATION_CLIENT_SECRET)
AZURE_TENANT_ID: $(EVALUATION_TENANT_ID)
AZURE_SUBSCRIPTION_ID: $(EVALUATION_SUBSCRIPTION_ID)
TEST_MODE: 'RunLiveNoRecord' # use when allowing preparers to create the rgs for you
AZURE_TEST_RUN_LIVE: 'true' # use when utilizing the New-TestResources Script
6 changes: 1 addition & 5 deletions sdk/eventhub/azure-mgmt-eventhub/tests.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
trigger: none

extemds:
template: ../../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
ServiceDirectory: eventhub
BuildTargetingString: azure-mgmt-eventhub
EnvVars:
AZURE_CLIENT_ID: $(python-eh-livetest-event-hub-aad-client-id)
AZURE_TENANT_ID: $(python-eh-livetest-event-hub-aad-tenant-id)
AZURE_CLIENT_SECRET: $(python-eh-livetest-event-hub-aad-secret)
AZURE_SUBSCRIPTION_ID: $(python-eh-livetest-event-hub-subscription-id)
TEST_MODE: 'RunLiveNoRecord'
AZURE_TEST_RUN_LIVE: 'true'
AZURE_SKIP_LIVE_RECORDING: 'True'
1 change: 0 additions & 1 deletion sdk/formrecognizer/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ extends:
ServiceConnection: azure-sdk-tests
Location: 'centraluseuap'
EnvVars:
AZURE_SUBSCRIPTION_ID: $(provisioner-subscription)
TEST_MODE: 'RunLiveNoRecord'
AZURE_SKIP_LIVE_RECORDING: 'True'
AZURE_TEST_RUN_LIVE: 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
param (
[hashtable] $DeploymentOutputs,
[string] $TenantId,
[string] $TestApplicationId,
[string] $TestApplicationSecret
[string] $TestApplicationId
)

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

Write-Host "Folder '$localFolderPath' uploaded to container '$containerName' successfully."
Write-Host "Folder '$localFolderPath' uploaded to container '$containerName' successfully."
3 changes: 0 additions & 3 deletions sdk/keyvault/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ extends:
China:
MatrixFilters:
- ArmTemplateParameters=^(?!.*enableHsm.*true)
Location: chinanorth3
EnvVars:
AZURE_TEST_RUN_LIVE: true
AZURE_SKIP_LIVE_RECORDING: 'True'
AZURE_SUBSCRIPTION_ID: $(azure-subscription-id)
AZURE_CLIENT_OID: $(aad-azure-sdk-test-client-oid)
10 changes: 0 additions & 10 deletions sdk/maps/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@
"metadata": {
"description": "The application client id used to run tests."
}
},
"testApplicationSecret": {
"type": "string",
"metadata": {
"description": "The application client secret used to run tests."
}
}
},
"variables": {
Expand Down Expand Up @@ -84,10 +78,6 @@
"type": "string",
"value": "[parameters('testApplicationId')]"
},
"AZURE_CLIENT_SECRET": {
"type": "string",
"value": "[parameters('testApplicationSecret')]"
},
"AZURE_MAPS_CLIENT_ID": {
"type": "string",
"value": "[reference(resourceId('Microsoft.Maps/accounts',variables('mapsAccountName'))).uniqueId]"
Expand Down
6 changes: 1 addition & 5 deletions sdk/metricsadvisor/tests.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
trigger: none

extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
BuildTargetingString: azure-ai-metricsadvisor
ServiceDirectory: metricsadvisor
EnvVars:
AZURE_SUBSCRIPTION_ID: $(provisioner-subscription)
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
METRICS_ADVISOR_ENDPOINT: $(metricsadvisor-test-service-endpoint)
METRICS_ADVISOR_SUBSCRIPTION_KEY: $(metricsadvisor-test-subscription-key)
METRICS_ADVISOR_API_KEY: $(python-metricsadvisor-test-api-key)
Expand Down
8 changes: 2 additions & 6 deletions sdk/personalizer/tests.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
trigger: none

extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
BuildTargetingString: azure-ai-personalizer
ServiceDirectory: personalizer
Clouds: Canary
MatrixReplace:
- TestSamples=.*/true
EnvVars:
AZURE_CLIENT_ID: $(PERSONALIZER_CLIENT_ID)
AZURE_TENANT_ID: $(PERSONALIZER_TENANT_ID)
AZURE_SUBSCRIPTION_ID: $(PERSONALIZER_SUBSCRIPTION_ID)
AZURE_CLIENT_SECRET: $(PERSONALIZER_CLIENT_SECRET)
TEST_MODE: 'RunLiveNoRecord'
AZURE_SKIP_LIVE_RECORDING: 'True'
AZURE_TEST_RUN_LIVE: 'true'
PERSONALIZER_PRESET_ENDPOINT_SINGLE_SLOT: $(java-personalizer-test-singleslot-endpoint)
PERSONALIZER_PRESET_API_KEY_SINGLE_SLOT: $(java-personalizer-test-singleslot-api-key)
PERSONALIZER_PRESET_ENDPOINT_MULTI_SLOT: $(java-personalizer-test-multislot-endpoint)
PERSONALIZER_PRESET_API_KEY_MULTI_SLOT: $(java-personalizer-test-multislot-api-key)
PERSONALIZER_PRESET_API_KEY_MULTI_SLOT: $(java-personalizer-test-multislot-api-key)
3 changes: 1 addition & 2 deletions sdk/remoterendering/test-resources-post.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
param (
[hashtable] $DeploymentOutputs,
[string] $TenantId,
[string] $TestApplicationId,
[string] $TestApplicationSecret
[string] $TestApplicationId
)

# outputs from the ARM deployment passed in from New-TestResources
Expand Down
5 changes: 1 addition & 4 deletions sdk/remoterendering/tests.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
trigger: none

extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
ServiceDirectory: remoterendering
Location: westus2
EnvVars:
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
TEST_MODE: 'RunLiveNoRecord'
AZURE_SKIP_LIVE_RECORDING: 'true'
AZURE_TEST_RUN_LIVE: 'true'
3 changes: 1 addition & 2 deletions sdk/schemaregistry/tests.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
trigger: none

extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
ServiceDirectory: schemaregistry
TestTimeoutInMinutes: 300
BuildTargetingString: azure-schemaregistry*
EnvVars:
AZURE_SUBSCRIPTION_ID: $(azure-subscription-id)
AZURE_SKIP_LIVE_RECORDING: 'True'
AZURE_TEST_RUN_LIVE: 'true'
MatrixFilters:
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ parameters:
extends:
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
Location: 'canadacentral'
Location: 'westus2'
# All 5 service stages run in parallel, and with no parallel limits the tests may get throttled.
MaxParallel: 2
ServiceDirectory: storage
Expand Down
4 changes: 0 additions & 4 deletions sdk/template/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,5 @@ extends:
MatrixReplace:
- TestSamples=.*/true
EnvVars:
AZURE_CLIENT_ID: $(TEMPLATE_CLIENT_ID)
AZURE_CLIENT_SECRET: $(TEMPLATE_CLIENT_SECRET)
AZURE_TENANT_ID: $(TEMPLATE_TENANT_ID)
AZURE_SUBSCRIPTION_ID: $(TEMPLATE_SUBSCRIPTION_ID)
TEST_MODE: 'RunLiveNoRecord' # use when allowing preparers to create the rgs for you
AZURE_TEST_RUN_LIVE: 'true' # use when utilizing the New-TestResources Script
10 changes: 0 additions & 10 deletions sdk/textanalytics/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@
"description": "The application client id used to run tests."
}
},
"testApplicationSecret": {
"type": "String",
"metadata": {
"description": "The application client secret used to run tests."
}
},
"cognitiveServicesEndpointSuffix": {
"defaultValue": ".cognitiveservices.azure.com",
"type": "String"
Expand Down Expand Up @@ -90,10 +84,6 @@
"type": "String",
"value": "[parameters('testApplicationId')]"
},
"AZURE_CLIENT_SECRET": {
"type": "String",
"value": "[parameters('testApplicationSecret')]"
},
"TEXTANALYTICS_TEST_API_KEY": {
"type": "string",
"value": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', variables('textAnalyticsBaseName')), variables('cognitiveApiVersion')).key1]"
Expand Down
6 changes: 1 addition & 5 deletions sdk/textanalytics/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
trigger: none

extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
BuildTargetingString: azure-ai-textanalytics
ServiceDirectory: textanalytics
Expand All @@ -17,10 +17,6 @@ extends:
Location: chinanorth3
SupportedClouds: 'Public,UsGov,China'
EnvVars:
AZURE_SUBSCRIPTION_ID: $(TEXTANALYTICS_SUBSCRIPTION_ID)
AZURE_TENANT_ID: $(TEXTANALYTICS_TENANT_ID)
AZURE_CLIENT_SECRET: $(TEXTANALYTICS_CLIENT_SECRET)
AZURE_CLIENT_ID: $(TEXTANALYTICS_CLIENT_ID)
TEST_MODE: 'RunLiveNoRecord'
AZURE_SKIP_LIVE_RECORDING: 'True'
AZURE_TEST_RUN_LIVE: 'true'
10 changes: 1 addition & 9 deletions sdk/webpubsub/tests.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
trigger: none

extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
BuildTargetingString: azure*
ServiceDirectory: webpubsub
MatrixReplace:
- TestSamples=.*/true
EnvVars:
WEBPUBSUB_TENANT_ID: $(webpubsub-tenant-id)
WEBPUBSUB_CLIENT_ID: $(webpubsub-client-id)
WEBPUBSUB_CLIENT_SECRET: $(webpubsub-client-secret)
WEBPUBSUB_SUBSCRIPTION_ID: $(webpubsub-subscription-id)
AZURE_TENANT_ID: $(webpubsub-tenant-id)
AZURE_CLIENT_ID: $(webpubsub-client-id)
AZURE_CLIENT_SECRET: $(webpubsub-client-secret)
AZURE_SUBSCRIPTION_ID: $(webpubsub-subscription-id)
WEBPUBSUB_REVERSE_PROXY_ENDPOINT: $(webpubsub-reverse-proxy-endpoint)
WEBPUBSUB_ENDPOINT: $(webpubsub-endpoint)
WEBPUBSUB_CONNECTION_STRING: $(webpubsub-connection-string)
Expand Down
Loading