Skip to content

Commit 576e87d

Browse files
authored
Merge branch 'preview' into OnlyNewMetrics
2 parents bc616cf + d34458c commit 576e87d

File tree

253 files changed

+41452
-15232
lines changed

Some content is hidden

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

253 files changed

+41452
-15232
lines changed

AzurePowershell.Test.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
<XUnitTests Include=".\src\ResourceManager\Billing\Commands.Billing.Test\bin\Debug\Microsoft.Azure.Commands.Billing.Test.dll"/>
7575
<XUnitTests Include=".\src\ResourceManager\Cdn\Commands.Cdn.Test\bin\Debug\Microsoft.Azure.Commands.Cdn.Test.ScenarioTests.dll"/>
7676
<XUnitTests Include=".\src\ResourceManager\CognitiveServices\CognitiveServices.Test\bin\Debug\Microsoft.Azure.Commands.Management.CognitiveServices.Test.dll"/>
77+
<XUnitTests Include=".\src\ResourceManager\ContainerRegistry\Commands.ContainerRegistry.Test\bin\Debug\Microsoft.Azure.Commands.ContainerRegistry.Test.dll"/>
7778
<XUnitTests Include=".\src\ResourceManager\Compute\Commands.Compute.Test\bin\Debug\Microsoft.Azure.Commands.Compute.Test.dll"/>
7879
<XUnitTests Include=".\src\ResourceManager\DataFactories\Commands.DataFactories.Test\bin\Debug\Microsoft.Azure.Commands.DataFactories.Test.dll"/>
7980
<XUnitTests Include=".\src\ResourceManager\DataLakeAnalytics\Commands.DataLakeAnalytics.Test\bin\Debug\Microsoft.Azure.Commands.DataLakeAnalytics.Test.dll"/>

build.proj

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
'AzureStorage': storage data plane cmdlets
2525
'Subfolder under src\ResourceManager': An individual cmdlet module
2626
By default, it builds all
27+
28+
/p:SkipHelp=True
29+
Skips help generation and installer creation, mainly for local builds to save time.
2730
-->
2831

2932
<!-- Define build properties -->
@@ -44,6 +47,7 @@
4447
<BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
4548
<NuGetPublishingSource Condition=" '$(NuGetPublishingSource)' == '' ">http://psget/PSGallery/api/v2/</NuGetPublishingSource>
4649
<Scope Condition=" $(Scope) == '' " >all</Scope>
50+
<SkipHelp Condition =" '$(SkipHelp)' == '' ">false</SkipHelp>
4751
</PropertyGroup>
4852
<ItemGroup>
4953
<CmdletSolutionsToBuild Include=".\src\Storage\Storage.sln;.\src\ResourceManager\**\*.sln;.\src\ServiceManagement\ServiceManagement.sln;"
@@ -186,15 +190,17 @@
186190
BuildInParallel="$(BuildInParallel)"
187191
ContinueOnError="false" />
188192

189-
<Exec Command="$(PowerShellCommand) -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\GenerateHelp.ps1 -ValidateMarkdownHelp -GenerateMamlHelp -BuildConfig $(Configuration) &quot;" ContinueOnError="false"/>
193+
<Exec Command="$(PowerShellCommand) -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\GenerateHelp.ps1 -ValidateMarkdownHelp -GenerateMamlHelp -BuildConfig $(Configuration) &quot;"
194+
ContinueOnError="false"
195+
Condition=" '$(SkipHelp)' == 'false' "/>
190196
<CallTarget Targets="BuildSetupTest"/>
191197
<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
192-
<CallTarget Targets="BuildSetup"/>
198+
<CallTarget Targets="BuildSetup" Condition=" '$(SkipHelp)' == 'false' "/>
193199
<CallTarget Targets="CodeSignInstaller"
194200
Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'" />
195201
<Message Importance="high" Text="Running Static Analyser" />
196-
<CallTarget targets="DependencyAnalysis" />
197-
<Exec Command="$(PowerShellCommand) -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CleanupBuild.ps1 -BuildConfig $(Configuration) &quot;"/>
202+
<CallTarget targets="DependencyAnalysis" ContinueOnError="ErrorAndContinue" />
203+
<Exec Command="$(PowerShellCommand) -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CleanupBuild.ps1 -BuildConfig $(Configuration) &quot;" />
198204
</Target>
199205

200206
<!-- Do everything possible -->

setup/azurecmdfiles.wxi

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

src/ResourceManager/Compute/ChangeLog.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!--
1+
<!--
22
Please leave this section at the top of the change log.
33
44
Changes for the current release should go under the section titled "Current Release", and should adhere to the following format:
@@ -19,6 +19,8 @@
1919
-->
2020
## Current Release
2121

