Skip to content

Commit 33bf3f0

Browse files
authored
Merge pull request #17746 from Azure/main
[Do not squash] sync network branch with main
2 parents 2fc1680 + 0634860 commit 33bf3f0

File tree

18,534 files changed

+2765623
-998103
lines changed

Some content is hidden

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

18,534 files changed

+2765623
-998103
lines changed

.azure-pipelines/SyncFromMainBranchConfig.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
"tools",
44
".azure-pipelines",
55
"src/lib",
6-
"build.proj"
6+
"build.proj",
7+
"src/Az.Test.props",
8+
"src/Az.autorest.hybrid.props",
9+
"src/psm1.props"
710
],
811
"UnSyncPath": [
912
".azure-pipelines/SyncFromMainBranchConfig.json"
1013
]
11-
}
14+
}

.azure-pipelines/daily-build.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Please don't use ADO UI defined scheduled triggers because it takes precedence over YAML scheduled triggers.
22
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/scheduled-triggers
3+
variables:
4+
today: $(Get-Date -Format yyyyMMddhhmmss)
5+
36
schedules:
47
- cron: "0 18 * * *"
58
displayName: 2:00 AM (UTC + 8:00) China Daily Build
@@ -55,24 +58,11 @@ jobs:
5558
targetType: 'inline'
5659
script: |
5760
$command = "`$PSVersionTable `
58-
./tools/RunVersionController.ps1 -MonthName $(MonthName) -Year $(Year) `
61+
Get-PSRepository `
62+
./tools/RunVersionController.ps1 -Release 'Daily Build $(today)' `
5963
Exit"
6064
dotnet tool run pwsh -c $command
6165
62-
# - task: PowerShell@2
63-
# displayName: 'Push to Branch internal/dailybuild'
64-
# inputs:
65-
# targetType: 'inline'
66-
# script: |
67-
# git config user.email "[email protected]"
68-
# git config user.name "azuresdkci"
69-
# git remote set-url origin https://$(Token)@github.com/Azure/azure-powershell.git
70-
# git checkout -b internal/dailybuild
71-
# git add .
72-
# git commit -m "Bump Version"
73-
# git status
74-
# git push -u origin internal/dailybuild --force
75-
7666
- task: PowerShell@2
7767
displayName: 'Clean artifacts folder'
7868
inputs:

.azure-pipelines/powershell-core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ variables:
55
LinuxImage: ubuntu-20.04
66
MacOSName: macOS
77
MacOSImage: macOS-11
8-
TestFramework: netcoreapp2.1
8+
TestFramework: netcoreapp3.1
99
TestTarget: Test
1010
Configuration: Debug
1111
DebugLocalBuildTasks: true

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ steps:
2424
script: "$env:NODE_OPTIONS=\"--max-old-space-size=65536\""
2525
pwsh: true
2626

27-
- task: UseDotNet@2
28-
displayName: 'Use .NET Core sdk'
29-
inputs:
30-
packageType: sdk
31-
version: 2.1.x
32-
3327
- task: UseDotNet@2
3428
displayName: 'Use .NET Core sdk'
3529
inputs:

.azure-pipelines/windows-powershell.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
variables:
22
WindowsName: windows
33
WindowsImage: windows-2019
4-
TestFramework: netcoreapp2.1
4+
TestFramework: netcoreapp3.1
55
TestTarget: Test
66
Configuration: Debug
77
DebugLocalBuildTasks: true

ChangeLog.md

Lines changed: 388 additions & 0 deletions
Large diffs are not rendered by default.

build.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
<!-- Delete powershell runtime files -->
200200
<PropertyGroup>
201201
<RuntimeDllsIncludeList>Microsoft.Powershell.*.dll,System*.dll,Microsoft.VisualBasic.dll,Microsoft.CSharp.dll,Microsoft.CodeAnalysis.dll,Microsoft.CodeAnalysis.CSharp.dll</RuntimeDllsIncludeList>
202-
<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,System.Text.Json.dll,System.Threading.Tasks.Extensions.dll</RuntimeDllsExcludeList>
202+
<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,System.Text.Json.dll,System.Threading.Tasks.Extensions.dll,System.IO.Hashing.dll</RuntimeDllsExcludeList>
203203
</PropertyGroup>
204204
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(RepoArtifacts)/$(Configuration) -Recurse -Include $(RuntimeDllsIncludeList) -Exclude $(RuntimeDllsExcludeList) | Where-Object {$_.FullName -notlike '*PreloadAssemblies*' -and $_.FullName -notlike '*NetCoreAssemblies*' -and $_.FullName -notlike '*AzSharedAlcAssemblies*' -and $_.FullName -notlike '*ModuleAlcAssemblies*'} | Remove-Item -Force&quot;"/>
205205
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;Get-ChildItem -Path $(RepoArtifacts)/$(Configuration) -Recurse -Include 'runtimes' | Remove-Item -Recurse -Force&quot;" Condition="'$(CodeSign)' == 'true'" />
@@ -316,7 +316,7 @@
316316
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(DockerTools)/CleanArtifacts.ps1 -Docker $(DockerRoot) &quot;" />
317317
</Target>
318318

319-
<Target Name="Test" DependsOnTargets="FilterBuild">
319+
<Target Name="Test" DependsOnTargets="FilterBuild" Condition="'$(IsGenerateBased)' == 'false'">
320320
<Message Importance="high" Text="Running check in tests..." />
321321
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
322322
<!-- https://github.com/Microsoft/msbuild/issues/3157#issuecomment-378002971 -->

docker/Dockerfile-alpine-3.14

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
FROM mcr.microsoft.com/powershell:alpine-3.14
2+
3+
ARG REPOSITORY=PSGallery
4+
ARG MODULE=Az
5+
ARG CONFIG=config
6+
ARG AZURERM_CONTEXT_SETTINGS=AzureRmContextSettings.json
7+
ARG AZURE=/root/.Azure
8+
ARG VCS_REF="none"
9+
ARG BUILD_DATE=
10+
ARG VERSION=
11+
ARG IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-alpine-3.14
12+
13+
ENV AZUREPS_HOST_ENVIRONMENT="dockerImage/${VERSION}-alpine-3.14"
14+
15+
LABEL maintainer="Azure PowerShell Team <[email protected]>" \
16+
readme.md="http://aka.ms/azpsdockerreadme" \
17+
description="This Dockerfile will install the latest release of Azure PowerShell." \
18+
org.label-schema.build-date=${BUILD_DATE} \
19+
org.label-schema.usage="http://aka.ms/azpsdocker" \
20+
org.label-schema.url="http://aka.ms/azpsdockerreadme" \
21+
org.label-schema.vcs-url="https://github.com/Azure/azure-powershell" \
22+
org.label-schema.name="azure powershell" \
23+
org.label-schema.vendor="Azure PowerShell" \
24+
org.label-schema.version=${VERSION} \
25+
org.label-schema.schema-version="1.0" \
26+
org.label-schema.vcs-ref=${VCS_REF} \
27+
org.label-schema.docker.cmd="docker run --rm ${IMAGE_NAME} pwsh -c '\$PSVERSIONTABLE'" \
28+
org.label-schema.docker.cmd.devel="docker run -it --rm -e 'DebugPreference=Continue' ${IMAGE_NAME} pwsh" \
29+
org.label-schema.docker.cmd.test="currently not available" \
30+
org.label-schema.docker.cmd.help="docker run --rm ${IMAGE_NAME} pwsh -c Get-Help"
31+
32+
# install azure-powershell from PSGallery
33+
RUN pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \
34+
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \
35+
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted
36+
37+
# create AzureRmContextSettings.json before it was generated
38+
COPY ${CONFIG}/${AZURERM_CONTEXT_SETTINGS} ${AZURE}/${AZURERM_CONTEXT_SETTINGS}
39+
40+
CMD [ "pwsh" ]

docker/Dockerfile-ubuntu-20.04

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
FROM mcr.microsoft.com/powershell:ubuntu-20.04
2+
3+
ARG REPOSITORY=PSGallery
4+
ARG MODULE=Az
5+
ARG CONFIG=config
6+
ARG AZURERM_CONTEXT_SETTINGS=AzureRmContextSettings.json
7+
ARG AZURE=/root/.Azure
8+
ARG VCS_REF="none"
9+
ARG BUILD_DATE=
10+
ARG VERSION=
11+
ARG IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-ubuntu-20.04
12+
13+
ENV AZUREPS_HOST_ENVIRONMENT="dockerImage/${VERSION}-ubuntu-20.04"
14+
15+
LABEL maintainer="Azure PowerShell Team <[email protected]>" \
16+
readme.md="http://aka.ms/azpsdockerreadme" \
17+
description="This Dockerfile will install the latest release of Azure PowerShell." \
18+
org.label-schema.build-date=${BUILD_DATE} \
19+
org.label-schema.usage="http://aka.ms/azpsdocker" \
20+
org.label-schema.url="http://aka.ms/azpsdockerreadme" \
21+
org.label-schema.vcs-url="https://github.com/Azure/azure-powershell" \
22+
org.label-schema.name="azure powershell" \
23+
org.label-schema.vendor="Azure PowerShell" \
24+
org.label-schema.version=${VERSION} \
25+
org.label-schema.schema-version="1.0" \
26+
org.label-schema.vcs-ref=${VCS_REF} \
27+
org.label-schema.docker.cmd="docker run --rm ${IMAGE_NAME} pwsh -c '\$PSVERSIONTABLE'" \
28+
org.label-schema.docker.cmd.devel="docker run -it --rm -e 'DebugPreference=Continue' ${IMAGE_NAME} pwsh" \
29+
org.label-schema.docker.cmd.test="currently not available" \
30+
org.label-schema.docker.cmd.help="docker run --rm ${IMAGE_NAME} pwsh -c Get-Help"
31+
32+
# install azure-powershell from PSGallery
33+
RUN pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \
34+
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \
35+
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted
36+
37+
# create AzureRmContextSettings.json before it was generated
38+
COPY ${CONFIG}/${AZURERM_CONTEXT_SETTINGS} ${AZURE}/${AZURERM_CONTEXT_SETTINGS}
39+
40+
CMD [ "pwsh" ]

docker/README.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,14 @@ Azure PowerShell [release notes](https://docs.microsoft.com/en-us/powershell/azu
2929
docker pull mcr.microsoft.com/azure-powershell
3030
```
3131

