Skip to content

Commit

Permalink
Text Analytics ARM template for Live tests (#7638)
Browse files Browse the repository at this point in the history
  • Loading branch information
samvaity authored Feb 5, 2020
1 parent 1b9e118 commit 370064f
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 4 deletions.
96 changes: 96 additions & 0 deletions sdk/textanalytics/test-resources.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"baseName": {
"type": "string",
"defaultValue": "[resourceGroup().name]",
"metadata": {
"description": "The base resource name."
}
},
"endpointSuffix": {
"defaultValue": ".cognitiveservices.azure.com/",
"type": "String"
},
"testApplicationOid": {
"type": "String",
"metadata": {
"description": "The principal to assign the role to. This is application object id."
}
},
"tenantId": {
"type": "String",
"metadata": {
"description": "The tenant id to which the application and resources belong."
}
},
"testApplicationId": {
"type": "String",
"metadata": {
"description": "The application client id used to run tests."
}
},
"testApplicationSecret": {
"type": "String",
"metadata": {
"description": "The application client secret used to run tests."
}
}
},
"variables": {
"authorizationApiVersion": "2018-09-01-preview",
"textAnalyticsApiVersion": "2017-04-18",
"azureTextAnalyticsUrl": "[concat('https://', parameters('baseName'), parameters('endpointSuffix'))]",
"cognitiveServiceUserRoleId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/a97b65f3-24c7-4388-baec-2e87135dc908')]"
},
"resources": [
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "[variables('authorizationApiVersion')]",
"name": "[guid(concat(variables('cognitiveServiceUserRoleId'), parameters('baseName')))]",
"dependsOn": [
"[parameters('baseName')]"
],
"properties": {
"principalId": "[parameters('testApplicationOid')]",
"roleDefinitionId": "[variables('cognitiveServiceUserRoleId')]"
}
},
{
"type": "Microsoft.CognitiveServices/accounts",
"name": "[parameters('baseName')]",
"apiVersion": "[variables('textAnalyticsApiVersion')]",
"sku": {
"name": "S"
},
"kind": "TextAnalytics",
"location": "[resourceGroup().location]",
"properties": {
"customSubDomainName": "[parameters('baseName')]"
}
}
],
"outputs": {
"AZURE_TENANT_ID": {
"type": "String",
"value": "[parameters('tenantId')]"
},
"AZURE_CLIENT_ID": {
"type": "String",
"value": "[parameters('testApplicationId')]"
},
"AZURE_CLIENT_SECRET": {
"type": "String",
"value": "[parameters('testApplicationSecret')]"
},
"AZURE_TEXT_ANALYTICS_SUBSCRIPTION_KEY": {
"type": "string",
"value": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('baseName')), variables('textAnalyticsApiVersion')).key1]"
},
"AZURE_TEXT_ANALYTICS_ENDPOINT": {
"type": "string",
"value": "[variables('azureTextAnalyticsUrl')]"
}
}
}
4 changes: 0 additions & 4 deletions sdk/textanalytics/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@ jobs:
ServiceDirectory: textanalytics
EnvVars:
AZURE_TEST_MODE: RECORD
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)
AZURE_TEXT_ANALYTICS_ENDPOINT: $(java-textanalytics-sdk-endpoint)
AZURE_LOG_LEVEL: 3

0 comments on commit 370064f

Please sign in to comment.