Skip to content

Commit d8fbe9f

Browse files
committed
merge upstream preview
2 parents c1da1ba + 507f671 commit d8fbe9f

File tree

1,131 files changed

+72355
-76405
lines changed

Some content is hidden

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

1,131 files changed

+72355
-76405
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ after_success:
2727
docker build . -t $DOCKER_USER/$NAME:$TRAVIS_COMMIT --build-arg CONFIG=$CONFIG;
2828
docker tag $DOCKER_USER/$NAME:$TRAVIS_COMMIT $DOCKER_USER/$NAME:$TRAVIS_BRANCH;
2929

30-
docker login -u $DOCKER_USER -p $DOCKER_PASS;
30+
echo "$DOCKER_PASS" | docker login -u $DOCKER_USER --password-stdin;
3131

3232
docker push $DOCKER_USER/$NAME:$TRAVIS_COMMIT;
3333
docker push $DOCKER_USER/$NAME:$TRAVIS_BRANCH;

Azure.PowerShell.Netcore.sln

Lines changed: 1 addition & 155 deletions
Large diffs are not rendered by default.

ChangeLog.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,59 @@
1-
## 5.6.0 - March 2018
1+
## 5.7.0 - April 2018
2+
3+
#### General
4+
* Updated to the latest version of the Azure ClientRuntime
5+
6+
#### Azure.Storage
7+
* Fix the issue that upload Blob and upload File cmdlets fail on FIPS policy enabled machines
8+
- Set-AzureStorageBlobContent
9+
- Set-AzureStorageFileContent
10+
11+
#### AzureRM.Billing
12+
* New Cmdlet Get-AzureRmEnrollmentAccount
13+
- cmdlet to retrieve enrollment accounts
14+
15+
#### AzureRM.CognitiveServices
16+
* Integrate with Cognitive Services Management SDK version 4.0.0.
17+
* Add Get-AzureRmCognitiveServicesAccountUsage operation.
18+
19+
#### AzureRM.Compute
20+
* `Get-AzureRmVmssDiskEncryptionStatus` supports encryption status at data disk level
21+
* `Get-AzureRmVmssVmDiskEncryptionStatus` supports encryption status at data disk level
22+
* Update for Zone Resilient
23+
* 'New-AzureRmVm' and 'New-AzureRmVmss' (simple parameter set) support availability zones.
24+
25+
#### AzureRM.ContainerRegistry
26+
* Decouple reliance on Commands.Resources.Rest and ARM/Storage SDKs.
27+
28+
#### AzureRM.DataLakeStore
29+
* Add debug functionality
30+
* Update the version of the ADLS dataplane SDK to 1.1.2
31+
* Export-AzureRmDataLakeStoreItem - Deprecated parameters PerFileThreadCount, ConcurrentFileCount and introduced parameter Concurrency
32+
* Import-AzureRMDataLakeStoreItem - Deprecated parametersPerFileThreadCount, ConcurrentFileCount and introduced parameter Concurrency
33+
* Get-AzureRMDataLakeStoreItemContent - Fixed the tail behavior for contents greater than 4MB
34+
* Set-AzureRMDataLakeStoreItemExpiry - Introduced new parameter set SetRelativeExpiry for setting relative expiration time
35+
* Remove-AzureRmDataLakeStoreItem - Deprecated parameter Clean.
36+
37+
#### AzureRM.EventHub
38+
* Fixed AlternameName in New-AzureRmEventHubGeoDRConfiguration
39+
40+
#### AzureRM.KeyVault
41+
* Updated cmdlets to include piping scenarios
42+
* Add deprecation messages for upcoming breaking change release
43+
44+
#### AzureRM.Network
45+
* Fix error message with Network cmdlets
46+
47+
#### AzureRM.ServiceBus
48+
* Added 'properties' in CorrelationFilter of Rules to support customproperties
49+
* updated New-AzureRmServiceBusGeoDRConfiguration help and fixed Rules cmdlet output
50+
* Fixed auto-forward properties in New-AzureRmServiceBusQueue and New-AzureRmServiceBusSubscription cmdlet
51+
52+
#### AzureRM.Sql
53+
* Add new cmdlet 'Stop-AzureRmSqlElasticPoolActivity' to support canceling the asynchronous operations on elastic pool
54+
* Update the response for cmdlets Get-AzureRmSqlDatabaseActivity and Get-AzureRmSqlElasticPoolActivity to reflect more information in the response
55+
56+
## 5.6.0 - March 2018
257

