Skip to content

Commit 2d190cc

Browse files
authored
Merge branch 'release-2018-04-06' into vmssddstatus
2 parents ca5cf13 + 079fd4a commit 2d190cc

File tree

957 files changed

+338214
-47153
lines changed

Some content is hidden

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

957 files changed

+338214
-47153
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ FakesAssemblies/
215215
*.GhostDoc.xml
216216
pingme.txt
217217
groupMapping*.json
218+
/tools/index.json
219+
/Package/index.json
218220

219221
*.msi
220222
*.wixpdb

Azure.PowerShell.Netcore.sln

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.Consumption.Netcor
7373
EndProject
7474
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.ContainerRegistry.Netcore", "src\ResourceManager\ContainerRegistry\Commands.ContainerRegistry\Commands.ContainerRegistry.Netcore.csproj", "{49A69011-CEFF-464B-AC2E-5A387EFFBE8B}"
7575
EndProject
76-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.DataFactoryV2.Netcore", "src\ResourceManager\DataFactories\Commands.DataFactoryV2\Commands.DataFactoryV2.Netcore.csproj", "{EAC7B54E-974B-435F-95CE-B01CC2F955A3}"
76+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.DataFactoryV2.Netcore", "src\ResourceManager\DataFactoryV2\Commands.DataFactoryV2\Commands.DataFactoryV2.Netcore.csproj", "{EAC7B54E-974B-435F-95CE-B01CC2F955A3}"
7777
EndProject
7878
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.DataLakeAnalytics.Netcore", "src\ResourceManager\DataLakeAnalytics\Commands.DataLakeAnalytics\Commands.DataLakeAnalytics.Netcore.csproj", "{CC0D2BA5-B087-4206-9F98-CD8230AADEF3}"
7979
EndProject
@@ -175,6 +175,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.RedisCache.Netcore
175175
EndProject
176176
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.AnalysisServices.Dataplane.Netcore", "src\ResourceManager\AnalysisServices\Commands.AnalysisServices.Dataplane\Commands.AnalysisServices.Dataplane.Netcore.csproj", "{F172B347-4B1F-4888-A5B9-3D05303C0E6F}"
177177
EndProject
178+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commands.Storage.Netcore", "src\Storage\Commands.Storage\Commands.Storage.Netcore.csproj", "{4F18000A-0329-4450-ADC8-8AA1C04A4666}"
179+
EndProject
178180
Global
179181
GlobalSection(SolutionConfigurationPlatforms) = preSolution
180182
Debug|Any CPU = Debug|Any CPU
@@ -1205,6 +1207,18 @@ Global
12051207
{F172B347-4B1F-4888-A5B9-3D05303C0E6F}.Release|x64.Build.0 = Release|Any CPU
12061208
{F172B347-4B1F-4888-A5B9-3D05303C0E6F}.Release|x86.ActiveCfg = Release|Any CPU
12071209
{F172B347-4B1F-4888-A5B9-3D05303C0E6F}.Release|x86.Build.0 = Release|Any CPU
1210+
{4F18000A-0329-4450-ADC8-8AA1C04A4666}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1211+
{4F18000A-0329-4450-ADC8-8AA1C04A4666}.Debug|Any CPU.Build.0 = Debug|Any CPU
1212+
{4F18000A-0329-4450-ADC8-8AA1C04A4666}.Debug|x64.ActiveCfg = Debug|Any CPU
1213+
{4F18000A-0329-4450-ADC8-8AA1C04A4666}.Debug|x64.Build.0 = Debug|Any CPU
1214+
{4F18000A-0329-4450-ADC8-8AA1C04A4666}.Debug|x86.ActiveCfg = Debug|Any CPU
1215+
{4F18000A-0329-4450-ADC8-8AA1C04A4666}.Debug|x86.Build.0 = Debug|Any CPU
1216+
{4F18000A-0329-4450-ADC8-8AA1C04A4666}.Release|Any CPU.ActiveCfg = Release|Any CPU
1217+
{4F18000A-0329-4450-ADC8-8AA1C04A4666}.Release|Any CPU.Build.0 = Release|Any CPU
1218+
{4F18000A-0329-4450-ADC8-8AA1C04A4666}.Release|x64.ActiveCfg = Release|Any CPU
1219+
{4F18000A-0329-4450-ADC8-8AA1C04A4666}.Release|x64.Build.0 = Release|Any CPU
1220+
{4F18000A-0329-4450-ADC8-8AA1C04A4666}.Release|x86.ActiveCfg = Release|Any CPU
1221+
{4F18000A-0329-4450-ADC8-8AA1C04A4666}.Release|x86.Build.0 = Release|Any CPU
12081222
EndGlobalSection
12091223
GlobalSection(SolutionProperties) = preSolution
12101224
HideSolutionNode = FALSE

