Skip to content

Update Az.Functions module (#13260) #13281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
106 changes: 56 additions & 50 deletions src/Functions/Az.Functions.format.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
<TableColumnHeader>
<Label>HostingEnvironmentName</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Id1</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>ImmutabilityPolicyName</Label>
</TableColumnHeader>
Expand Down Expand Up @@ -234,6 +237,9 @@
<TableColumnItem>
<PropertyName>HostingEnvironmentName</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Id1</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>ImmutabilityPolicyName</PropertyName>
</TableColumnItem>
Expand Down Expand Up @@ -542,9 +548,9 @@
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.BlobServiceProperties1</Name>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.BlobServicePropertiesAutoGenerated</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.BlobServiceProperties1</TypeName>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.BlobServicePropertiesAutoGenerated</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
Expand Down Expand Up @@ -852,9 +858,9 @@
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.Dimension</Name>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.DimensionAutoGenerated</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.Dimension</TypeName>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.DimensionAutoGenerated</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
Expand Down Expand Up @@ -1538,9 +1544,9 @@
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.MetricSpecification</Name>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.MetricSpecificationAutoGenerated</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.MetricSpecification</TypeName>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.MetricSpecificationAutoGenerated</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
Expand Down Expand Up @@ -1630,9 +1636,9 @@
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.Operation</Name>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.OperationAutoGenerated</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.Operation</TypeName>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.OperationAutoGenerated</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
Expand Down Expand Up @@ -2430,9 +2436,9 @@
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.Usage</Name>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.UsageAutoGenerated</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.Usage</TypeName>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20190401.UsageAutoGenerated</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
Expand Down Expand Up @@ -2560,9 +2566,9 @@
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20181130.Identity</Name>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20181130.IdentityAutoGenerated</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20181130.Identity</TypeName>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20181130.IdentityAutoGenerated</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
Expand Down Expand Up @@ -2650,9 +2656,9 @@
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20181130.Operation</Name>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20181130.OperationAutoGenerated2</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20181130.Operation</TypeName>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20181130.OperationAutoGenerated2</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
Expand All @@ -2672,9 +2678,9 @@
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20181130.OperationDisplay</Name>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20181130.OperationDisplayAutoGenerated</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20181130.OperationDisplay</TypeName>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20181130.OperationDisplayAutoGenerated</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
Expand Down Expand Up @@ -2712,9 +2718,9 @@
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20181130.OperationListResult</Name>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20181130.OperationListResultAutoGenerated</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20181130.OperationListResult</TypeName>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20181130.OperationListResultAutoGenerated</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
Expand Down Expand Up @@ -3138,9 +3144,9 @@
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20150501.ComponentPurgeBodyFilters1</Name>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20150501.ComponentPurgeBodyFilters</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20150501.ComponentPurgeBodyFilters1</TypeName>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api20150501.ComponentPurgeBodyFilters</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
Expand Down Expand Up @@ -3362,9 +3368,9 @@
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api10.Resource</Name>
<Name>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api10.ResourceAutoGenerated</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api10.Resource</TypeName>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.Functions.Models.Api10.ResourceAutoGenerated</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
Expand Down Expand Up @@ -8270,10 +8276,10 @@
<Label>DisplayName</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Name</Label>
<Label>InternalName</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>InternalName</Label>
<Label>Name</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>ToBeExportedForShoebox</Label>
Expand All @@ -8286,10 +8292,10 @@
<PropertyName>DisplayName</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Name</PropertyName>
<PropertyName>InternalName</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>InternalName</PropertyName>
<PropertyName>Name</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>ToBeExportedForShoebox</PropertyName>
Expand Down Expand Up @@ -13411,32 +13417,32 @@
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>Name</Label>
<Label>Kind</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Type</Label>
<Label>Location</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Kind</Label>
<Label>Name</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Location</Label>
<Label>Type</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>Name</PropertyName>
<PropertyName>Kind</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Type</PropertyName>
<PropertyName>Location</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Kind</PropertyName>
<PropertyName>Name</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Location</PropertyName>
<PropertyName>Type</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
Expand Down Expand Up @@ -13647,26 +13653,14 @@
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>PrimaryAggregationType</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>ResourceUri</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Unit</Label>
<Label>Item</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>PrimaryAggregationType</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>ResourceUri</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Unit</PropertyName>
<PropertyName>Item</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
Expand All @@ -13681,14 +13675,26 @@
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>Item</Label>
<Label>PrimaryAggregationType</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>ResourceUri</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Unit</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>Item</PropertyName>
<PropertyName>PrimaryAggregationType</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>ResourceUri</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Unit</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
Expand Down
17 changes: 8 additions & 9 deletions src/Functions/Az.Functions.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: Microsoft Corporation
#
# Generated on: 9/15/2020
# Generated on: 10/19/2020
#

@{
Expand All @@ -12,7 +12,7 @@
RootModule = './Az.Functions.psm1'

# Version number of this module.
ModuleVersion = '1.0.2'
ModuleVersion = '2.0.0'

# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
Expand Down Expand Up @@ -47,7 +47,7 @@ PowerShellVersion = '5.1'
DotNetFrameworkVersion = '4.7.2'

# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# CLRVersion = ''
# ClrVersion = ''

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''
Expand All @@ -56,16 +56,16 @@ DotNetFrameworkVersion = '4.7.2'
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '1.9.5'; })

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = './bin/Az.Functions.private.dll'
RequiredAssemblies = 'bin\Az.Functions.private.dll'

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
ScriptsToProcess = './custom/HelperFunctions.ps1'
ScriptsToProcess = 'custom\HelperFunctions.ps1'

