Skip to content

Commit 0900c8e

Browse files
committed
Merge branch 'attestation-powershell-module-cmdlet' of https://github.com/shleiAmy/azure-powershell into attestation-powershell-module-cmdlet
2 parents 8916cc9 + 0e47b5d commit 0900c8e

File tree

1,931 files changed

+958339
-530872
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,931 files changed

+958339
-530872
lines changed

.azure-pipelines/util/analyze-steps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ steps:
1515
inputs:
1616
command: custom
1717
custom: msbuild
18-
arguments: 'build.proj /t:GenerateHelp /p:Configuration=${{ parameters.configuration }}'
18+
arguments: 'build.proj /t:GenerateHelp /p:Configuration=${{ parameters.configuration }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
1919

2020
- task: DotNetCoreCLI@2
2121
displayName: 'Static Analysis'
2222
inputs:
2323
command: custom
2424
custom: msbuild
25-
arguments: 'build.proj /t:StaticAnalysis /p:Configuration=${{ parameters.configuration }}'
25+
arguments: 'build.proj /t:StaticAnalysis /p:Configuration=${{ parameters.configuration }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
2626

2727
- template: publish-artifacts-steps.yml
2828
parameters:

.azure-pipelines/util/build-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ steps:
99
inputs:
1010
command: custom
1111
custom: msbuild
12-
arguments: 'build.proj /t:Build /p:Configuration=${{ parameters.configuration }};TestFramework=${{ parameters.testFramework }}'
12+
arguments: 'build.proj /t:Build /p:Configuration=${{ parameters.configuration }};TestFramework=${{ parameters.testFramework }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
1313

1414
- template: publish-artifacts-steps.yml
1515
parameters:

.azure-pipelines/util/test-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ steps:
1414
inputs:
1515
command: custom
1616
custom: msbuild
17-
arguments: 'build.proj /t:${{ parameters.testTarget }} /p:Configuration=${{ parameters.configuration }};TestFramework=${{ parameters.testFramework }}'
17+
arguments: 'build.proj /t:${{ parameters.testTarget }} /p:Configuration=${{ parameters.configuration }};TestFramework=${{ parameters.testFramework }};PullRequestNumber=$(System.PullRequest.PullRequestNumber)'
1818

1919
- template: publish-artifacts-steps.yml
2020
parameters:

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Feature request
33
about: Suggest a new feature or improvement
44
title: ''
5-
labels: Feature Request
5+
labels: Azure PS Team, Feature Request
66
assignees: ''
77

88
---

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,8 @@ Package
222222
launchSettings.json
223223
/src/StackAdmin/AzureRM/AzureRM.psm1
224224
/src/StackAdmin/AzureStack/AzureStack.psm1
225+
/CsprojMappings.json
225226
/ModuleMappings.json
226-
/SolutionMappings.json
227-
/TestMappings.json
228227
/tools/Modules/tmp
229228
/tools/Az/Az.psm1
230229
/Azure.PowerShell.sln

ChangeLog.md

Lines changed: 394 additions & 5 deletions
Large diffs are not rendered by default.

build.proj

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
<UsingTask Condition="$(OnPremiseBuild)" TaskName="CorporateValidation" AssemblyFile="$(CIToolsPath)/Microsoft.WindowsAzure.Tools.Build.Tasks.OnPremise.dll" />
8282
<Import Condition="$(OnPremiseBuild)" Project="$(CIToolsPath)/Microsoft.WindowsAzure.Build.OnPremise.msbuild" />
8383
<UsingTask TaskName="ESRPSignTask" AssemblyFile="$(CISignRepoPath)/tools/sdkbuildtools/tasks/MS.Az.Sdk.OnPremise.Build.Tasks.dll" />
84+
<UsingTask TaskName="FilesChangedTask" AssemblyFile="$(RepoArtifacts)Microsoft.Azure.Build.Tasks/Microsoft.Azure.Build.Tasks.dll" />
85+
<UsingTask TaskName="FilterTask" AssemblyFile="$(RepoArtifacts)Microsoft.Azure.Build.Tasks/Microsoft.Azure.Build.Tasks.dll" />
8486

8587
<Target Name="Clean">
8688
<Message Importance="high" Text="Cleaning Cmdlets..." />
@@ -93,9 +95,13 @@
9395
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(MSBuildThisFileDirectory) -Recurse -Include 'bin','obj','TestResults' | Remove-Item -Recurse -Force -ErrorAction Ignore&quot;" IgnoreExitCode="true" />
9496
</Target>
9597

96-
<Target Name="FilterBuild">
98+
<Target Name="FilterBuild" Condition="$(PullRequestNumber) != ''">
99+
<Message Importance="high" Text="Filtering projects and modules..." />
97100
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)/CreateFilterMappings.ps1&quot;" />
98101