358
#### General
459
* Fix issue with Default Resource Group in CloudShell

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ To install the module containing the legacy RDFE cmdlets, run the following comm
3838
Install-Module -Name Azure
3939
```
4040

41-
If you have an earlier version of the Azure PowerShell modules installed from the PowerShell Gallery and would like to update to the latest version, run the following commands in an elevated PowerShell session:
41+
If you have an earlier version of the Azure PowerShell modules installed from the PowerShell Gallery and would like to update to the latest version, run the following commands in an elevated PowerShell session. Update-Module installs the new version side-by-side with the old version. It does not remove the old version.
4242

4343
```powershell
4444
# Update to the latest version of AzureRM

TestMappings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@
127127
"src/ResourceManager/OperationalInsights/": [
128128
".\\src\\ResourceManager\\OperationalInsights\\Commands.OperationalInsights.Test\\bin\\Debug\\Microsoft.Azure.Commands.OperationalInsights.Test.dll"
129129
],
130+
"src/ResourceManager/PolicyInsights/": [
131+
".\\src\\ResourceManager\\PolicyInsights\\Commands.PolicyInsights.Test\\bin\\Debug\\Microsoft.Azure.Commands.PolicyInsights.Test.dll"
132+
],
130133
"src/ResourceManager/PowerBIEmbedded/": [
131134
".\\src\\ResourceManager\\PowerBIEmbedded\\Commands.PowerBIEmbedded.Test\\bin\\Debug\\Microsoft.Azure.Commands.PowerBIEmbedded.Test.dll"
132135
],

build.proj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<NetCore Condition=" $(NetCore) == '' " >false</NetCore>
5454
<SkipHelp Condition =" '$(SkipHelp)' == '' ">false</SkipHelp>
5555
<BuildTasksPath>$(LibraryToolsFolder)\BuildPackagesTask\Microsoft.Azure.Build.Tasks\bin\$(Configuration)</BuildTasksPath>
56-
<Stack Condition = "'$(Scope)' == '' or '$(Scope)' == 'all' or '$(Scope)' == 'Stack' ">true</Stack>
56+
<Stack Condition = "(('$(Scope)' == '' or '$(Scope)' == 'all') and '$(NetCore)' == 'false') or '$(Scope)' == 'Stack' ">true</Stack>
5757
<Latest Condition = "'$(Scope)' == '' or '$(Scope)' != 'Stack'">true</Latest>
5858
</PropertyGroup>
5959
<ItemGroup>
@@ -71,7 +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" />
74+
<LocalBuildTasks Include="$(LibraryToolsFolder)\RepoTasks\RepoTasks.sln" Condition="'$(NetCore)' == 'false'"/>
7575
</ItemGroup>
7676

7777
<!-- Tasks -->
@@ -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

@@ -417,7 +417,7 @@
417417
Condition="!$(DelaySign) and '@(ScriptsToSign)' != ''"/>
418418

419419
<Exec Command="&quot;$(PowerShellCommand)&quot; -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CheckSignature.ps1 -CustomPath $(LibrarySourceFolder)\Package\$(Configuration) &quot;"
420-
ContinueOnError="ErrorAndContinue" />
420+
ContinueOnError="ErrorAndContinue" Condition="'$(NetCore)' == 'false'"/>
421421

422422
<!-- Copying signed shortcut back -->
423423
<Copy SourceFiles="$(LibrarySourceFolder)\Package\$(Configuration)\AzureRM.Netcore.psd1"

