Skip to content

Commit 7db3e1b

Browse files
committed
Merge upstream
2 parents bd25599 + 9438240 commit 7db3e1b

File tree

76 files changed

+1440
-159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1440
-159
lines changed

examples/lib/loginService.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
azure account add --spn --appid "$spn" --secret "$secret" -t "$tenant" -s "$subscription"

examples/lib/loginUser.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
azure account add -u "$azureUser" -p "$password" -s "$subscription"

examples/resource-management/01-ResourceGroups.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ set -e
33
printf "\n=== Managing Resource Groups in Azure ===\n"
44

55
printf "\n1. Creating a new resource group: %s and location: %s.\n" "$groupName" "$location"
6-
azure group create --name "$groupName" --location "$location"
6+
azure group create -n "$groupName" --location "$location"
77

88
printf "\n2. Updating the group %s with tags.\n" "$groupName"
9-
azure group set --name "$groupName" --tags "[{\"Value\":\"testval\",\"Name\":\"testtag\"}]"
9+
azure group set -n "$groupName" --tags "[{\"Value\":\"testval\",\"Name\":\"testtag\"}]"
1010

1111
printf "\n3. Get information about resource group : %s.\n" "$groupName"
12-
resourceGroupInfo=`azure group get --name $groupName`
12+
resourceGroupInfo=`azure group get -n $groupName`
1313

1414
printf "\nValidating resource group name is: %s\n" "$groupName"
1515
[ $(echo $resourceGroupInfo | jq '.ResourceGroupName' --raw-output) == "$groupName" ]
@@ -18,4 +18,4 @@ printf "\n4. Listing all resource groups in the subscription.\n"
1818
azure group get
1919

2020
printf "\n5. Removing resource group: %s.\n" "$groupName"
21-
azure group remove --name "$groupName" --force
21+
azure group remove -n "$groupName" -f

