Skip to content

Commit c21a7ed

Browse files
committed
Merge branch 'main' of https://github.com/Azure/azure-powershell into release-2023-03-07-backup
2 parents 68d89c2 + d76630c commit c21a7ed

File tree

99 files changed

+4848
-1711
lines changed

Some content is hidden

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

99 files changed

+4848
-1711
lines changed

.azure-pipelines/SyncFromMainBranchConfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"src/lib",
77
"src/shared",
88
"build.proj",
9+
"src/Az.props",
910
"src/Az.Shared.props",
1011
"src/Az.Test.props",
1112
"src/Az.autorest.hybrid.props",

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ steps:
6767
displayName: 'Test for AutoGen Modules With PowerShell Core'
6868
condition: and(succeeded(), eq('${{ parameters.testTarget }}', 'Test'))
6969
continueOnError: true
70+
env:
71+
PowerShellPlatform: ${{ parameters.powerShellPlatform }}
7072

7173
- pwsh: |
7274
$PipelineResult = Get-Content PipelineResult.json | ConvertFrom-Json

build.proj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@
198198
<BuildAction Condition="'$(Configuration)' == 'Release'">publish</BuildAction>
199199
</PropertyGroup>
200200

201-
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;.\tools\ExecuteCIStep.ps1 -Build -RepoArtifacts $(RepoArtifacts) -Configuration $(Configuration) -GenerateDocumentationFile $(GenerateDocumentationFile) -EnableTestCoverage $(TurnOnTestCoverage) -BuildAction $(BuildAction)&quot;" />
201+
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;.\tools\ExecuteCIStep.ps1 -Build -RepoArtifacts $(RepoArtifacts) -Configuration $(Configuration) -GenerateDocumentationFile $(GenerateDocumentationFile) -EnableTestCoverage $(TurnOnTestCoverage) -BuildAction $(BuildAction)&quot;" Condition="$(PullRequestNumber) == ''"/>
202+
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;.\tools\ExecuteCIStep.ps1 -Build -PullRequestNumber $(PullRequestNumber) -RepoArtifacts $(RepoArtifacts) -Configuration $(Configuration) -GenerateDocumentationFile $(GenerateDocumentationFile) -EnableTestCoverage $(TurnOnTestCoverage) -BuildAction $(BuildAction)&quot;" Condition="$(PullRequestNumber) != ''"/>
202203

203204
<!-- Build version controller -->
204205
<Exec Command="dotnet build $(RepoTools)VersionController/VersionController.Netcore.csproj -c $(Configuration)" />

