Skip to content

Commit 6e761f2

Browse files
committed
Merge branch 'release-2018-04-06' of github.com:/azure/azure-powershell into netcore-011a
2 parents bd1c6a1 + 221534c commit 6e761f2

File tree

133 files changed

+14105
-6965
lines changed

Some content is hidden

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

133 files changed

+14105
-6965
lines changed

build.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +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 &quot;" />
257+
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CheckAssemblies.ps1 -BuildConfig $(Configuration) &quot;" />
258258
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CleanupBuild.ps1 -BuildConfig $(Configuration) &quot;" />
259259
</Target>
260260

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/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/ResourceManager/Aks/AzureRM.Aks.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ 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
5757
RequiredAssemblies = '.\YamlDotNet.dll',

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/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>

0 commit comments

Comments
 (0)