documentation/azure-powershell-modules.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Below is a table of modules containing ARM cmdlets found in the [`AzureRM`](http
4949
| Network | `AzureRM.Network` | [![Network](https://img.shields.io/powershellgallery/v/AzureRM.Network.svg?style=flat-square&label=AzureRM.Network)](https://www.powershellgallery.com/packages/AzureRM.Network/) |
5050
| Notification Hubs | `AzureRM.NotificationHubs` | [![Notification Hubs](https://img.shields.io/powershellgallery/v/AzureRM.NotificationHubs.svg?style=flat-square&label=AzureRM.NotificationHubs)](https://www.powershellgallery.com/packages/AzureRM.NotificationHubs/) |
5151
| Operational Insights | `AzureRM.OperationalInsights` | [![Operational Insights](https://img.shields.io/powershellgallery/v/AzureRM.OperationalInsights.svg?style=flat-square&label=AzureRM.OperationalInsights)](https://www.powershellgallery.com/packages/AzureRM.OperationalInsights/) |
52+
| Policy Insights | `AzureRM.PolicyInsights` | [![Policy Insights](https://img.shields.io/powershellgallery/v/AzureRM.PolicyInsights.svg?style=flat-square&label=AzureRM.PolicyInsights)](https://www.powershellgallery.com/packages/AzureRM.PolicyInsights/) |
5253
| Power BI Embedded | `AzureRM.PowerBIEmbedded` | [![Power BI Embedded](https://img.shields.io/powershellgallery/v/AzureRM.PowerBIEmbedded.svg?style=flat-square&label=AzureRM.PowerBIEmbedded)](https://www.powershellgallery.com/packages/AzureRM.PowerBIEmbedded/) |
5354
| Profile | `AzureRM.Profile` | [![Profile](https://img.shields.io/powershellgallery/v/AzureRM.Profile.svg?style=flat-square&label=AzureRM.Profile)](https://www.powershellgallery.com/packages/AzureRM.Profile/) |
5455
| Recovery Services | `AzureRM.RecoveryServices` | [![Recovery Services](https://img.shields.io/powershellgallery/v/AzureRM.RecoveryServices.svg?style=flat-square&label=AzureRM.RecoveryServices)](https://www.powershellgallery.com/packages/AzureRM.RecoveryServices/) |

documentation/development-docs/azure-powershell-developer-guide.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ The Azure PowerShell Developer Guide was created to help with the development an
2828
- [Enable Running PowerShell when Debugging](#enable-running-powershell-when-debugging)
2929
- [Importing Modules](#importing-modules)
3030
- [Adding Help Content](#adding-help-content)
31-
- [Updating the Installer](#updating-the-installer)
3231
- [Adding Tests](#adding-tests)
3332
- [Using Azure TestFramework](#using-azure-testframework)
3433
- [Scenario Tests](#scenario-tests)
@@ -55,7 +54,7 @@ The following prerequisites should be completed before contributing to the Azure
5554
- Install the latest version of [Git](https://git-scm.com/downloads)
5655
- Install the latest version of [WiX](http://wixtoolset.org/releases/)
5756
- After installation, ensure that the path to "WiX Toolset\bin" has been added to your `PATH` environment variable
58-
- Install the [`platyPS` module](https://github.com/Azure/azure-powershell/blob/preview/documentation/help-generation.md#installing-platyps)
57+
- Install the [`platyPS` module](https://github.com/Azure/azure-powershell/blob/preview/documentation/development-docs/help-generation.md#installing-platyps)
5958
- Set the PowerShell [execution policy](https://technet.microsoft.com/en-us/library/ee176961.aspx) to **Unrestricted** for the following versions of PowerShell:
6059
- `C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe`
6160
- `C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe`
@@ -256,23 +255,6 @@ Each cmdlet has a markdown file that contains the help content that is displayed
256255

257256
For complete documentation, see [`help-generation.md`](./help-generation.md) in the `documentation` folder.
258257

259-
## Updating the Installer
260-
261-
The installer should be updated whenever a library dependency is added/removed from your project module, or file paths are changed.
262-
263-
To regenerate the install wxi file, follow these steps:
264-
265-
- Ensure that the WiX tools bin folder is in your `PATH` environment variable
266-
- Set the `AzurePSRoot` environment variable to the path of your locally cloned Azure PowerShell repository
267-
- `set AzurePSRoot=C:\<PATH_TO_REPO>\azure-powershell`
268-
- Build the cmdlets
269-
- Follow the steps mentioned in [building the environment](#building-the-environment)
270-
- This builds both the cmdlets and the installer - if your changes have removed or renamed files previously contained in the installer, the installer build may fail. In this case, you can ignore installer build failures
271-
- Generate the new wxi file using the `generate.ps1` script
272-
- `powershell .\tools\installer\generate.ps1 <BUILD_CONFIG>`
273-
- `<BUILD_CONFIG>` is `DEBUG` or `RELEASE`, depending on which build configuration you are using
274-
- Verify that the changes look correct uses `git diff`. Often times, unintended changes happen if your repository is not clean; if this occurs, revert the changes made to the wxi file, commit all other changes, and use `git clean -xdf` to wipe out all untracked files from your local git repository
275-
276258
# Adding Tests
277259

278260
_Note_: As mentioned in the prerequisites section, set the PowerShell [execution policy](https://technet.microsoft.com/en-us/library/ee176961.aspx) to **Unrestricted** for the following versions of PowerShell:
@@ -391,7 +373,7 @@ Once all of your cmdlets have been created and the appropriate tests have been a
391373
## Publish to PowerShell Gallery
392374

393375
- To publish your module to the [official PowerShell gallery](http://www.powershellgallery.com/), or the test gallery site, contact the Azure PowerShell team
394-
- To create a signed module package for local usage, use the [powershell-sign](http://azuresdkci.cloudapp.net/view/1-AzurePowerShell/job/powershell-sign/) job on Jenkins
376+
- To create a signed module package for local usage, use the [ps-sign](https://azuresdkci.westus2.cloudapp.azure.com/job/ps-sign/) job on Jenkins
395377

396378
## AsJob Parameter
397379

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.Graph.RBAC/ActiveDirectory/ActiveDirectoryClient.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,18 @@ public void RemoveAllSpCredentials(string spObjectId)
689689
PatchSpPasswordCredentials(spObjectId, passwordCredentials: null);
690690
}
691691

692+
public string GetObjectIdFromUPN(string upn)
693+
{
694+
var odataQueryFilter = new Rest.Azure.OData.ODataQuery<User>(s => s.UserPrincipalName == upn);
695+
var user = GraphClient.Users.List(odataQueryFilter.ToString()).SingleOrDefault();
696+
if (user == null)
697+
{
698+
throw new InvalidOperationException(String.Format(ProjectResources.UserWithUPNDoesntExist, upn));
699+
}
700+
701+
return user.ObjectId;
702+
}
703+
692704
public string GetObjectIdFromSPN(string spn)
693705
{
694706
var odataQueryFilter = new Rest.Azure.OData.ODataQuery<ServicePrincipal>(s => s.ServicePrincipalNames.Contains(spn));

src/Common/Commands.Common.Graph.RBAC/Properties/Resources.Designer.cs

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

src/Common/Commands.Common.Graph.RBAC/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,7 @@
144144
<data name="ServicePrincipalWithSPNDoesntExist" xml:space="preserve">
145145
<value>Service principal with SPN '{0}' does not exist.</value>
146146
</data>
147+
<data name="UserWithUPNDoesntExist" xml:space="preserve">
148+
<value>User with UPN '{0}' does not exist.</value>
149+
</data>
147150
</root>

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/AzurePowerShell.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public class AzurePowerShell
2626

2727
public const string AssemblyCopyright = "Copyright © Microsoft";
2828

29-
public const string AssemblyVersion = "5.6.0";
29+
public const string AssemblyVersion = "5.7.0";
3030

31-
public const string AssemblyFileVersion = "5.6.0";
31+
public const string AssemblyFileVersion = "5.7.0";
3232

3333
public const string ProfileFile = "AzureProfile.json";
3434

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

0 commit comments

Comments
 (0)