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

Update three pass services to enable live testing in sovereign clouds for multiple services #18162

Merged
merged 4 commits into from
Feb 8, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public async Task CanAddKeysIndependently()
private async Task<BlobClient> GetBlobClient(string name)
{
var client = new BlobServiceClient(
new Uri($"https://{TestEnvironment.StorageAccountName}.blob.core.windows.net/"),
new Uri($"https://{TestEnvironment.StorageAccountName}.blob.{TestEnvironment.StorageEndpointSuffix}/"),
new StorageSharedKeyCredential(
TestEnvironment.StorageAccountName,
TestEnvironment.StorageAccountKey));
Expand All @@ -67,4 +67,4 @@ private async Task<BlobClient> GetBlobClient(string name)
return blobClient;
}
}
}
}
18 changes: 16 additions & 2 deletions sdk/extensions/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,24 @@
"metadata": {
"description": "The location of the resource. By default, this is the same as the resource group."
}
},
"keyVaultEndpointSuffix": {
"defaultValue": ".vault.azure.net",
"type": "string",
"metadata": {
"description": "Endpoint suffix for sovereign clouds, requies the preceeding '.'. The default uses the public Azure Cloud (.vault.azure.net)"
}
},
"keyVaultSku": {
"type": "string",
"defaultValue": "premium",
"metadata": {
"description": "Key Vault SKU to deploy. The default is 'premium'"
}
}
},
"variables": {
"azureKeyVaultUrl": "[format('https://{0}.vault.azure.net', parameters('baseName'))]",
"azureKeyVaultUrl": "[format('https://{0}{1}', parameters('baseName'), parameters('keyVaultEndpointSuffix'))]",
"mgmtApiVersion": "2019-04-01",
"blobAccountName": "[parameters('baseName')]"
},
Expand All @@ -57,7 +71,7 @@
"properties": {
"sku": {
"family": "A",
"name": "premium"
"name": "[parameters('keyVaultSku')]"
},
"tenantId": "[parameters('tenantId')]",
"accessPolicies": [
Expand Down
1 change: 1 addition & 0 deletions sdk/extensions/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
ServiceDirectory: extensions
Clouds: 'Public,Preview,UsGov,China'
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ public partial class SearchResources : IAsyncDisposable
/// </summary>
public string StorageAccountKey => TestFixture.TestEnvironment.SearchStorageKey;

/// <summary>
/// The storage endpoint suffix.
/// </summary>
public string StorageEndpointSuffix => TestFixture.TestEnvironment.StorageEndpointSuffix ?? "core.windows.net";
/// <summary>
/// The storage account connection string.
/// </summary>
public string StorageAccountConnectionString => $"DefaultEndpointsProtocol=https;AccountName={StorageAccountName};AccountKey={StorageAccountKey};EndpointSuffix=core.windows.net";
public string StorageAccountConnectionString => $"DefaultEndpointsProtocol=https;AccountName={StorageAccountName};AccountKey={StorageAccountKey};EndpointSuffix={StorageEndpointSuffix}";

/// <summary>
/// The Cognitive Services key.
Expand Down Expand Up @@ -92,10 +96,15 @@ public string IndexName
}
private string _indexName = null;

/// <summary>
/// The search endpoint suffix.
/// </summary>
public string SearchEndpointSuffix => TestFixture.TestEnvironment.SearchEndpointSuffix;

/// <summary>
/// The URI of the Search service.
/// </summary>
public Uri Endpoint => new Uri($"https://{SearchServiceName}.search.windows.net");
public Uri Endpoint => new Uri($"https://{SearchServiceName}.{SearchEndpointSuffix}");

/// <summary>
/// The Primary or Admin API key to authenticate requests to the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ public class SearchTestEnvironment: TestEnvironment
/// </summary>
public string SearchCognitiveKey => GetRecordedVariable(CognitiveKeyVariableName);

/// <summary>
/// Gets the search service suffix.
/// </summary>
public string SearchEndpointSuffix => GetRecordedOptionalVariable("SEARCH_ENDPOINT_SUFFIX") ?? "search.windows.net";

/// <summary>
/// Gets the optional Key Vault URL used for double-encrypted indexes.
/// </summary>
Expand Down
3 changes: 2 additions & 1 deletion sdk/search/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
ServiceDirectory: search
TimeoutInMinutes: 120
TimeoutInMinutes: 240
MaxParallel: 2
UnsupportedClouds: Canary
Clouds: 'Public,Preview,UsGov,China'
EnvVars:
AZURE_SEARCH_TEST_MODE: Live