Skip to content

Commit 3fe9ec2

Browse files
authored
Merge pull request #5880 from markcowl/netcore-011a
Bring in latest fixes to NetCore branch
2 parents ad7ecc6 + abfaaf3 commit 3fe9ec2

File tree

548 files changed

+326008
-44498
lines changed

Some content is hidden

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

548 files changed

+326008
-44498
lines changed

Azure.PowerShell.Netcore.sln

Lines changed: 2 additions & 142 deletions
Large diffs are not rendered by default.

TestMappings.json

Lines changed: 3 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
],

build.proj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@
254254

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

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
}

src/Common/Commands.Common.Authentication/Common.Authentication.Netcore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</PropertyGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.8" />
25+
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.12" />
2626
<PackageReference Include="System.Collections.Specialized" Version="4.3.0" />
2727
<PackageReference Include="System.Reflection" Version="4.3.0" />
2828
<PackageReference Include="System.Security.SecureString" Version="4.3.0" />

src/Common/Commands.Common.Storage/Common.Storage.Netcore.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
<ItemGroup>
2525
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication" Version="2.2.12" />
26-
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="6.5.0-preview" />
27-
<PackageReference Include="WindowsAzure.Storage" Version="8.1.1" />
26+
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="7.1.0-preview" />
27+
<PackageReference Include="WindowsAzure.Storage" Version="9.0.0" />
2828
<PackageReference Include="System.Collections.NonGeneric" Version="4.3.0" />
2929
</ItemGroup>
3030

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

src/Common/Commands.Common/Utilities/Validate.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,6 @@ public static void ValidateInternetConnection()
209209
{
210210
throw new Exception(Resources.NoInternetConnection);
211211
}
212-
#else
213-
throw new NotSupportedException();
214212
#endif
215213
}
216214

src/ResourceManager/Aks/AzureRM.Aks.Netcore.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ PrivateData = @{
113113

114114
# External dependent modules of this module
115115
# ExternalModuleDependencies = ''
116-
Prerelease = 'preview'
116+
# Prerelease = ''
117117

118118
} # End of PSData hashtable
119119

0 commit comments

Comments
 (0)