TestMappings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@
5959
],
6060
"src/ResourceManager/DataFactories/": [
6161
".\\src\\ResourceManager\\DataFactories\\Commands.DataFactories.Test\\bin\\Debug\\Microsoft.Azure.Commands.DataFactories.Test.dll",
62-
".\\src\\ResourceManager\\DataFactories\\Commands.DataFactoryV2.Test\\bin\\Debug\\Microsoft.Azure.Commands.DataFactoryV2.Test.dll",
6362
".\\src\\ResourceManager\\StreamAnalytics\\Commands.StreamAnalytics.Test\\bin\\Debug\\Microsoft.Azure.Commands.StreamAnalytics.Test.dll"
6463
],
64+
"src/ResourceManager/DataFactoryV2/": [
65+
".\\src\\ResourceManager\\DataFactoryV2\\Commands.DataFactoryV2.Test\\bin\\Debug\\Microsoft.Azure.Commands.DataFactoryV2.Test.dll"
66+
],
6567
"src/ResourceManager/DataLakeAnalytics/": [
6668
".\\src\\ResourceManager\\DataLakeAnalytics\\Commands.DataLakeAnalytics.Test\\bin\\Debug\\Microsoft.Azure.Commands.DataLakeAnalytics.Test.dll"
6769
],
@@ -203,5 +205,8 @@
203205
],
204206
"tools/BuildPackagesTask/": [
205207
".\\tools\\BuildPackagesTask\\Microsoft.Azure.Build.Tasks.Test\\bin\\Debug\\Microsoft.Azure.Build.Tasks.Test.dll"
208+
],
209+
"tools/RepoTasks/": [
210+
".\\tools\\RepoTasks\\RepoTasks.Cmdlets.Tests\\bin\\Debug\\RepoTasks.Cmdlets.Tests.dll"
206211
]
207212
}

build.proj

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171

7272
<StaticAnalysis Include=".\tools\StaticAnalysis\StaticAnalysis.sln" />
7373
<LocalBuildTasks Include="$(LibraryToolsFolder)\BuildPackagesTask\Microsoft.Azure.Build.Tasks.sln" />
74+
<LocalBuildTasks Include="$(LibraryToolsFolder)\RepoTasks\RepoTasks.sln" />
7475
</ItemGroup>
7576

7677
<!-- Tasks -->
@@ -148,6 +149,7 @@
148149
<NuGetRestoreConfigSwitch>-ConfigFile &quot;$(NuGetRestoreConfigFile)&quot;</NuGetRestoreConfigSwitch>
149150
<NuGetRestorePackageSetting>-PackagesDirectory $(LibraryNugetPackageFolder)</NuGetRestorePackageSetting>
150151
<NuGetLocalBuildTaskPackages>-PackagesDirectory $(LibraryToolsFolder)\BuildPackagesTask\packages</NuGetLocalBuildTaskPackages>
152+
<NuGetRepoTasksPackages>-PackagesDirectory $(LibraryToolsFolder)\RepoTasks\packages</NuGetRepoTasksPackages>
151153

