Skip to content

Commit 20f021e

Browse files
authored
Add support for export storage account and managed identity (#11980)
* Add export settings * Add support for MI * Update version and changelog * Update test * Fix unit test and help docs * Update session record
1 parent 428604a commit 20f021e

15 files changed

+5427
-1089
lines changed

src/HealthcareApis/HealthcareApis.Test/HealthcareApis.Test.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.Azure.Management.HealthcareApis" Version="1.0.2" />
14+
<PackageReference Include="Microsoft.Azure.Management.HealthcareApis" Version="1.1.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>
1818
<ProjectReference Include="..\HealthcareApis\HealthcareApis.csproj" />
1919
</ItemGroup>
2020

21+
<ItemGroup>
22+
<Folder Include="SessionRecords\Microsoft.Azure.Commands.HealthcareApisService.Test.ScenarioTests.HealthcareApisServiceTests\" />
23+
</ItemGroup>
24+
2125
</Project>

src/HealthcareApis/HealthcareApis.Test/ScenarioTests/Common.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Gets valid location name
3636
#>
3737
function Get-Location
3838
{
39-
return "West US"
39+
return "southcentralus"
4040
}
4141

4242
<#

src/HealthcareApis/HealthcareApis.Test/ScenarioTests/HeathcareApisServiceController.cs renamed to src/HealthcareApis/HealthcareApis.Test/ScenarioTests/HealthcareApisServiceController.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace Microsoft.Azure.Commands.HealthcareApisService.Test.ScenarioTests
3030
using ServiceManagement.Common.Models;
3131
using TestEnvironmentFactory = Rest.ClientRuntime.Azure.TestFramework.TestEnvironmentFactory;
3232

33-
public sealed class HeathcareApisServiceController
33+
public sealed class HealthcareApisServiceController
3434
{
3535
private readonly EnvironmentSetupHelper _helper;
3636

@@ -40,9 +40,9 @@ public sealed class HeathcareApisServiceController
4040

4141
public GraphRbacManagementClient GraphRbacManagementClient { get; set; }
4242

43-
public static HeathcareApisServiceController NewInstance => new HeathcareApisServiceController();
43+
public static HealthcareApisServiceController NewInstance => new HealthcareApisServiceController();
4444

45-
public HeathcareApisServiceController()
45+
public HealthcareApisServiceController()
4646
{
4747
_helper = new EnvironmentSetupHelper();
4848
}
@@ -138,9 +138,5 @@ private static GraphRbacManagementClient GetGraphRBACManagementClient(MockContex
138138
{
139139
return context.GetServiceClient<GraphRbacManagementClient>(TestEnvironmentFactory.GetTestEnvironment());
140140
}
141-
142-
143-
144-
145141
}
146142
}

src/HealthcareApis/HealthcareApis.Test/ScenarioTests/HealthcareApisServiceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public HealthcareApisServiceTests(ITestOutputHelper output)
3434
[Trait(Category.AcceptanceType, Category.CheckIn)]
3535
public void TestAzRmHealthcareApisService()
3636
{
37-
HeathcareApisServiceController.NewInstance.RunPsTest(_logger, "Test-AzRmHealthcareApisService");
37+
HealthcareApisServiceController.NewInstance.RunPsTest(_logger, "Test-AzRmHealthcareApisService");
3838
}
3939
}
4040
}

src/HealthcareApis/HealthcareApis.Test/ScenarioTests/HealthcareApisServiceTests.ps1

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,40 +31,49 @@ function Test-AzRmHealthcareApisService{
3131
$offerThroughput = Get-OfferThroughput
3232
$kind = Get-Kind
3333
$object_id = Get-AccessPolicyObjectID;
34+
$storageAccountName = "exportStorage"
3435

3536
try
3637
{
3738
# Test
3839
# Create Resource Group
3940
New-AzResourceGroup -Name $rgname -Location $location
4041

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;
4444

4545
$actual = Get-AzHealthcareApisService -ResourceGroupName $rgname -Name $rname
4646

4747
# 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+
5157
#Update using parameters
5258
$newOfferThroughput = $offerThroughput - 600
53-
$updated = Set-AzHealthcareApisService -ResourceId $actual.Id -CosmosOfferThroughput $newOfferThroughput;
59+
$updated = Set-AzHealthcareApisService -ResourceId $actual.Id -CosmosOfferThroughput $newOfferThroughput -DisableManagedIdentity;
5460

5561
$updatedAccount = Get-AzHealthcareApisService -ResourceGroupName $rgname -Name $rname
62+
5663
# 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
5967

68+
# Create second App
6069
$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;
6271

6372
$actual1 = Get-AzHealthcareApisService -ResourceGroupName $rgname -Name $rname1
6473

6574
# 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
6877

6978
$list = Get-AzHealthcareApisService -ResourceGroupName $rgname
7079

0 commit comments

Comments
 (0)