Skip to content

Commit 9b8f2fa

Browse files
authored
Merge pull request Azure#6257 from markcowl/oauth-preview
Update tools and versions for Storage preview release
2 parents b2caaff + 507b4df commit 9b8f2fa

File tree

8 files changed

+147
-13
lines changed

8 files changed

+147
-13
lines changed

src/ResourceManager/Storage/AzureRM.Storage.psd1

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#
1+
#
22
# Module manifest for module 'PSGet_AzureRM.Storage'
33
#
44
# Generated by: Microsoft Corporation
@@ -12,7 +12,7 @@
1212
# RootModule = ''
1313

1414
# Version number of this module.
15-
ModuleVersion = '5.0.1'
15+
ModuleVersion = '5.0.2'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
@@ -130,8 +130,19 @@ PrivateData = @{
130130
# IconUri = ''
131131

132132
# ReleaseNotes of this module
133-
ReleaseNotes = '* Query Storage Usage By Location
134-
- Get-AzureRmStorageUsage'
133+
134+
ReleaseNotes = '* Support Immutability Policy in AzureRm.Storage
135+
- Remove-AzureRmStorageAccountNetworkRule,
136+
- Get-AzureRmStorageContainer,
137+
- Update-AzureRmStorageContainer,
138+
- New-AzureRmStorageContainer,
139+
- Remove-AzureRmStorageContainer,
140+
- Add-AzureRmStorageContainerLegalHold,
141+
- Remove-AzureRmStorageContainerLegalHold,
142+
- Set-AzureRmStorageContainerImmutabilityPolicy,
143+
- Get-AzureRmStorageContainerImmutabilityPolicy,
144+
- Remove-AzureRmStorageContainerImmutabilityPolicy,
145+
- Lock-AzureRmStorageContainerImmutabilityPolicy'
135146

136147
# Prerelease string of this module
137148
Prerelease = 'preview'

src/ResourceManager/Storage/ChangeLog.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,18 @@
2020
## Current Release
2121

2222
## Version 5.0.2-preview
23-
* Support create Storage Context with OAuth.
24-
- The PR pending change:
25-
- Change to signed package
26-
- Use AuthenticationFactory in Powershell to replace ADAL reference.
23+
* Support Immutability Policy in AzureRm.Storage
24+
- Remove-AzureRmStorageAccountNetworkRule,
25+
- Get-AzureRmStorageContainer,
26+
- Update-AzureRmStorageContainer,
27+
- New-AzureRmStorageContainer,
28+
- Remove-AzureRmStorageContainer,
29+
- Add-AzureRmStorageContainerLegalHold,
30+
- Remove-AzureRmStorageContainerLegalHold,
31+
- Set-AzureRmStorageContainerImmutabilityPolicy,
32+
- Get-AzureRmStorageContainerImmutabilityPolicy,
33+
- Remove-AzureRmStorageContainerImmutabilityPolicy,
34+
- Lock-AzureRmStorageContainerImmutabilityPolicy
2735

2836
## Version 5.0.1-preview
2937
* Support get the Storage resource usage of a specific location

src/ResourceManager/Storage/Commands.Management.Storage/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@
4646
// You can specify all the values or you can default the Build and Revision Numbers
4747
// by using the '*' as shown below:
4848

49-
[assembly: AssemblyVersion("5.0.1")]
50-
[assembly: AssemblyFileVersion("5.0.1")]
49+
[assembly: AssemblyVersion("5.0.2")]
50+
[assembly: AssemblyFileVersion("5.0.2")]

src/ServiceManagement/Azure.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ CLRVersion = '4.0'
5151
# ProcessorArchitecture = ''
5252

5353
# Modules that must be imported into the global environment prior to importing this module
54-
#RequiredModules = ''
54+
RequiredModules = @(@{ModuleName = 'Azure.Storage'; ModuleVersion = '4.3.0'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
5757
# RequiredAssemblies = @()

src/Storage/Azure.Storage.psd1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ PrivateData = @{
158158
# IconUri = ''
159159

160160
# ReleaseNotes of this module
161+
161162
ReleaseNotes = '* Support creating Storage Context with OAuth credentials.'
162163

163164
# Prerelease string of this module

src/Storage/ChangeLog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
-->
2020
## Current Release
2121

22+
## Version 4.4.0
23+
* Support create Storage Context with OAuth.
24+
- The PR pending change:
25+
- Change to signed package
26+
- Use AuthenticationFactory in Powershell to replace ADAL reference.
27+
2228
## Version 4.3.0
2329
* Set minimum dependency of module to PowerShell 5.0
2430
* Support $web as Storage blob container name

tools/AzureRM/AzureRM.psd1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ CLRVersion = '4.0'
5151
# ProcessorArchitecture = ''
5252

5353
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; RequiredVersion = '5.0.0'; },
54+
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '5.0.0'; },
55+
@{ModuleName = 'Azure.Storage'; ModuleVersion = '4.3.0'; },
5556
@{ModuleName = 'AzureRM.AnalysisServices'; RequiredVersion = '0.6.7'; },
5657
@{ModuleName = 'Azure.AnalysisServices'; RequiredVersion = '0.5.1'; },
5758
@{ModuleName = 'AzureRM.ApiManagement'; RequiredVersion = '6.0.0'; },

tools/PublishModules.ps1

Lines changed: 108 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,106 @@ function Publish-RMModule
280280
}
281281
}
282282