22+
* Backup encryption settings for IaaS VMs and restore on failure
23+
2224
## Version 2.9.0
2325

2426
* Fix bug in Get-* cmdlets, to allow retrieving multiple pages of data (more than 120 items)

src/ResourceManager/Compute/Commands.Compute/Extension/AzureDiskEncryption/SetAzureDiskEncryptionExtension.cs

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,14 @@ private AzureOperationResponse<VirtualMachine> UpdateVmEncryptionSettings()
282282
null));
283283
}
284284

285+
DiskEncryptionSettings encryptionSettingsBackup = vmParameters.StorageProfile.OsDisk.EncryptionSettings;
286+
287+
if (encryptionSettingsBackup == null)
288+
{
289+
encryptionSettingsBackup = new DiskEncryptionSettings();
290+
encryptionSettingsBackup.Enabled = false;
291+
}
292+
285293
DiskEncryptionSettings encryptionSettings = new DiskEncryptionSettings();
286294
encryptionSettings.Enabled = true;
287295
encryptionSettings.DiskEncryptionKey = new KeyVaultSecretReference();
@@ -306,10 +314,25 @@ private AzureOperationResponse<VirtualMachine> UpdateVmEncryptionSettings()
306314
Location = vmParameters.Location,
307315
Tags = vmParameters.Tags
308316
};
309-
return this.ComputeClient.ComputeManagementClient.VirtualMachines.CreateOrUpdateWithHttpMessagesAsync(
317+
318+
AzureOperationResponse<VirtualMachine> updateResult = this.ComputeClient.ComputeManagementClient.VirtualMachines.CreateOrUpdateWithHttpMessagesAsync(
310319
this.ResourceGroupName,
311320
vmParameters.Name,
312321
parameters).GetAwaiter().GetResult();
322+
323+
if(!updateResult.Response.IsSuccessStatusCode)
324+
{
325+
vmParameters = (this.ComputeClient.ComputeManagementClient.VirtualMachines.Get(
326+
this.ResourceGroupName, this.VMName));
327+
vmParameters.StorageProfile.OsDisk.EncryptionSettings = encryptionSettingsBackup;
328+
329+
this.ComputeClient.ComputeManagementClient.VirtualMachines.CreateOrUpdateWithHttpMessagesAsync(
330+
this.ResourceGroupName,
331+
vmParameters.Name,
332+
parameters).GetAwaiter().GetResult();
333+
}
334+
335+
return updateResult;
313336
}
314337

315338
private Hashtable GetExtensionPublicSettings()
@@ -444,12 +467,23 @@ public override void ExecuteCmdlet()
444467

445468
VirtualMachineExtension parameters = GetVmExtensionParameters(virtualMachineResponse);
446469