docker/Dockerfile-mariner-2-arm64

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
FROM mcr.microsoft.com/powershell:mariner-2.0-arm64
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 LATEST=
12+
ARG BLOB_URL=
13+
ARG IMAGE_NAME=mcr.microsoft.com/azure-powershell:${VERSION}-mariner-2.0
14+
15+
ENV AZUREPS_HOST_ENVIRONMENT="dockerImage/${VERSION}-mariner-2.0"
16+
17+
LABEL maintainer="Azure PowerShell Team <[email protected]>" \
18+
readme.md="http://aka.ms/azpsdockerreadme" \
19+
description="This Dockerfile will install the latest release of Azure PowerShell." \
20+
org.label-schema.build-date=${BUILD_DATE} \
21+
org.label-schema.usage="http://aka.ms/azpsdocker" \
22+
org.label-schema.url="http://aka.ms/azpsdockerreadme" \
23+
org.label-schema.vcs-url="https://github.com/Azure/azure-powershell" \
24+
org.label-schema.name="azure powershell" \
25+
org.label-schema.vendor="Azure PowerShell" \
26+
org.label-schema.version=${VERSION} \
27+
org.label-schema.schema-version="1.0" \
28+
org.label-schema.vcs-ref=${VCS_REF} \
29+
org.label-schema.docker.cmd="docker run --rm ${IMAGE_NAME} pwsh -c '\$PSVERSIONTABLE'" \
30+
org.label-schema.docker.cmd.devel="docker run -it --rm -e 'DebugPreference=Continue' ${IMAGE_NAME} pwsh" \
31+
org.label-schema.docker.cmd.test="currently not available" \
32+
org.label-schema.docker.cmd.help="docker run --rm ${IMAGE_NAME} pwsh -c Get-Help"
33+
34+
RUN if [ "${LATEST}" = True ] ; then \
35+
# install latest azure-powershell from BLOB
36+
pwsh -Command Invoke-WebRequest -uri ${BLOB_URL} -OutFile latest.tar.gz && \
37+
mkdir latest && \
38+
tdnf install -y tar gzip && \
39+
tdnf clean all && \
40+
tar -zxvf ./latest.tar.gz -C ./latest && \
41+
pwsh -Command ./latest/InstallModule.ps1 ;\
42+
else \
43+
# install old azure-powershell from PSGallery
44+
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Trusted && \
45+
pwsh -Command Install-Module -Name ${MODULE} -RequiredVersion ${VERSION} -Scope AllUsers -Repository ${REPOSITORY} && \
46+
pwsh -Command Set-PSRepository -Name ${REPOSITORY} -InstallationPolicy Untrusted ;\
47+
fi
48+
49+
# create AzureRmContextSettings.json before it was generated
50+
COPY ${CONFIG}/${AZURERM_CONTEXT_SETTINGS} ${AZURE}/${AZURERM_CONTEXT_SETTINGS}
51+
52+
CMD [ "pwsh" ]

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ The following prerequisites should be completed before contributing to the Azure
4747
- Install [Visual Studio 2019 or above](https://www.visualstudio.com/downloads/)
4848
- Install the latest version of [Git](https://git-scm.com/downloads)
4949
- Install the [`platyPS` module](help-generation.md#Installing-platyPS)
50+
- Install [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer#installation)
5051
- Install [**.NET Core 3.1, the Latest .NET, and .NET Framework Dev Pack 4.7.2**](https://dotnet.microsoft.com/en-us/download/dotnet) or greater
5152
- Install [PowerShell 7](https://github.com/PowerShell/PowerShell/releases/latest)
5253
- Set the PowerShell [execution policy](https://technet.microsoft.com/en-us/library/ee176961.aspx) to **Unrestricted** for the following versions of PowerShell:

src/Monitor/Monitor/Az.Monitor.psd1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ DotNetFrameworkVersion = '4.7.2'
5656
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.11.2'; })
5757

5858
# Assemblies that must be loaded prior to importing this module
59-
RequiredAssemblies = 'Microsoft.Azure.Management.Monitor.dll',
60-
'Microsoft.Azure.PowerShell.AutoMapper.dll',
59+
RequiredAssemblies = 'Microsoft.Azure.Management.Monitor.dll',
6160
'ActivityLogAlert.Autorest\bin\Az.ActivityLogAlert.private.dll',
6261
'DiagnosticSetting.Autorest\bin\Az.DiagnosticSetting.private.dll',
6362
'ScheduledQueryRule.Autorest\bin\Az.ScheduledQueryRule.private.dll',

src/Monitor/Monitor/Monitor.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="Microsoft.Azure.Management.Monitor" Version="0.28.0-preview" />
15-
<PackageReference Include="Microsoft.Azure.PowerShell.AutoMapper" Version="6.2.2" />
1615
</ItemGroup>
1716

1817
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.Post.props" />

src/Monitor/Monitor/OutputClasses/PSMonitorPrivateLinkScope.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System.Collections.Generic;
16+
using Microsoft.Azure.Management.Monitor.Models;
1617
using Newtonsoft.Json;
1718

1819
namespace Microsoft.Azure.Commands.Insights.OutputClasses
@@ -34,6 +35,19 @@ public PSMonitorPrivateLinkScope() { }
3435
this.ProvisioningState = provisioningState;
3536
}
3637

38+
internal static PSMonitorPrivateLinkScope ToPSMonitorPrivateLinkScope(AzureMonitorPrivateLinkScope scope)
39+
{
40+
return new PSMonitorPrivateLinkScope
41+
{
42+
Id = scope.Id,
43+
Name = scope.Name,
44+
Type = scope.Type,
45+
Location = scope.Location,
46+
Tags = scope.Tags,
47+
ProvisioningState = scope.ProvisioningState
48+
};
49+
}
50+
3751
/// <summary>
3852
/// Gets azure resource Id
3953
/// </summary>

src/Monitor/Monitor/OutputClasses/PSMonitorPrivateLinkScopedResource.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System.Collections.Generic;
16+
using System.Net.Mail;
17+
using Microsoft.Azure.Management.Monitor.Models;
1618
using Newtonsoft.Json;
1719

1820
namespace Microsoft.Azure.Commands.Insights.OutputClasses
@@ -57,5 +59,17 @@ public class PSMonitorPrivateLinkScopedResource
5759
/// </summary>
5860
[JsonProperty(PropertyName = "properties.provisioningState")]
5961
public string ProvisioningState { get; private set; }
62+
63+
internal static PSMonitorPrivateLinkScopedResource ToPSMonitorPrivateLinkScopedResource(ScopedResource scope)
64+
{
65+
return new PSMonitorPrivateLinkScopedResource
66+
{
67+
Id = scope.Id,
68+
Name = scope.Name,
69+
Type = scope.Type,
70+
LinkedResourceId = scope.LinkedResourceId,
71+
ProvisioningState = scope.ProvisioningState
72+
};
73+
}
6074
}
6175
}

src/Monitor/Monitor/PrivateLinkScopes/AzureInsightsPrivateLinkScopeCreateOrUpdateCmdletBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
1818
using Microsoft.Azure.Management.Monitor.Models;
1919
using Microsoft.WindowsAzure.Commands.Utilities.Common;
20-
using Microsoft.Azure.Commands.Insights.Utils;
2120
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
2221
using System.Collections.Generic;
2322
using System.Linq;

0 commit comments

Comments
 (0)