102+
<!-- Build the Microsoft.Azure.Build.Tasks project -->
103+
<Exec Command="dotnet publish $(RepoTools)BuildPackagesTask/Microsoft.Azure.Build.Tasks/Microsoft.Azure.Build.Tasks.csproj -c $(Configuration) -f netstandard2.0" />
104+
99105
<!-- Get all of the files changed in the given pull request -->
100106
<FilesChangedTask RepositoryOwner="Azure" RepositoryName="azure-powershell" PullRequestNumber="$(PullRequestNumber)">
101107
<Output TaskParameter="FilesChanged" ItemName="FilesChanged" />
@@ -105,33 +111,23 @@
105111
<FilterTask FilesChanged="@(FilesChanged)" MapFilePath="./ModuleMappings.json">
106112
<Output TaskParameter="Output" ItemName="ModulesChanged" />
107113
</FilterTask>
108-
<Message Text="Filtering help generation and StaticAnalysis by the following modules:" />
109-
<Message Text="%(ModulesChanged.Identity)" />
110-
<Message Text="Total: @(ModulesChanged->Count())" />
111-
<Message Text="" />
112-
113-
<!-- Get the list of solutions to build -->
114-
<FilterTask FilesChanged="@(FilesChanged)" MapFilePath="./SolutionMappings.json">
115-
<Output TaskParameter="Output" ItemName="CmdletSolutionsToBuild" />
116-
</FilterTask>
117-
<Message Text="Filtering solutions to build by the following:" />
118-
<Message Text="%(CmdletSolutionsToBuild.Identity)" />
119-
<Message Text="Total: @(CmdletSolutionsToBuild->Count())" />
120-
<Message Text="" />
121-
122-
<!--Get the list of tests to be run based on files changed from a specified PullRequestNumber. Mapping between paths and test DLLs is used to produce the list.-->
123-
<FilterTask FilesChanged="@(FilesChanged)" MapFilePath="./TestMappings.json">
124-
<Output TaskParameter="Output" ItemName="XUnitTests" />
114+
<Message Importance="high" Text="Filtering help generation and StaticAnalysis by the following modules:" />
115+
<Message Importance="high" Text="%(ModulesChanged.Identity)" />
116+
<Message Importance="high" Text="Total: @(ModulesChanged->Count())" />
117+
<Message Importance="high" Text="" />
118+
119+
<!-- Get the list of projects to build -->
120+
<FilterTask FilesChanged="@(FilesChanged)" MapFilePath="./CsprojMappings.json">
121+
<Output TaskParameter="Output" ItemName="ProjectsToBuild" />
125122
</FilterTask>
126-
<Message Text="Using these test assemblies:" />
127-
<Message Text="%(XUnitTests.Identity)" />
128-
<Message Text="Total: @(XunitTests->Count())" />
129-
<Message Text="" />
123+
<Message Importance="high" Text="Filtering projects to build by the following:" />
124+
<Message Importance="high" Text="%(ProjectsToBuild.Identity)" />
125+
<Message Importance="high" Text="Total: @(ProjectsToBuild->Count())" />
126+
<Message Importance="high" Text="" />
130127
</Target>
131128

132129
<!-- Build all flavors of the Cmdlets -->
133-
<!-- TODO: Reimplement the FilterBuild and update RepoTasks to NetStandard -->
134-
<Target Name="Build">
130+
<Target Name="Build" DependsOnTargets="FilterBuild">
135131
<Message Importance="high" Text="Building Cmdlets..." />
136132

