manifests/collectors/Containers/ContainerAppJobs.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.app/jobs'
    )

    ResourceTypeMatching = 'Grouped'

    AdditionalFilter = $null

    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
                    }
                $EnvironmentName = if(![string]::IsNullOrEmpty($data.environmentId)){Get-AZSCIdSegment -Id $data.environmentId -Index 8}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 = 'Provisioning State'
            Expression = '$data.provisioningState'
        }
        @{
            Name = 'Running Status'
            Expression = '$data.runningStatus'
        }
        @{
            Name = 'Environment'
            Expression = '$EnvironmentName'
        }
        @{
            Name = 'Workload Profile'
            Expression = '$data.workloadProfileName'
        }
        @{
            Name = 'Trigger Type'
            Expression = '$data.configuration.triggerType'
        }
        @{
            Name = 'Replica Timeout'
            Expression = '[string]$data.configuration.replicaTimeout'
        }
        @{
            Name = 'Replica Retry Limit'
            Expression = '[string]$data.configuration.replicaRetryLimit'
        }
        @{
            Name = 'Container Count'
            Expression = '[string]@($data.template.containers).Count'
        }
        @{
            Name = 'Outbound IP Count'
            Expression = '[string]@($data.outboundIpAddresses).Count'
        }
        @{
            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 = 'Container App Jobs'
        TableNamePrefix = 'ContainerAppJobsTable_'
        Columns = @(
            'Subscription'
            'Resource Group'
            'Name'
            'Location'
            'Provisioning State'
            'Running Status'
            'Environment'
            'Workload Profile'
            'Trigger Type'
            'Replica Timeout'
            'Replica Retry Limit'
            'Container Count'
            'Outbound IP Count'
            'Identity Type'
            'Retiring Feature'
            'Retiring Date'
            'Resource U'
        )
        TagColumns = @(
            'Tag Name'
            'Tag Value'
        )
        TagColumnsBefore = 'Resource U'
        NumberFormat = '0'
        ConditionalText = @()
    }
}