@@ -65,23 +65,16 @@ function Test-NewAzureRmAllKindsOfCognitiveServicesAccounts
65
65
New-AzResourceGroup - Name $rgname - Location ' West US' ;
66
66
67
67
# Create all known kinds of Cognitive Services accounts.
68
- Test-CreateCognitiveServicesAccount $rgname ' AcademicTest' ' Academic' ' S0' $locWU
69
- Test-CreateCognitiveServicesAccount $rgname ' BingAutosuggestTest' ' Bing.Autosuggest' ' S1' $locGBL
70
- Test-CreateCognitiveServicesAccount $rgname ' BingSearchTest' ' Bing.Search' ' S1' $locGBL
71
- Test-CreateCognitiveServicesAccount $rgname ' BingSpeechTest' ' Bing.Speech' ' S0' $locGBL
72
- Test-CreateCognitiveServicesAccount $rgname ' BingSpellCheckTest' ' Bing.SpellCheck' ' S1' $locGBL
68
+ Test-CreateCognitiveServicesAccount $rgname ' BingSearchTest' ' Bing.Search.v7' ' S1' $locGBL
69
+ Test-CreateCognitiveServicesAccount $rgname ' BingSpeechTest' ' SpeechServices' ' S0' $locWU
70
+ Test-CreateCognitiveServicesAccount $rgname ' BingSpellCheckTest' ' Bing.SpellCheck.v7' ' S1' $locGBL
73
71
Test-CreateCognitiveServicesAccount $rgname ' ComputerVisionTest' ' ComputerVision' ' S0' $locWU
74
72
Test-CreateCognitiveServicesAccount $rgname ' ContentModeratorTest' ' ContentModerator' ' S0' $locWU
75
- Test-CreateCognitiveServicesAccount $rgname ' EmotionTest' ' Emotion' ' S0' $locWU
76
73
Test-CreateCognitiveServicesAccount $rgname ' FaceTest' ' Face' ' S0' $locWU
77
74
Test-CreateCognitiveServicesAccount $rgname ' LUISTest' ' LUIS' ' S0' $locWU
78
- Test-CreateCognitiveServicesAccount $rgname ' RecommendationsTest' ' Recommendations' ' S1' $locWU
79
75
Test-CreateCognitiveServicesAccount $rgname ' SpeakerRecognitionTest' ' SpeakerRecognition' ' S0' $locWU
80
- Test-CreateCognitiveServicesAccount $rgname ' SpeechTest' ' Speech' ' S0' $locWU
81
- Test-CreateCognitiveServicesAccount $rgname ' SpeechTranslationTest' ' SpeechTranslation' ' S1' $locGBL
82
76
Test-CreateCognitiveServicesAccount $rgname ' TextAnalyticsTest' ' TextAnalytics' ' S1' $locWU
83
77
Test-CreateCognitiveServicesAccount $rgname ' TextTranslationTest' ' TextTranslation' ' S1' $locGBL
84
- Test-CreateCognitiveServicesAccount $rgname ' WebLMTest' ' WebLM' ' S0' $locWU
85
78
}
86
79
finally
87
80
{
@@ -292,6 +285,43 @@ function Test-NewAzureRmCognitiveServicesAccountKey
292
285
}
293
286
}
294
287
288
+
289
+ <#
290
+ . SYNOPSIS
291
+ Test New-AzCognitiveServicesAccountKey
292
+ #>
293
+ function Test-NewAzureRmCognitiveServicesAccountWithCustomDomain
294
+ {
295
+ # Setup
296
+ $rgname = Get-CognitiveServicesManagementTestResourceName ;
297
+
298
+ try
299
+ {
300
+ # Test
301
+ $accountname = ' csa' + $rgname ;
302
+ $skuname = ' S2' ;
303
+ $accounttype = ' TextAnalytics' ;
304
+ $loc = Get-Location - providerNamespace " Microsoft.CognitiveServices" - resourceType " accounts" - preferredLocation " West Central US" ;
305
+
306
+ New-AzResourceGroup - Name $rgname - Location $loc ;
307
+
308
+ $createdAccount = New-AzCognitiveServicesAccount - ResourceGroupName $rgname - Name $accountname - Type $accounttype - SkuName $skuname - Location $loc - CustomSubdomainName $accountname - Force;
309
+ Assert-NotNull $createdAccount ;
310
+ # Call create again, expect to get the same account
311
+ $createdAccountAgain = New-AzCognitiveServicesAccount - ResourceGroupName $rgname - Name $accountname - Type $accounttype - SkuName $skuname - Location $loc - CustomSubdomainName $accountname - Force;
312
+ Assert-NotNull $createdAccountAgain
313
+ Assert-AreEqual $createdAccount.Name $createdAccountAgain.Name ;
314
+ Assert-AreEqual $createdAccount.Endpoint $createdAccountAgain.Endpoint ;
315
+ Assert-True {$createdAccount.Endpoint.Contains (' cognitiveservices.azure.com' )}
316
+ Retry- IfException { Remove-AzCognitiveServicesAccount - ResourceGroupName $rgname - Name $accountname - Force; }
317
+ }
318
+ finally
319
+ {
320
+ # Cleanup
321
+ Clean - ResourceGroup $rgname
322
+ }
323
+ }
324
+
295
325
<#
296
326
. SYNOPSIS
297
327
Test Get-AzCognitiveServicesAccountSkus
@@ -306,13 +336,13 @@ function Test-GetAzureRmCognitiveServicesAccountSkus
306
336
$skus = (Get-AzCognitiveServicesAccountSkus - Type ' TextAnalytics' );
307
337
$skuNames = $skus | Select-Object - ExpandProperty Name | Sort-Object | Get-Unique
308
338
309
- $expectedSkus = " F0" , " S0" , " S1" , " S2" , " S3" , " S4"
339
+ $expectedSkus = " F0" , " S " , " S0" , " S1" , " S2" , " S3" , " S4"
310
340
Assert-AreEqualArray $expectedSkus $skuNames
311
341
312
342
$skus = (Get-AzCognitiveServicesAccountSkus - Type ' TextAnalytics' - Location ' westus' );
313
343
$skuNames = $skus | Select-Object - ExpandProperty Name | Sort-Object | Get-Unique
314
344
315
- $expectedSkus = " F0" , " S0" , " S1" , " S2" , " S3" , " S4"
345
+ $expectedSkus = " F0" , " S " , " S0" , " S1" , " S2" , " S3" , " S4"
316
346
Assert-AreEqualArray $expectedSkus $skuNames
317
347
318
348
$skus = (Get-AzCognitiveServicesAccountSkus - Type ' QnAMaker' - Location ' global' );
@@ -479,10 +509,10 @@ function Test-GetWithPaging
479
509
New-AzCognitiveServicesAccount - ResourceGroupName $rgname - Name " facepaging_wu_$i " - Type ' Face' - SkuName ' S0' - Location $loc - Force;
480
510
}
481
511
482
- # 100 Emotion
512
+ # 100 CV
483
513
For ($i = 0 ; $i -lt $TotalCount ; $i ++ )
484
514
{
485
- New-AzCognitiveServicesAccount - ResourceGroupName $rgname - Name " emotionpaging_wu_ $i " - Type ' Emotion ' - SkuName ' S0' - Location $loc - Force;
515
+ New-AzCognitiveServicesAccount - ResourceGroupName $rgname - Name " cvpaging_wu_ $i " - Type ' ComputerVision ' - SkuName ' S0' - Location $loc - Force;
486
516
}
487
517
488
518
$accounts = Get-AzCognitiveServicesAccount
0 commit comments