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

src/ResourceManager/Aks/AzureRM.Aks.psd1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ CLRVersion = '4.0'
5151
# ProcessorArchitecture = ''
5252

5353
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '4.1.1'; })
54+
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '4.5.0'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
57-
RequiredAssemblies = '.\YamlDotNet.dll',
58-
'.\Microsoft.Azure.Commands.Common.Graph.RBAC.dll',
59-
'.\AutoMapper.dll'
57+
RequiredAssemblies = '.\YamlDotNet.dll',
58+
'.\Microsoft.Azure.Commands.Common.Graph.RBAC.dll',
59+
'.\AutoMapper.dll', '.\System.Management.Automation.dll'
6060

6161
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
6262
# ScriptsToProcess = @()

src/ResourceManager/Aks/NuGet.Config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<config>
4+
<add key="repositorypath" value="..\..\packages" />
5+
</config>
6+
</configuration>

src/ResourceManager/AnalysisServices/Commands.AnalysisServices.Dataplane/Commands.AnalysisServices.Dataplane.Netcore.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
</PropertyGroup>
2929

3030
<ItemGroup>
31-
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.10" />
32-
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.10" />
31+
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.11" />
32+
<PackageReference Include="Microsoft.Rest.ClientRuntime.Azure" Version="3.3.12" />
3333
<PackageReference Include="Microsoft.WindowsAzure.Management" Version="4.1.1" />
3434
</ItemGroup>
3535

src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands.ApiManagement.ServiceManagement.Netcore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</PropertyGroup>
2929

3030
<ItemGroup>
31-
<PackageReference Include="AutoMapper" Version="6.0.2" />
31+
<PackageReference Include="AutoMapper" Version="6.2.2" />
3232
<PackageReference Include="Microsoft.Azure.Management.ApiManagement" Version="3.4.0-preview" />
3333
</ItemGroup>
3434

src/ResourceManager/ApiManagement/Commands.ApiManagement/Commands.ApiManagement.Netcore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</PropertyGroup>
2929

3030
<ItemGroup>
31-
<PackageReference Include="AutoMapper" Version="6.0.2" />
31+
<PackageReference Include="AutoMapper" Version="6.2.2" />
3232
<PackageReference Include="Microsoft.Azure.Management.ApiManagement" Version="3.4.0-preview" />
3333
</ItemGroup>
3434

src/ResourceManager/CognitiveServices/AzureRM.CognitiveServices.Netcore.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ FunctionsToExport = @()
7474
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
7575
CmdletsToExport = 'Get-AzureRmCognitiveServicesAccount',
7676
'Get-AzureRmCognitiveServicesAccountKey',
77-
'Get-AzureRmCognitiveServicesAccountSkus',
77+
'Get-AzureRmCognitiveServicesAccountSkus',
78+
'Get-AzureRmCognitiveServicesAccountUsage',
7879
'New-AzureRmCognitiveServicesAccount',
7980
'New-AzureRmCognitiveServicesAccountKey',
8081
'Remove-AzureRmCognitiveServicesAccount',

src/ResourceManager/CognitiveServices/AzureRM.CognitiveServices.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ FunctionsToExport = @()
7575
CmdletsToExport = 'Get-AzureRmCognitiveServicesAccount',
7676
'Get-AzureRmCognitiveServicesAccountKey',
7777
'Get-AzureRmCognitiveServicesAccountSkus',
78+
'Get-AzureRmCognitiveServicesAccountUsage',
7879
'New-AzureRmCognitiveServicesAccount',
7980
'New-AzureRmCognitiveServicesAccountKey',
8081
'Remove-AzureRmCognitiveServicesAccount',
81-
'Set-AzureRmCognitiveServicesAccount'
82+
'Set-AzureRmCognitiveServicesAccount'
8283

8384
# Variables to export from this module
8485
# VariablesToExport = @()

src/ResourceManager/CognitiveServices/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
-->
2020
## Current Release
2121
* Updated to the latest version of the Azure ClientRuntime
22+
* Integrate with Cognitive Services Management SDK version 4.0.0.
23+
* Add Get-AzureRmCognitiveServicesAccountUsage operation.
2224

2325
## Version 0.9.3
2426
* Fix issue with Default Resource Group in CloudShell

src/ResourceManager/CognitiveServices/CognitiveServices.Test/Commands.Management.CognitiveServices.Test.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
<Reference Include="Microsoft.Azure.Management.Authorization">
5252
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.1.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
5353
</Reference>
54-
<Reference Include="Microsoft.Azure.Management.CognitiveServices, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
55-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.CognitiveServices.3.0.0\lib\net452\Microsoft.Azure.Management.CognitiveServices.dll</HintPath>
54+
<Reference Include="Microsoft.Azure.Management.CognitiveServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
55+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.CognitiveServices.4.0.0\lib\net452\Microsoft.Azure.Management.CognitiveServices.dll</HintPath>
5656
</Reference>
5757
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
5858
<SpecificVersion>False</SpecificVersion>
@@ -169,6 +169,9 @@
169169
<None Include="SessionRecords\CognitiveServices.Test.ScenarioTests.CognitiveServicesAccountTests\TestGetAccounts.json">
170170
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
171171
</None>
172+
<None Include="SessionRecords\CognitiveServices.Test.ScenarioTests.CognitiveServicesAccountTests\TestGetUsages.json">
173+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
174+
</None>
172175
<None Include="SessionRecords\CognitiveServices.Test.ScenarioTests.CognitiveServicesAccountTests\TestGetWithPaging.json">
173176
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
174177
</None>

src/ResourceManager/CognitiveServices/CognitiveServices.Test/ScenarioTests/CognitiveServicesAccountTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,12 @@ public void TestGetWithPaging()
125125
{
126126
TestController.NewInstance.RunPsTest("Test-GetWithPaging");
127127
}
128+
129+
[Fact]
130+
[Trait(Category.AcceptanceType, Category.CheckIn)]
131+
public void TestGetUsages()
132+
{
133+
TestController.NewInstance.RunPsTest("Test-GetUsages");
134+
}
128135
}
129136
}

0 commit comments

Comments
 (0)