manifests/collectors/Web/FunctionApps.psd1

#
# GENERATED by scripts/Build-ScoutServiceCollector.ps1 from manifests/specs/service-collectors.psd1 (AB#6741).
# Authored as data -- there is no source collector script to drift from. Edit the spec and
# regenerate; do not hand-patch this file.
#
@{
    ResourceTypes = @(
        'microsoft.web/sites'
    )

    ResourceTypeMatching = 'Grouped'

    AdditionalFilter = '$_.KIND -like ''*functionapp*'''

    FilterPreamble = ''

    RowLoopVariable = '1'

    Preamble = @'
$ResUCount = 1
                $sub1 = $SUB | Where-Object { $_.id -eq $1.subscriptionId }
                $data = $1.PROPERTIES
                $Retired = $Retirements | Where-Object { $_.id -eq $1.id }
                if ($Retired)
                    {
                        $RetiredFeature = foreach ($Retire in $Retired)
                            {
                                $RetiredServiceID = $Unsupported | Where-Object {$_.Id -eq $Retired.ServiceID}
                                $tmp0 = [pscustomobject]@{
                                        'RetiredFeature' = $RetiredServiceID.RetiringFeature
                                        'RetiredDate' = $RetiredServiceID.RetirementDate
                                    }
                                $tmp0
                            }
                        $RetiringFeature = if (@($RetiredFeature.RetiredFeature).count -gt 1) { $RetiredFeature.RetiredFeature | ForEach-Object { $_ + ' ,' } }else { $RetiredFeature.RetiredFeature}
                        $RetiringFeature = [string]$RetiringFeature
                        $RetiringFeature = if ($RetiringFeature -like '* ,*') { $RetiringFeature -replace ".$" }else { $RetiringFeature }

                        $RetiringDate = if (@($RetiredFeature.RetiredDate).count -gt 1) { $RetiredFeature.RetiredDate | ForEach-Object { $_ + ' ,' } }else { $RetiredFeature.RetiredDate}
                        $RetiringDate = [string]$RetiringDate
                        $RetiringDate = if ($RetiringDate -like '* ,*') { $RetiringDate -replace ".$" }else { $RetiringDate }
                    }
                else
                    {
                        $RetiringFeature = $null
                        $RetiringDate = $null
                    }
                $ServerFarm = if(![string]::IsNullOrEmpty($data.serverFarmId)){Get-AZSCIdSegment -Id $data.serverFarmId -Index 8}else{$null}
                $OutboundSubnet = if(![string]::IsNullOrEmpty($data.virtualNetworkSubnetId)){Get-AZSCIdSegment -Id $data.virtualNetworkSubnetId -Index 10}else{$null}
                $Tags = if(![string]::IsNullOrEmpty($1.tags.psobject.properties)){$1.tags.psobject.properties}else{'0'}
'@


    AdditionalRowLoops = @()

    TagLoop = @{
        Variable = 'Tag'
        Source = '$Tags'
        Preamble = ''
    }

    Fields = @(
        @{
            Name = 'ID'
            Expression = '$1.id'
        }
        @{
            Name = 'Subscription'
            Expression = '$sub1.Name'
        }
        @{
            Name = 'Resource Group'
            Expression = '$1.RESOURCEGROUP'
        }
        @{
            Name = 'Name'
            Expression = '$1.NAME'
        }
        @{
            Name = 'Location'
            Expression = '$1.LOCATION'
        }
        @{
            Name = 'Kind'
            Expression = '$1.KIND'
        }
        @{
            Name = 'State'
            Expression = '$data.state'
        }
        @{
            Name = 'Default Hostname'
            Expression = '$data.defaultHostName'
        }
        @{
            Name = 'App Service Plan'
            Expression = '$ServerFarm'
        }
        @{
            Name = 'HTTPS Only'
            Expression = '[string]$data.httpsOnly'
        }
        @{
            Name = 'Client Cert Enabled'
            Expression = '[string]$data.clientCertEnabled'
        }
        @{
            Name = 'Public Network Access'
            Expression = '$data.publicNetworkAccess'
        }
        @{
            Name = 'Outbound Subnet'
            Expression = '$OutboundSubnet'
        }
        @{
            Name = 'Identity Type'
            Expression = '$1.identity.type'
        }
        @{
            Name = 'Retiring Feature'
            Expression = '$RetiringFeature'
        }
        @{
            Name = 'Retiring Date'
            Expression = '$RetiringDate'
        }
        @{
            Name = 'Resource U'
            Expression = '$ResUCount'
        }
        @{
            Name = 'Tag Name'
            Expression = '[string]$Tag.Name'
        }
        @{
            Name = 'Tag Value'
            Expression = '[string]$Tag.Value'
        }
    )

    Export = @{
        WorksheetName = 'Function Apps'
        TableNamePrefix = 'FunctionAppsTable_'
        Columns = @(
            'Subscription'
            'Resource Group'
            'Name'
            'Location'
            'Kind'
            'State'
            'Default Hostname'
            'App Service Plan'
            'HTTPS Only'
            'Client Cert Enabled'
            'Public Network Access'
            'Outbound Subnet'
            'Identity Type'
            'Retiring Feature'
            'Retiring Date'
            'Resource U'
        )
        TagColumns = @(
            'Tag Name'
            'Tag Value'
        )
        TagColumnsBefore = 'Resource U'
        NumberFormat = '0'
        ConditionalText = @()
    }
}