# Type files (.ps1xml) to be loaded when importing this module
TypesToProcess = './custom/Functions.types.ps1xml'
TypesToProcess = 'custom\Functions.types.ps1xml'

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = './Az.Functions.format.ps1xml', './custom/Functions.format.ps1xml'
FormatsToProcess = 'Az.Functions.format.ps1xml', 'custom\Functions.format.ps1xml'

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()
Expand Down Expand Up @@ -115,8 +115,7 @@ PrivateData = @{
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '* Removed the ability to create v2 Functions in regions that do not support it.
* Deprecated PowerShell 6.2. Added a warning for when a user creates a PowerShell 6.2 function app that advises them to create a PowerShell 7.0 function app instead.'
ReleaseNotes = 'Implemented Functions Stacks API which describes what runtimes and runtime versions are available for function app creation'

# Prerelease string of this module
# Prerelease = ''
Expand Down
10 changes: 5 additions & 5 deletions src/Functions/Az.Functions.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
}
}
if(-not $accountsModule) {
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'1.7.4' } | Measure-Object).Count -gt 0
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'1.8.1' } | Measure-Object).Count -gt 0
if($hasAdequateVersion) {
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 1.7.4 -Scope Global -PassThru
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 1.8.1 -Scope Global -PassThru
}
}
}

if(-not $accountsModule) {
Write-Error "`nThis module requires $accountsName version 1.7.4 or greater. For installation instructions, please see: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps" -ErrorAction Stop
} elseif (($accountsModule.Version -lt [System.Version]'1.7.4') -and (-not $localAccounts)) {
Write-Error "`nThis module requires $accountsName version 1.7.4 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to remove '.PSSharedModules' in your home directory. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
Write-Error "`nThis module requires $accountsName version 1.8.1 or greater. For installation instructions, please see: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps" -ErrorAction Stop
} elseif (($accountsModule.Version -lt [System.Version]'1.8.1') -and (-not $localAccounts)) {
Write-Error "`nThis module requires $accountsName version 1.8.1 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to remove '.PSSharedModules' in your home directory. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
}
Write-Information "Loaded Module '$($accountsModule.Name)'"

Expand Down
4 changes: 4 additions & 0 deletions src/Functions/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
-->
## Upcoming Release

## Version 2.0.0
* Implemented Functions Stacks API which describes what runtimes and runtime versions are available for function app creation
* Bug fixing

## Version 1.0.2
* Removed the ability to create v2 Functions in regions that do not support it.
* Deprecated PowerShell 6.2. Added a warning for when a user creates a PowerShell 6.2 function app that advises them to create a PowerShell 7.0 function app instead.
Expand Down
2 changes: 1 addition & 1 deletion src/Functions/check-dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if(Test-Path -Path $localModulesPath) {
$env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
}

DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '1.7.4'
DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '1.8.1'
DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'

$tools = Join-Path $PSScriptRoot 'tools'
Expand Down
Loading