Skip to content

Commit

Permalink
Update three pass services to enable live testing in sovereign clouds…
Browse files Browse the repository at this point in the history
… for multiple services (Azure#18162)

* change core,extension and search

* remove core change

* resolve ci error
  • Loading branch information
Luyunmt authored and jongio committed Feb 9, 2021
1 parent bd1b613 commit d94939e
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 7 deletions.
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

0 comments on commit d94939e

Please sign in to comment.