137133
<MakeDir Directories="$(RepoArtifacts)" />
@@ -142,13 +138,19 @@
142138
<!-- Build and create package content -->
143139
<Exec Command="dotnet --version" />
144140
<Exec Command="dotnet new sln -n Azure.PowerShell -o $(RepoArtifacts) --force" />
145-
<ItemGroup>
141+
<ItemGroup Condition="$(PullRequestNumber) == ''">
146142
<CsprojFiles Include="$(RepoRoot)src/**/*.csproj" Exclude="$(RepoRoot)src/**/*.Test.csproj;$(RepoRoot)src/**/Authenticators.csproj" />
147143
<CsprojFiles Include="$(RepoRoot)src/**/*.Test.csproj" Exclude="$(Net472TestExclude)" Condition="'$(Configuration)' != 'Release' and '$(TestsToRun)' == 'All'" />
148144
<CsprojFiles Include="$(RepoRoot)src/**/*.Test.csproj" Exclude="$(CoreTests)$(Net472TestExclude)" Condition="'$(Configuration)' != 'Release' and '$(TestsToRun)' == 'NonCore'" />
149145
<CsprojFiles Include="$(CoreTests)" Exclude="$(Net472TestExclude)" Condition="'$(Configuration)' != 'Release' and '$(TestsToRun)' == 'Core'" />
150146
<CsprojFiles Include="$(RepoRoot)src/**/Authenticators.csproj" Condition="'$([MSBuild]::IsOsPlatform(&quot;Windows&quot;))' == 'true' and '$(TestFramework)' != 'net472'" />
151147
</ItemGroup>
148+
<ItemGroup Condition="$(PullRequestNumber) != ''">
149+
<!-- Always build and test common code -->
150+
<CsprojFiles Include="$(LibraryRoot)src/Accounts/**/*.csproj;$(LibraryRoot)tools/TestFx/TestFx.csproj" Exclude="$(LibraryRoot)src/**/Authenticators.csproj" />
151+
<CsprojFiles Include="%(ProjectsToBuild.Identity)" />
152+
<CsprojFiles Include="$(LibraryRoot)src/**/Authenticators.csproj" Condition="'$([MSBuild]::IsOsPlatform(&quot;Windows&quot;))' == 'true'" />
153+
</ItemGroup>
152154
<!-- https://github.com/dotnet/cli/issues/6295#issuecomment-346973582 -->
153155
<Exec Command="dotnet sln $(RepoArtifacts)Azure.PowerShell.sln add &quot;%(CsprojFiles.FullPath)&quot;" />
154156
<PropertyGroup>
@@ -166,9 +168,9 @@
166168
<!-- Delete powershell runtime files -->
167169
<PropertyGroup>
168170
<RuntimeDllsIncludeList>Microsoft.Powershell.*.dll,System*.dll,Microsoft.VisualBasic.dll,Microsoft.CSharp.dll,Microsoft.CodeAnalysis.dll,Microsoft.CodeAnalysis.CSharp.dll</RuntimeDllsIncludeList>
169-
<RuntimeDllsExcludeList>System.Security.Cryptography.ProtectedData.dll,System.Configuration.ConfigurationManager.dll,System.Runtime.CompilerServices.Unsafe.dll,System.IO.FileSystem.AccessControl.dll,System.Buffers.dll,System.Text.Encodings.Web.dll,System.CodeDom.dll</RuntimeDllsExcludeList>
171+
<RuntimeDllsExcludeList>System.Security.Cryptography.ProtectedData.dll,System.Configuration.ConfigurationManager.dll,System.Runtime.CompilerServices.Unsafe.dll,System.IO.FileSystem.AccessControl.dll,System.Buffers.dll,System.Text.Encodings.Web.dll,System.CodeDom.dll,System.Management.dll</RuntimeDllsExcludeList>
170172
</PropertyGroup>
171-
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(RepoArtifacts)/$(Configuration) -Recurse -Include $(RuntimeDllsIncludeList) -Exclude $(RuntimeDllsExcludeList) | Remove-Item -Recurse -Force&quot;" />
173+
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(RepoArtifacts)/$(Configuration) -Recurse -Include $(RuntimeDllsIncludeList) -Exclude $(RuntimeDllsExcludeList) | Where-Object {$_.FullName -notlike '*PreloadAssemblies*' -and $_.FullName -notlike '*NetCoreAssemblies*'} | Remove-Item -Force&quot;" />
172174
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(RepoArtifacts)/$(Configuration) -Recurse -Include 'runtimes' | Remove-Item -Recurse -Force&quot;" Condition="'$(CodeSign)' == 'true'" />
173175

174176
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)/UpdateModules.ps1 -BuildConfig $(Configuration) -Scope $(Scope)&quot;" />
@@ -297,7 +299,7 @@ $(RepoArtifacts)/$(Configuration)/**/Microsoft.Azure.PowerShell.Authenticators.d
297299
<!-- RemoveCodeSignArtifacts.ps1 -->
298300
<Message Text="variables.Remove artifacts section" Importance="high" />
299301
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(RepoArtifacts) -Recurse -Include 'Signed','Unsigned' | Remove-Item -Recurse -Force -Confirm:$false -ErrorAction Ignore&quot;" IgnoreExitCode="true" />
300-
302+
301303
<!-- CheckSignature.ps1 -->
302304
<Message Text="variables.CheckSignature section" Importance="high" />
303305
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)/CheckSignature.ps1 -CustomPath $(RepoArtifacts)/$(Configuration)&quot;" Condition="'$(Scope)' != 'Stack'" />
@@ -326,4 +328,4 @@ $(RepoArtifacts)/$(Configuration)/**/Microsoft.Azure.PowerShell.Authenticators.d
326328
<SetEnvVar EnvName="SignedMsiDir" EnvValue="$(SignedOutputRootDir)" />
327329
</Target>
328330