32-
### Run azure-powershell container
32+
### Run azure-powershell container
3333

3434
- To run azure-powershell using a container in an interactive mode:
3535

3636
```sh
3737
$ docker run -it mcr.microsoft.com/azure-powershell pwsh
3838
```
3939

40-
- To run azure-powershell from using a container in an interactive mode using host authentication:
41-
42-
1- Make sure that `$HOME/.Azure` is present on the host (default location)
43-
2- You may need to grant access this location for the docker process.
44-
45-
```sh
46-
$ docker run -it -v ~/.Azure/AzureRmContext.json:/root/.Azure/AzureRmContext.json -v ~/.Azure/TokenCache.dat:/root/.Azure/TokenCache.dat mcr.microsoft.com/azure-powershell pwsh
47-
```
48-
49-
Verify the host authentication:
50-
51-
```sh
52-
docker run -it --rm -v ~/.Azure/AzureRmContext.json:/root/.Azure/AzureRmContext.json -v ~/.Azure/TokenCache.dat:/root/.Azure/TokenCache.dat mcr.microsoft.com/azure-powershell pwsh -c Get-AzContext
53-
```
54-
5540
### Building image
5641

5742
Clone the azure-powershell repo, and in your local copy run the following commands:

0 commit comments

Comments
 (0)