447-
this.VirtualMachineExtensionClient.CreateOrUpdateWithHttpMessagesAsync(
470+
AzureOperationResponse<VirtualMachineExtension> extensionPushResult = this.VirtualMachineExtensionClient.CreateOrUpdateWithHttpMessagesAsync(
448471
this.ResourceGroupName,
449472
this.VMName,
450473
this.Name,
451474
parameters).GetAwaiter().GetResult();
452475

476+
if (!extensionPushResult.Response.IsSuccessStatusCode)
477+
{
478+
ThrowTerminatingError(new ErrorRecord(new ApplicationException(string.Format(CultureInfo.CurrentUICulture,
479+
"Installation failed for extension {0} with error {1}",
480+
parameters.VirtualMachineExtensionType,
481+
extensionPushResult.Response.Content.ReadAsStringAsync().GetAwaiter().GetResult())),
482+
"InvalidResult",
483+
ErrorCategory.InvalidResult,
484+
null));
485+
}
486+
453487
var op = UpdateVmEncryptionSettings();
454488
var result = Mapper.Map<PSAzureOperationResponse>(op);
455489
WriteObject(result);
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
#
2+
# Module manifest for module 'PSGet_AzureRM.ContainerRegistry'
3+
#
4+
# Generated by: Microsoft Corporation
5+
#
6+
# Generated on: 3/8/2017
7+
#
8+
9+
@{
10+
11+
# Script module or binary module file associated with this manifest.
12+
# RootModule = ''
13+
14+
# Version number of this module.
15+
ModuleVersion = '0.1.0'
16+
17+
# Supported PSEditions
18+
# CompatiblePSEditions = @()
19+
20+
# ID used to uniquely identify this module
21+
GUID = 'B3CA459C-FEB9-41CC-A954-46222505ACB3'
22+
23+
# Author of this module
24+
Author = 'Microsoft Corporation'
25+
26+
# Company or vendor of this module
27+
CompanyName = 'Microsoft Corporation'
28+
29+
# Copyright statement for this module
30+
Copyright = 'Microsoft Corporation. All rights reserved.'
31+
32+
# Description of the functionality provided by this module
33+
Description = 'Microsoft Azure PowerShell - ContainerRegistry service cmdlets for Azure Resource Manager'
34+
35+
# Minimum version of the Windows PowerShell engine required by this module
36+
PowerShellVersion = '3.0'
37+
38+
# Name of the Windows PowerShell host required by this module
39+
# PowerShellHostName = ''
40+
41+
# Minimum version of the Windows PowerShell host required by this module
42+
# PowerShellHostVersion = ''
43+
44+
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45+
DotNetFrameworkVersion = '4.0'
46+
47+
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48+
CLRVersion = '4.0'
49+
50+
# Processor architecture (None, X86, Amd64) required by this module
51+
# ProcessorArchitecture = ''
52+
53+
# Modules that must be imported into the global environment prior to importing this module
54+
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '2.8.0'; })
55+
56+
# Assemblies that must be loaded prior to importing this module
57+
# RequiredAssemblies = @()
58+
59+
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60+
# ScriptsToProcess = @()
61+
62+
# Type files (.ps1xml) to be loaded when importing this module
63+
# TypesToProcess = @()
64+
65+
# Format files (.ps1xml) to be loaded when importing this module
66+
FormatsToProcess = '.\Microsoft.Azure.Commands.ContainerRegistry.format.ps1xml'
67+
68+
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69+
NestedModules = @('.\Microsoft.Azure.Commands.ContainerRegistry.dll')
70+
71+
# Functions 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 functions to export.
72+
FunctionsToExport = @()
73+
74+
# 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.
75+
CmdletsToExport = 'New-AzureRmContainerRegistry',
76+
'Get-AzureRmContainerRegistry',
77+
'Update-AzureRmContainerRegistry',
78+
'Remove-AzureRmContainerRegistry',
79+
'Get-AzureRmContainerRegistryCredential',
80+
'Update-AzureRmContainerRegistryCredential',
81+
'Test-AzureRmContainerRegistryNameAvailability'
82+
83+
# Variables to export from this module
84+
# VariablesToExport = @()
85+
86+
# Aliases 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 aliases to export.
87+
AliasesToExport = @()
88+
89+
# DSC resources to export from this module
90+
# DscResourcesToExport = @()
91+
92+
# List of all modules packaged with this module
93+
# ModuleList = @()
94+
95+
# List of all files packaged with this module
96+
# FileList = @()
97+
98+
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
99+
PrivateData = @{
100+
101+
PSData = @{
102+
103+
# Tags applied to this module. These help with module discovery in online galleries.
104+
Tags = 'Azure','ResourceManager','ARM','Registry','ContainerRegistry'
105+
106+
# A URL to the license for this module.
107+
LicenseUri = 'https://raw.githubusercontent.com/Azure/azure-powershell/dev/LICENSE.txt'
108+
109+
# A URL to the main website for this project.
110+
ProjectUri = 'https://github.com/Azure/azure-powershell'
111+
112+
# A URL to an icon representing this module.
113+
# IconUri = ''
114+
115+
# ReleaseNotes of this module
116+
ReleaseNotes = 'Updated for common code changes'
117+
118+
# External dependent modules of this module
119+
# ExternalModuleDependencies = ''
120+
121+
} # End of PSData hashtable
122+
123+
} # End of PrivateData hashtable
124+
125+
# HelpInfo URI of this module
126+
# HelpInfoURI = ''
127+
128+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
129+
# DefaultCommandPrefix = ''
130+
131+
}
132+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!--
2+
Please leave this section at the top of the change log.
3+
4+
Changes for the current release should go under the section titled "Current Release", and should adhere to the following format:
5+
6+
## Current Release
7+
* Overview of change #1
8+
- Additional information about change #1
9+
* Overview of change #2
10+
- Additional information about change #2
11+
- Additional information about change #2
12+
* Overview of change #3
13+
* Overview of change #4
14+
- Additional information about change #4
15+
16+
## YYYY.MM.DD - Version X.Y.Z (Previous Release)
17+
* Overview of change #1
18+
- Additional information about change #1
19+
-->
20+
## Current Release
21+
* Add PowerShell cmdlets for Azure Container Registry
22+
- New-AzureRmContainerRegistry
23+
- Get-AzureRmContainerRegistry
24+
- Update-AzureRmContainerRegistry
25+
- Remove-AzureRmContainerRegistry
26+
- Get-AzureRmContainerRegistryCredential
27+
- Update-AzureRmContainerRegistryCredential
28+
- Test-AzureRmContainerRegistryNameAvailability

0 commit comments

Comments
 (0)