329-
</Project>
331+
</Project>

documentation/migration-guides/Az.2.0.0-migration-guide.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,16 +251,33 @@ This document describes the changes between the 1.0.0 and 2.0.0 versions of Az
251251
```
252252

253253
### Az.HDInsight
254-
- Removed cmdlet `Grant-AzHDInsightHttpServicesAccess` and replaced with `Set-AzHDInsightGatewayCredential`
254+
- Removed the `Grant-AzHDInsightHttpServicesAccess` and `Revoke-AzHDInsightHttpServicesAccess` cmdlets. These are no longer necessary because HTTP access is always enabled on all HDInsight clusters.
255+
- Added a new `Set-AzHDInsightGatewayCredential` cmdlet. Use this cmdlet to change the gateway HTTP username and password (replaces `Grant-AzHDInsightHttpServicesAccess`).
256+
- Updated the `Get-AzHDInsightJobOutput` cmdlet to support granular role-based access to the storage key.
257+
- Users with HDInsight Cluster Operator, Contributor, or Owner roles will not be affected.
258+
- Users with only the Reader role will need to specify `DefaultStorageAccountKey` parameter explicitly.
259+
260+
For more information about these role-based access changes, see [aka.ms/hdi-config-update](http://aka.ms/hdi-config-update)
261+
255262
#### Before
256263
```powershell
257-
Grant-AzHDInsightHttpServicesAccess ...
264+
Grant-AzHDInsightHttpServicesAccess -ClusterName $cluster -HttpCredential $credential
265+
```
266+
#### After
267+
```powershell
268+
Set-AzHDInsightGatewayCredential -ClusterName $cluster -HttpCredential $credential
269+
```
270+
271+
### Users with only Reader role for cmdlet Get-AzHDInsightJobOutput
272+
273+
#### Before
274+
```powershell
275+
Get-AzHDInsightJobOutput -ClusterName $clusterName -JobId $jobId
258276
```
259277
#### After
260278
```powershell
261-
Set-AzHDInsightGatewayCredential ...
279+
Get-AzHDInsightJobOutput -ClusterName $clusterName -JobId $jobId -DefaultStorageAccountKey $storageAccountKey
262280
```
263-
- Removed cmdlet `Revoke-AzHDInsightHttpServicesAccess`
264281

265282
### Az.Storage
266283
- Namespaces for types returned from Blob, Queue, and File cmdlets have changed their namespace from `Microsoft.WindowsAzure.Storage` to `Microsoft.Azure.Storage`. While this is not technically a breaking change according to the breaking change policy, it may require some changes in code that uses the methods from the Storage .Net SDK to interact with the objects returned from these cmdlets.

documentation/troubleshoot-module-load.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,12 @@ If you see a version of Az.Accounts installed in the session, you can resolve th
156156

157157
Azure PowerShell is a set of binary modules, meaning that cmdlets are defined and implemented in .NET Standard code. PowerShell loads cmdlet assemblies into a single AppDomain, and these assemblies cannot be unloaded, even if the module is removed. Therefore, a module assembly and all its dependent assemblies remain loaded in the PowerShell session once it is imported until the PowerShell session is closed. Additionally, the types defined in a .NET Standard assembly are strongly tied to the assembly version, so that the types from version `A` and version `B` of the same assembly will appear as different types in the PowerShell session. When these types are used in common by multiple assemblies (as in the authentication types in Az.Accounts), then the types that are meant to be common are actually different for each module version. This causes problems when authentication information is instantiated using types from version `X` of Az.Accounts, but an assembly requires version `Y` of these types.
158158

159-
This underlying problem is solved in Az by requiring all authentication types used by the modules to be fully backward compatible.
159+
This underlying problem is solved in Az by requiring all authentication types used by the modules to be fully backward compatible.
160+
161+
### Newtonsoft.Json versions per PowerShell edition
162+
163+
The library `Newtonsoft.Json` is used throughout our cmdlets to handle JSON information. However, we do not have control of the version of this library that is loaded in PowerShell. To troubleshoot serialization issues, here is a table of the versions of `Newtonsoft.Json` that are loaded by the various editions of PowerShell.
164+
165+
| | Windows PowerShell 5.1 | PowerShell Core 6.0 | PowerShell Core 6.1 | PowerShell Core 6.2
166+
| - | - | - | - | - |
167+
| **Newtonsoft.Json** | 6.0.8 | 10.0.3 | 11.0.2 | 12.0.1

0 commit comments

Comments
 (0)