152154
<PowerShellCommand Condition=" '$(PowerShellCommand)' == '' ">C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe</PowerShellCommand>
153155
<PowerShellCoreCommand Condition=" '$(PowerShellCoreCommand)' == '' ">pwsh</PowerShellCoreCommand>
@@ -182,6 +184,11 @@
182184
<!-- Restore packages for local build tasks-->
183185
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetLocalBuildTaskPackages)"
184186
ContinueOnError="false" />
187+
<!-- Restore packages for repo tasks tasks-->
188+
<Exec Command="$(NuGetCommand) restore %(LocalBuildTasks.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRepoTasksPackages)"
189+
ContinueOnError="false" />
190+
<Exec Command="$(NuGetCommand) restore %(SetupSln.FullPath) $(NuGetRestoreConfigSwitch) $(NuGetRestorePackageSetting)"
191+
ContinueOnError="false" />
185192

186193
<!--Restore the xunit runner needed to run unit tests-->
187194
<Exec Command="$(NuGetCommand) restore $(MSBuildProjectDirectory)\packages.config -PackagesDirectory $(MSBuildProjectDirectory)\packages" />
@@ -194,8 +201,6 @@
194201
<Message Importance="high" Text="Building Cmdlets..." />
195202

196203
<MakeDir Directories="$(PackageDirectory)" />
197-
<Exec ContinueOnError="false"
198-
Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot; . $(LibraryToolsFolder)\CreateMappings.ps1 -RootPath $(LibrarySourceFolder) -OutputFile $(PackageDirectory)\groupMapping.json -WarningFile $(PackageDirectory)\groupMappingWarnings.json -RulesFile $(LibraryToolsFolder)\CreateMappings_rules.json &quot;" Condition="'$(Latest)' == 'true'"/>
199204

200205
<MSBuild
201206
Projects="@(CmdletSolutionsToBuild)"
@@ -211,6 +216,10 @@
211216

212217
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 $(Configuration) $(Scope) -Profile Latest &quot; " Condition="'$(Latest)' == 'true' and '$(CodeSign)' == 'false'"/>
213218
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\UpdateModules.ps1 $(Configuration) $(Scope) -Profile Stack &quot; " Condition="'$(Stack)' == 'true' and '$(CodeSign)' == 'false'"/>
219+
220+
<Exec ContinueOnError="false"
221+
Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot; . $(LibraryToolsFolder)\NewHelpIndex.ps1 -OutputFile $(PackageDirectory)\index.json -BuildConfig $(Configuration) &quot;" Condition="'$(Latest)' == 'true'"/>
222+
214223
<!-- Copying shortcut to be signed -->
215224
<Copy SourceFiles="$(LibraryRoot)tools\AzureRM\AzureRM.psd1"
216225
DestinationFolder="$(LibrarySourceFolder)\Package\$(Configuration)" Condition= " '$(NetCore)' == 'false' and '$(Latest)' == 'true'"/>
@@ -245,6 +254,7 @@
245254

246255
<Message Importance="high" Text="Running Static Analyser" />
247256
<CallTarget targets="DependencyAnalysis" ContinueOnError="ErrorAndContinue" />
257+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CheckAssemblies.ps1 -BuildConfig $(Configuration) &quot;" />
248258
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CleanupBuild.ps1 -BuildConfig $(Configuration) &quot;" />
249259
</Target>
250260

src/Common/Commands.Common.Authentication.Abstractions/AzureAccount.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,13 @@ public static class Property
128128
/// <summary>
129129
/// Backup login Uri for MSI
130130
/// </summary>
131-
MSILoginUriBackup = "MSILoginBackup";
131+
MSILoginUriBackup = "MSILoginBackup",
132132

133133

134+
/// <summary>
135+
/// Secret that may be used with MSI login
136+
/// </summary>
137+
MSILoginSecret = "MSILoginSecret";
134138
}
135139
}
136140
}

src/Common/Commands.Common.Authentication/Authentication/ManagedServiceAccessToken.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using Microsoft.Rest.Azure;
1818
using System;
1919
using System.Collections.Generic;
20+
using System.Net.Http;
2021
using System.Text;
2122
using System.Threading;
2223