src/CLU/CLUCoreCLR.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.23107.0
4+
VisualStudioVersion = 14.0.24720.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Commands.Common", "Commands.Common\Commands.Common.xproj", "{5F567ACA-595E-436D-83DB-A21E08F82DF6}"
77
EndProject
@@ -45,6 +45,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Commands.Co
4545
{45B05B68-516F-4D74-897F-56D12894946C} = {45B05B68-516F-4D74-897F-56D12894946C}
4646
EndProjectSection
4747
EndProject
48+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Commands.Common.ScenarioTest", "Commands.Common.ScenarioTest\Commands.Common.ScenarioTest.xproj", "{B1D3CB1F-C0CA-401F-8146-B2E9C1EF460F}"
49+
EndProject
4850
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Azure.Commands.Compute.Test", "Microsoft.Azure.Commands.Compute.Test\Microsoft.Azure.Commands.Compute.Test.xproj", "{13C34370-51A4-4726-81B8-BE0996FC9CFF}"
4951
ProjectSection(ProjectDependencies) = postProject
5052
{3910613E-4ED2-49E2-8CCF-966D586665AC} = {3910613E-4ED2-49E2-8CCF-966D586665AC}
@@ -133,6 +135,10 @@ Global
133135
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
134136
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
135137
{04F9968A-5662-4508-BEE2-31F56848FCBA}.Release|Any CPU.Build.0 = Release|Any CPU
138+
{B1D3CB1F-C0CA-401F-8146-B2E9C1EF460F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
139+
{B1D3CB1F-C0CA-401F-8146-B2E9C1EF460F}.Debug|Any CPU.Build.0 = Debug|Any CPU
140+
{B1D3CB1F-C0CA-401F-8146-B2E9C1EF460F}.Release|Any CPU.ActiveCfg = Release|Any CPU
141+
{B1D3CB1F-C0CA-401F-8146-B2E9C1EF460F}.Release|Any CPU.Build.0 = Release|Any CPU
136142
{13C34370-51A4-4726-81B8-BE0996FC9CFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
137143
{13C34370-51A4-4726-81B8-BE0996FC9CFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
138144
{13C34370-51A4-4726-81B8-BE0996FC9CFF}.Release|Any CPU.ActiveCfg = Release|Any CPU

src/CLU/Commands.Common.Authentication/Authentication/AdalTokenProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Commands.Common.Authentication.Properties;
1516
using Microsoft.Azure.Commands.Common.Authentication.Models;
1617
using System;
17-
using Commands.Common.Authentication.Properties;
1818

1919
namespace Microsoft.Azure.Commands.Common.Authentication
2020
{

src/CLU/Commands.Common.Authentication/Authentication/ServicePrincipalTokenProvider.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,11 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Commands.Common.Authentication.Properties;
1516
using Microsoft.Azure.Commands.Common.Authentication.Models;
1617
using Microsoft.IdentityModel.Clients.ActiveDirectory;
1718
using Microsoft.Rest;
1819
using System;
19-
using System.Collections.Generic;
20-
using System.Security;
21-
using System.Security.Cryptography.X509Certificates;
22-
using Commands.Common.Authentication.Properties;
2320

2421
namespace Microsoft.Azure.Commands.Common.Authentication
2522
{

src/CLU/Commands.Common.Authentication/Authentication/UserTokenProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
using Microsoft.Rest;
1818
using System;
1919
using System.Runtime.InteropServices;
20-
using Commands.Common.Authentication.Properties;
2120
using Microsoft.Rest.Azure.Authentication;
2221
using System.Management.Automation;
22+
using Commands.Common.Authentication.Properties;
2323

2424
namespace Microsoft.Azure.Commands.Common.Authentication
2525
{

src/CLU/Commands.Common.Authentication/AuthenticationFactory.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ----------------------------------------------------------------------------------
1+
// ----------------------------------------------------------------------------------
22
//
33
// Copyright Microsoft Corporation
44
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,11 +16,10 @@
1616
using System;
1717
using System.Linq;
1818
using System.Management.Automation;
19-
using System.Security;
20-
using Commands.Common.Authentication.Properties;
2119
using Microsoft.IdentityModel.Clients.ActiveDirectory;
2220
using Microsoft.Rest;
2321
using Microsoft.Rest.Azure.Authentication;
22+
using Commands.Common.Authentication.Properties;
2423

2524
namespace Microsoft.Azure.Commands.Common.Authentication.Factories
2625
{

src/CLU/Commands.Common.Authentication/ClientFactory.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,17 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Commands.Common.Authentication.Properties;
1516
using Microsoft.Azure.Commands.Common.Authentication.Models;
1617
using Microsoft.Rest;
1718
using System;
1819
using System.Collections.Generic;
1920
using System.Collections.Specialized;
20-
using System.Linq;
2121
using System.Management.Automation;
2222
using System.Net;
2323
using System.Net.Http;
2424
using System.Net.Http.Headers;
2525
using System.Reflection;
26-
using Commands.Common.Authentication.Properties;
2726

2827
namespace Microsoft.Azure.Commands.Common.Authentication.Factories
2928
{

src/CLU/Commands.Common.Authentication/JsonUtilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Commands.Common.Authentication.Properties;
1516
using Newtonsoft.Json;
1617
using Newtonsoft.Json.Linq;
1718
using System;
1819
using System.Collections.Generic;
1920
using System.Diagnostics.CodeAnalysis;
20-
using Commands.Common.Authentication.Properties;
2121

2222
namespace Microsoft.Azure.Commands.Common.Authentication
2323
{

src/CLU/Commands.Common.Authentication/Models/AzureEnvironment.Methods.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Commands.Common.Authentication.Properties;
1516
using System;
1617
using System.Collections.Generic;
17-
using Commands.Common.Authentication.Properties;
1818

1919
namespace Microsoft.Azure.Commands.Common.Authentication.Models
2020
{
@@ -372,7 +372,7 @@ public static class AzureEnvironmentConstants
372372

373373
public const string USGovernmentSqlDatabaseDnsSuffix = ".database.usgovcloudapi.net";
374374

375-
public const string AzureActiveDirectoryEndpoint = "https://login.windows.net/";
375+
public const string AzureActiveDirectoryEndpoint = "https://login.microsoftonline.com/";
376376

377377
public const string ChinaActiveDirectoryEndpoint = "https://login.chinacloudapi.cn/";
378378

src/CLU/Commands.Common.Authentication/Models/AzureSMProfile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Commands.Common.Authentication.Properties;
1516
using Microsoft.Rest;
1617
using Newtonsoft.Json;
1718
using System;
1819
using System.Collections.Generic;
1920
using System.Linq;
20-
using Commands.Common.Authentication.Properties;
2121

2222
namespace Microsoft.Azure.Commands.Common.Authentication.Models
2323
{

src/CLU/Commands.Common.Authentication/Models/DiskDataStore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Commands.Common.Authentication.Properties;
1516
using System;
1617
using System.IO;
1718
using System.Security.Cryptography.X509Certificates;
1819
using System.Text;
19-
using Commands.Common.Authentication.Properties;
2020

2121
namespace Microsoft.Azure.Commands.Common.Authentication.Models
2222
{

src/CLU/Commands.Common.Authentication/Properties/Resources.Designer.cs

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CLU/Commands.Common.Authentication/Properties/Resources.resx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@
120120
<data name="AccountNeedsToBeSpecified" xml:space="preserve">
121121
<value>Account needs to be specified</value>
122122
</data>
123-
<data name="AzureDirectoryName" xml:space="preserve">
124-
<value>Windows Azure Powershell</value>
125-
</data>
126123
<data name="CertificateNotFoundInStore" xml:space="preserve">
127124
<value>No certificate was found in the certificate store with thumbprint {0}</value>
128125
</data>

src/CLU/Commands.Common.Authentication/Validate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Commands.Common.Authentication.Properties;
1516
using System;
1617
using System.IO;
1718
using System.Linq;
18-
using Commands.Common.Authentication.Properties;
1919

2020
namespace Microsoft.Azure.Commands.Common.Authentication
2121
{
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
8+
<PropertyGroup Label="Globals">
9+
<ProjectGuid>b1d3cb1f-c0ca-401f-8146-b2e9c1ef460f</ProjectGuid>
10+
<RootNamespace>Microsoft.Azure.Commands.Common.ScenarioTest</RootNamespace>
11+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
13+
</PropertyGroup>
14+
<PropertyGroup>
15+
<SchemaVersion>2.0</SchemaVersion>
16+
</PropertyGroup>
17+
<ItemGroup>
18+
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
19+
</ItemGroup>
20+
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
21+
</Project>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
16+
using System.Collections.Generic;
17+
using System.Linq;
18+
using System.Threading.Tasks;
19+
20+
namespace Microsoft.Azure.Commands.Common.ScenarioTest
21+
{
22+
public static class EnvironmentConstants
23+
{
24+
public const string UsernameKey = "Username";
25+
public const string PasswordKey = "Password";
26+
public const string ServicePrincipalKey = "ServicePrincipal";
27+
public const string TenantKey = "TenantId";
28+
public const string SubscriptionKey = "SubscriptionId";
29+
public const string TestRunDirectory = "TestRunDirectory";
30+
public const string ExampleDirectory = "ExamplesDirectory";
31+
}
32+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System.Collections.Generic;
16+
using System.IO;
17+
18+
namespace Microsoft.Azure.Commands.Common.ScenarioTest
19+
{
20+
public class EnvironmentContextFactory
21+
{
22+
ICredentialsProvider _credentials;
23+
24+
25+
public EnvironmentContextFactory(ICredentialsProvider credentials)
26+
{
27+
_credentials = credentials;
28+
}
29+
30+
public TestContext GetTestContext(string scriptDirectoryName)
31+
{
32+
var context = new TestContext();
33+
context.ExecutionDirectory = GetBaseDirectory();
34+
context.TestScriptDirectory =GetExamplesDirectory(context.ExecutionDirectory, scriptDirectoryName);
35+
context.TestExecutableName = "bash.exe";
36+
context.TestScriptSuffix = ".sh";
37+
var helpers = new List<IScriptEnvironmentHelper>();
38+
helpers.Add(_credentials.EnvironmentProvider);
39+
context.EnvironmentHelpers = helpers;
40+
return context;
41+
}
42+
43+
private string GetExamplesDirectory(string executionDirectory, string scriptDirectoryName)
44+
{
45+
string examplesDirectory;
46+
if (!Utilities.TryGetEnvironmentVariable(EnvironmentConstants.ExampleDirectory, out examplesDirectory))
47+
{
48+
examplesDirectory = Path.GetFullPath(Path.Combine(executionDirectory, "..",
49+
"..", "..", "examples"));
50+
}
51+
52+
return Path.Combine(examplesDirectory, scriptDirectoryName);
53+
}
54+
private string GetBaseDirectory()
55+
{
56+
string baseDirectory;
57+
if (!Utilities.TryGetEnvironmentVariable(EnvironmentConstants.TestRunDirectory, out baseDirectory))
58+
{
59+
baseDirectory = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), "..", "TestResults"));
60+
}
61+
62+
Utilities.EnsureDirectoryExists(baseDirectory);
63+
return baseDirectory;
64+
}
65+
66+
}
67+
}

0 commit comments

Comments
 (0)