283+
<#
284+
.SYNOPSIS
285+
Saves a module into the local temporary repository
286+
287+
.PARAMETER Module
288+
Module information.
289+
290+
.PARAMETER TempRepo
291+
Name of the local temporary repository
292+
293+
.PARAMETER TempRepoPath
294+
Path to the local temporary repository
295+
#>
296+
function Save-PackageLocally {
297+
[CmdletBinding()]
298+
param(
299+
$Module,
300+
[string]$TempRepo,
301+
[string]$TempRepoPath
302+
)
303+
304+
$ModuleName = $module['ModuleName']
305+
$RequiredVersion = $module['RequiredVersion']
306+
if ($RequiredVersion -eq $null)
307+
{
308+
$RequiredVersion = $module['ModuleVersion']
309+
}
310+
311+
# Only check for the modules that specifies = required exact dependency version
312+
if ($RequiredVersion -ne $null) {
313+
Write-Output "Checking for required module $ModuleName, $RequiredVersion"
314+
if (Find-Module -Name $ModuleName -RequiredVersion $RequiredVersion -Repository $TempRepo -ErrorAction SilentlyContinue) {
315+
Write-Output "Required dependency $ModuleName, $RequiredVersion found in the repo $TempRepo"
316+
} elseif ((Get-Module -ListAvailable -Name $ModuleName | Where-Object {$_.Version -eq $RequiredVersion}) -ne $null) {
317+
Write-Output "Required dependency $ModuleName, $RequiredVersion found in build modules"
318+
} else {
319+
Write-Warning "Required dependency $ModuleName, $RequiredVersion not found in the repo $TempRepo"
320+
Write-Output "Downloading the package from PsGallery to the path $TempRepoPath"
321+
# We try to download the package from the PsGallery as we are likely intending to use the existing version of the module.
322+
# If the module not found in psgallery, the following commnad would fail and hence publish to local repo process would fail as well
323+
Save-Package -Name $ModuleName -RequiredVersion $RequiredVersion -ProviderName Nuget -Path $TempRepoPath -Source https://www.powershellgallery.com/api/v2 | Out-Null
324+
Write-Output "Downloaded the package sucessfully"
325+
}
326+
}
327+
}
328+
329+
<#
330+
.SYNOPSIS
331+
Save the packages from PsGallery to local repo path
332+
This is typically used in a scenario where we are intending to use the existing publshed version of the module as a dependency
333+
Checks whether the module is already published in the local temp repo, if not downloads from the PSGallery
334+
This is used only for the rollup modules AzureRm or AzureStack at the moment
335+
336+
.PARAMETER ModulePaths
337+
List of paths to modules.
338+
339+
.PARAMETER TempRepo
340+
Name of local temporary repository.
341+
342+
.PARAMETER TempRepoPath
343+
path to local temporary repository.
344+
345+
#>
346+
function Save-PackagesFromPsGallery {
347+
[CmdletBinding()]
348+
param(
349+
[String[]]$ModulePaths,
350+
351+
[ValidateNotNullOrEmpty()]
352+
[String]$TempRepo,
353+
354+
[ValidateNotNullOrEmpty()]
355+
[String]$TempRepoPath
356+
)
357+
PROCESS {
358+
359+
Write-Output "Saving..."
360+
361+
foreach ($modulePath in $ModulePaths) {
362+
363+
Write-Output "module path $modulePath"
364+
365+
$module = (Get-Item -Path $modulePath).Name
366+
$moduleManifest = $module + ".psd1"
367+
368+
Write-Host "Verifying $module has all the dependencies in the repo $TempRepo"
369+
370+
$psDataFile = Import-PowershellDataFile (Join-Path $modulePath -ChildPath $moduleManifest)
371+
$RequiredModules = $psDataFile['RequiredModules']
372+
373+
if ($RequiredModules -ne $null) {
374+
foreach ($tmp in $RequiredModules) {
375+
foreach ($module in $tmp) {
376+
Save-PackageLocally -Module $module -TempRepo $TempRepo -TempRepoPath $TempRepoPath
377+
}
378+
}
379+
}
380+
}
381+
}
382+
}
283383

284384

285385
if ([string]::IsNullOrEmpty($buildConfig))
@@ -336,10 +436,17 @@ if ($repo -ne $null) {
336436
Register-PSRepository -Name $tempRepoName -SourceLocation $tempRepoPath -PublishLocation $tempRepoPath -InstallationPolicy Trusted -PackageManagementProvider NuGet
337437
}
338438

339-
$env:PSModulePath="$env:PSModulePath;$tempRepoPath"
439+
440+
441+
$sourceModulePath = "$packageFolder\ResourceManager\AzureResourceManager"
442+
443+
$sourceModulePath
444+
$env:PSModulePath="$env:PSModulePath;$tempRepoPath;$sourceModulePath"
445+
$env:PSModulePath
340446

341447
try {
342448
$modulesInScope = Get-TargetModules -buildConfig $buildConfig -Scope $scope -PublishLocal $publishToLocal -Profile $Profile
449+
Save-PackagesFromPsGallery -ModulePaths $modulesInScope -TempRepo $tempRepoName -TempRepoPath $tempRepoPath
343450
foreach ($modulePath in $modulesInScope) {
344451
# filter out AzureRM.Profile which always gets published first
345452
# And "Azure.Storage" which is built out as test dependencies

0 commit comments

Comments
 (0)