@@ -72,6 +73,10 @@ public ManagedServiceAccessToken(IAzureAccount account, IAzureEnvironment enviro
7273
}
7374

7475
_tokenGetter = factory.GetHttpOperations<ManagedServiceTokenInfo>(true).WithHeader("Metadata", new[] { "true" });
76+
if (account.IsPropertySet(AzureAccount.Property.MSILoginSecret))
77+
{
78+
_tokenGetter = _tokenGetter.WithHeader("Secret", new[] { account.GetProperty(AzureAccount.Property.MSILoginSecret) });
79+
}
7580
}
7681

7782
public string AccessToken
@@ -119,11 +124,12 @@ void GetOrRenewAuthentication()
119124
RequestUris.Clear();
120125
RequestUris.Enqueue(currentRequestUri);
121126
}
122-
catch (CloudException) when (RequestUris.Count > 0)
127+
catch (Exception e) when ( (e is CloudException || e is HttpRequestException) && RequestUris.Count > 0)
123128
{
124-
// do nothing
129+
// skip to the next uri
125130
}
126131
}
132+
127133
SetToken(info);
128134
}
129135
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright Microsoft Corporation
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software
7+
// distributed under the License is distributed on an "AS IS" BASIS,
8+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
// See the License for the specific language governing permissions and
10+
// limitations under the License.
11+
// ----------------------------------------------------------------------------------
12+
13+
using System;
14+
15+
namespace Microsoft.WindowsAzure.Commands.Common.Attributes
16+
{
17+
[Flags]
18+
public enum ViewControl
19+
{
20+
None = 0,
21+
Table,
22+
List,
23+
All = Table | List,
24+
}
25+
26+
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
27+
public sealed class Ps1XmlAttribute : Attribute
28+
{
29+
public string Label { get; set; }
30+
31+
public ViewControl Target { get; set; } = ViewControl.Table;
32+
}
33+
}

src/Common/Commands.Common/AzureDataCmdlet.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,24 @@ protected override void ConfirmAction(bool force, string continueMessage, string
7878
ConfirmAction(force, continueMessage, processMessage, target, action, () => true);
7979
}
8080

81-
#if !NETSTANDARD
8281
public IAzureContextContainer SMProfile
8382
{
8483
get
8584
{
85+
#if NETSTANDARD
86+
return null;
87+
#else
8688
IAzureContextContainer result = null;
8789
if (AzureSMProfileProvider.Instance != null)
8890
{
8991
result = AzureSMProfileProvider.Instance.Profile;
9092
}
9193

9294
return result;
95+
#endif
9396
}
9497
}
95-
#endif
98+
9699

97100
protected override string DataCollectionWarning
98101
{

src/Common/Commands.Common/Commands.Common.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
<Reference Include="System.Xml" />
112112
</ItemGroup>
113113
<ItemGroup>
114+
<Compile Include="Attributes\Ps1XmlAttribute.cs" />
114115
<Compile Include="LongRunningJobCancelledException.cs" />
115116
<Compile Include="ShouldMethodInvoker.cs" />
116117
<Compile Include="AzureLongRunningJob.cs" />

src/Common/Commands.Common/Extensions/CmdletExtensions.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,18 @@ public static void SafeCopyParameterSet<T>(this T source, T target) where T : Az
202202
}
203203
}
204204

205+
/// <summary>
206+
/// Return the value of a paramater, or null if not set
207+
/// </summary>
208+
/// <typeparam name="T"></typeparam>
209+
/// <param name="cmdlet">the executing cmdlet</param>
210+
/// <param name="parameterName">The name of the parameter to return</param>
211+
/// <returns>true if the parameter was provided by the user, otherwise false</returns>
212+
public static bool IsBound(this PSCmdlet cmdlet, string parameterName)
213+
{
214+
return cmdlet.MyInvocation.BoundParameters.ContainsKey(parameterName);
215+
}
216+
205217
public static string AsAbsoluteLocation(this string realtivePath)
206218
{
207219
return Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, realtivePath));

0 commit comments

Comments
 (0)