mirror of
https://dev.azure.com/effectory/Survey%20Software/_git/Cloud%20Engineering
synced 2026-02-28 03:02:19 +01:00
Implemented getting the resources
This commit is contained in:
@@ -31,27 +31,27 @@ function Get-EffectoryDomainResources {
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------
|
||||
Write-Host "Checking WebApps and WebApp Slots for subscription $($currentContext.Name)"
|
||||
# $webApps = Get-AzWebApp
|
||||
# [int]$webAppCounter = 0
|
||||
# [int]$webAppSlotCounter = 0
|
||||
$webApps = Get-AzWebApp
|
||||
[int]$webAppCounter = 0
|
||||
[int]$webAppSlotCounter = 0
|
||||
|
||||
# if ($null -ne $webApps) {
|
||||
# # check webapps
|
||||
# $itemsWebApps = CheckWebApps -subscription $currentContext -webApps $webApps -effectoryDomainPattern $effectoryDomainPattern
|
||||
# $webAppCounter += $itemsWebApps.Count
|
||||
# $result += $itemsWebApps
|
||||
if ($null -ne $webApps) {
|
||||
# check webapps
|
||||
$itemsWebApps = CheckWebApps -subscription $currentContext -webApps $webApps -effectoryDomainPattern $effectoryDomainPattern
|
||||
$webAppCounter += $itemsWebApps.Count
|
||||
$result += $itemsWebApps
|
||||
|
||||
# # check webapp slots
|
||||
# foreach ($webApp in $webApps) {
|
||||
# $slot = Get-AzWebAppSlot -WebApp $webApp
|
||||
# if ($null -ne $slot) {
|
||||
# $itemsWebAppSlots = CheckWebApps -subscription $currentContext -webApps $slot -effectoryDomainPattern $effectoryDomainPattern
|
||||
# $webAppSlotCounter += $itemsWebAppSlots.Count
|
||||
# $result += $itemsWebAppSlots
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# Write-Host "Found $($webAppCounter) WebApps and $($webAppSlotsCounter) WebApp Slots for subscription $($currentContext.Name)"
|
||||
# check webapp slots
|
||||
foreach ($webApp in $webApps) {
|
||||
$slot = Get-AzWebAppSlot -WebApp $webApp
|
||||
if ($null -ne $slot) {
|
||||
$itemsWebAppSlots = CheckWebApps -subscription $currentContext -webApps $slot -effectoryDomainPattern $effectoryDomainPattern
|
||||
$webAppSlotCounter += $itemsWebAppSlots.Count
|
||||
$result += $itemsWebAppSlots
|
||||
}
|
||||
}
|
||||
}
|
||||
Write-Host "Found $($webAppCounter) WebApps and $($webAppSlotsCounter) WebApp Slots for subscription $($currentContext.Name)"
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------
|
||||
Write-Host "Checking FrontDoor Endpoints for subscription $($currentContext.Name)"
|
||||
@@ -89,9 +89,46 @@ function Get-EffectoryDomainResources {
|
||||
}
|
||||
Write-Host "Found $($cdnCounter) Cdn Endpoints for subscription $($currentContext.Name)"
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------
|
||||
Write-Host "Checking public IP addresses for subscription $($currentContext.Name)"
|
||||
$ipAddresses = Get-AzPublicIpAddress | Where-Object DnsSettings -ne $null | Where-Object { $_.DnsSettings.DomainNameLabel -ne "" }
|
||||
[int]$ipCounter = 0
|
||||
|
||||
if ($null -ne $ipAddresses) {
|
||||
$itemsIpAddresses = CheckIpAddresses -subscription $currentContext -ipAddresses $ipAddresses -effectoryDomainPattern $effectoryDomainPattern
|
||||
$ipCounter += $itemsIpAddresses.Count
|
||||
$result += $itemsIpAddresses
|
||||
}
|
||||
Write-Host "Found $($ipCounter) public IP addresses for subscription $($currentContext.Name)"
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------
|
||||
Write-Host "Checking Traffic Managers for subscription $($currentContext.Name)"
|
||||
$trafficManagers = Get-AzTrafficManagerProfile
|
||||
[int]$trafficManagerCounter = 0
|
||||
|
||||
if ($null -ne $trafficManagers) {
|
||||
$itemsTrafficManagers = CheckTrafficManagers -subscription $currentContext -trafficManagers $trafficManagers -effectoryDomainPattern $effectoryDomainPattern
|
||||
$trafficManagerCounter += $itemsTrafficManagers.Count
|
||||
$result += $itemsTrafficManagers
|
||||
}
|
||||
Write-Host "Found $($trafficManagerCounter) Traffic Managers for subscription $($currentContext.Name)"
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------
|
||||
Write-Host "Checking Container groups for subscription $($currentContext.Name)"
|
||||
$containerInstances = Get-AzContainerGroup
|
||||
|
||||
if ($null -ne $containerInstances) {
|
||||
throw "Container groups are not implemented yet."
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------
|
||||
Write-Host "Checking API Management for subscription $($currentContext.Name)"
|
||||
$apiManagementServices = Get-AzApiManagement
|
||||
|
||||
if ($null -ne $apiManagementServices) {
|
||||
throw "API Management services are not implemented yet."
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------------
|
||||
$result
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user