@@ -31,40 +31,49 @@ function Test-AzRmHealthcareApisService{
31
31
$offerThroughput = Get-OfferThroughput
32
32
$kind = Get-Kind
33
33
$object_id = Get-AccessPolicyObjectID ;
34
+ $storageAccountName = " exportStorage"
34
35
35
36
try
36
37
{
37
38
# Test
38
39
# Create Resource Group
39
40
New-AzResourceGroup - Name $rgname - Location $location
40
41
41
- # Create App
42
-
43
- $created = New-AzHealthcareApisService - Name $rname - ResourceGroupName $rgname - Location $location - Kind $kind - AccessPolicyObjectId $object_id - CosmosOfferThroughput $offerThroughput ;
42
+ # Create App
43
+ $created = New-AzHealthcareApisService - Name $rname - ResourceGroupName $rgname - Location $location - Kind $kind - CosmosOfferThroughput $offerThroughput - ManagedIdentity - ExportStorageAccountName $storageAccountName ;
44
44
45
45
$actual = Get-AzHealthcareApisService - ResourceGroupName $rgname - Name $rname
46
46
47
47
# Assert
48
- Assert-AreEqual $actual.Name $rname
49
- Assert-AreEqual $actual.CosmosDbOfferThroughput $offerThroughput
50
- Assert-AreEqual $actual.Kind $kind
48
+ Assert-AreEqual $rname $actual.Name
49
+ Assert-AreEqual $offerThroughput $actual.CosmosDbOfferThroughput
50
+ Assert-AreEqual $kind $actual.Kind
51
+ Assert-AreEqual " https://$rname .azurehealthcareapis.com" $actual.Audience
52
+ Assert-AreEqual $storageAccountName $actual.ExportStorageAccountName
53
+ Assert-AreEqual " SystemAssigned" $actual.IdentityType
54
+ Assert-NotNull $actual.IdentityPrincipalId
55
+ Assert-NotNull $actual.IdentityTenantId
56
+
51
57
# Update using parameters
52
58
$newOfferThroughput = $offerThroughput - 600
53
- $updated = Set-AzHealthcareApisService - ResourceId $actual.Id - CosmosOfferThroughput $newOfferThroughput ;
59
+ $updated = Set-AzHealthcareApisService - ResourceId $actual.Id - CosmosOfferThroughput $newOfferThroughput - DisableManagedIdentity ;
54
60
55
61
$updatedAccount = Get-AzHealthcareApisService - ResourceGroupName $rgname - Name $rname
62
+
56
63
# Assert the update
57
- Assert-AreEqual $updatedAccount.Name $rname
58
- Assert-AreEqual $updatedAccount.CosmosDbOfferThroughput $newOfferThroughput
64
+ Assert-AreEqual $rname $updatedAccount.Name
65
+ Assert-AreEqual $newOfferThroughput $updatedAccount.CosmosDbOfferThroughput
66
+ Assert-AreEqual " None" $updatedAccount.IdentityType
59
67
68
+ # Create second App
60
69
$rname1 = $rname + " 1"
61
- $created1 = New-AzHealthcareApisService - Name $rname1 - ResourceGroupName $rgname - Location $location - AccessPolicyObjectId $object_id - CosmosOfferThroughput $offerThroughput ;
70
+ $created1 = New-AzHealthcareApisService - Name $rname1 - ResourceGroupName $rgname - Location $location - AccessPolicyObjectId $object_id - CosmosOfferThroughput $offerThroughput ;
62
71
63
72
$actual1 = Get-AzHealthcareApisService - ResourceGroupName $rgname - Name $rname1
64
73
65
74
# Assert
66
- Assert-AreEqual $actual1.Name $rname1
67
- Assert-AreEqual $actual1.CosmosDbOfferThroughput $offerThroughput
75
+ Assert-AreEqual $rname1 $ actual1.Name
76
+ Assert-AreEqual $offerThroughput $ actual1.CosmosDbOfferThroughput
68
77
69
78
$list = Get-AzHealthcareApisService - ResourceGroupName $rgname
70
79
0 commit comments