Skip to content

Commit e79384a

Browse files
committed
Added support acr in Set-AzAksCluster
1 parent c0e3f3a commit e79384a

File tree

3 files changed

+4
-44
lines changed

3 files changed

+4
-44
lines changed

src/Aks/Aks.Test/Aks.Test.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<ItemGroup>
1414
<PackageReference Include="YamlDotNet.Signed" Version="5.2.1" />
1515
<PackageReference Include="Microsoft.Azure.Management.ContainerRegistry" Version="4.0.0" />
16-
<PackageReference Include="Microsoft.Azure.ContainerRegistry" Version="1.0.0-preview.1" />
1716
<PackageReference Include="Microsoft.Azure.Management.ContainerService" Version="1.1.0" />
1817
</ItemGroup>
1918

src/Aks/Aks.Test/ScenarioTests/KubernetesTests.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function Test-NewAzAksWithAcr
3838
$resourceGroupName = Get-RandomResourceGroupName
3939
$kubeClusterName = Get-RandomClusterName
4040
$acrName = Get-RandomRegistryName
41-
$location = 'eastus'
41+
$location = Get-ProviderLocation "Microsoft.ContainerService/managedClusters"
4242
$nodeVmSize = "Standard_D2_v2"
4343

4444
try
@@ -47,8 +47,9 @@ function Test-NewAzAksWithAcr
4747

4848
New-AzContainerRegistry -ResourceGroupName $resourceGroupName -Name $acrName -Sku Standard
4949

50-
51-
New-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName -NodeVmSize $nodeVmSize -AcrNameToAttach $acrName
50+
$cred = $(createTestCredential "e65d50b0-0853-48a9-82d3-77d800f4a9bc" "V8-S-y6Er8jXy-.aM_WT95BF89N~X23lqb")
51+
52+
New-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName -NodeVmSize $nodeVmSize -ServicePrincipalIdAndSecret $cred -AcrNameToAttach $acrName
5253
$cluster = Get-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName
5354
Assert-NotNull $cluster.Fqdn
5455
Assert-NotNull $cluster.DnsPrefix

src/Aks/Aks.Test/ScenarioTests/TestController.cs

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ public TestController()
3535

3636
public static TestController NewInstance => new TestController();
3737

38-
private const string TenantIdKey = "TenantId";
39-
private const string DomainKey = "Domain";
40-
private const string SubscriptionIdKey = "SubscriptionId";
4138
public string UserDomain { get; private set; }
4239
public GraphRbacManagementClient InternalGraphRbacManagementClient { get; private set; }
4340

@@ -137,43 +134,6 @@ private static ContainerServiceClient GetContainerServiceClient(MockContext cont
137134
}
138135
private GraphRbacManagementClient GetGraphRbacManagementClient(MockContext context)
139136
{
140-
//var environment = TestEnvironmentFactory.GetTestEnvironment();
141-
//string tenantId = null;
142-
143-
//if (HttpMockServer.Mode == HttpRecorderMode.Record)
144-
//{
145-
// tenantId = environment.Tenant;
146-
// UserDomain = String.IsNullOrEmpty(environment.UserName) ? String.Empty : environment.UserName.Split(new[] { "@" }, StringSplitOptions.RemoveEmptyEntries).Last();
147-
148-
// HttpMockServer.Variables[TenantIdKey] = tenantId;
149-
// HttpMockServer.Variables[DomainKey] = UserDomain;
150-
//}
151-
//else if (HttpMockServer.Mode == HttpRecorderMode.Playback)
152-
//{
153-
// if (HttpMockServer.Variables.ContainsKey(TenantIdKey))
154-
// {
155-
// tenantId = HttpMockServer.Variables[TenantIdKey];
156-
// }
157-
// if (HttpMockServer.Variables.ContainsKey(DomainKey))
158-
// {
159-
// UserDomain = HttpMockServer.Variables[DomainKey];
160-
// }
161-
// if (HttpMockServer.Variables.ContainsKey(SubscriptionIdKey))
162-
// {
163-
// AzureRmProfileProvider.Instance.Profile.DefaultContext.Subscription.Id = HttpMockServer.Variables[SubscriptionIdKey];
164-
// }
165-
//}
166-
167-
//var client = context.GetGraphServiceClient<GraphRbacManagementClient>(environment);
168-
//client.TenantID = tenantId;
169-
//if (AzureRmProfileProvider.Instance != null &&
170-
// AzureRmProfileProvider.Instance.Profile != null &&
171-
// AzureRmProfileProvider.Instance.Profile.DefaultContext != null &&
172-
// AzureRmProfileProvider.Instance.Profile.DefaultContext.Tenant != null)
173-
//{
174-
// AzureRmProfileProvider.Instance.Profile.DefaultContext.Tenant.Id = client.TenantID;
175-
//}
176-
//return client;
177137
return context.GetServiceClient<GraphRbacManagementClient>();
178138
}
179139
private static AuthorizationManagementClient GetAuthorizationManagementClient(MockContext context)

0 commit comments

Comments
 (0)