Skip to content

Commit

Permalink
Outlined Test Scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethcarnes committed Feb 18, 2024
1 parent 234a0c1 commit 1ffcfbb
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
62 changes: 62 additions & 0 deletions scripts/# Ensure you have Azure PowerShell modul.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Ensure you have Azure PowerShell module installed and logged in
# Install-Module -Name Az -AllowClobber -Scope CurrentUser
# Connect-AzAccount

$resourceGroup = 'devResourceGroup'

# Fetch all VMs in the resource group
$vms = Get-AzVm -ResourceGroupName $resourceGroup

# Fetch NICs, Public IPs, and VNets
$nics = Get-AzNetworkInterface -ResourceGroupName $resourceGroup
$publicIps = Get-AzPublicIpAddress -ResourceGroupName $resourceGroup
$vnets = Get-AzVirtualNetwork -ResourceGroupName $resourceGroup
$firewalls = Get-AzFirewall -ResourceGroupName $resourceGroup
$bastions = Get-AzBastion -ResourceGroupName $resourceGroup

# Display VMs information
Write-Host "VMs Status:"
$vms | ForEach-Object {
Write-Host "$($_.Name): PowerState=$($_.PowerState)"
}

# Display NICs information
Write-Host "`nNetwork Interface Cards (NICs):"
$nics | ForEach-Object {
Write-Host "$($_.Name): IP=$($_.IpConfigurations.PrivateIpAddress)"
}

# Display Public IPs information
Write-Host "`nPublic IPs:"
$publicIps | ForEach-Object {
Write-Host "$($_.Name): IP=$($_.IpAddress)"
}

# Display VNet information
Write-Host "`nVirtual Networks (VNets):"
$vnets | ForEach-Object {
Write-Host "$($_.Name): Address Space=$($_.AddressSpace.AddressPrefixes)"
}

# Display Azure Firewall information
Write-Host "`nAzure Firewall Configurations:"
$firewalls | ForEach-Object {
Write-Host "$($_.Name): IP Configurations=$($_.IpConfigurations.PrivateIpAddress)"
}

# Display Bastion Host information
Write-Host "`nAzure Bastion Hosts:"
$bastions | ForEach-Object {
Write-Host "$($_.Name): IP=$($_.IpConfigurations.IpAddress)"
}

# Network Connectivity Tests to Public IPs (Example)
# You can use Test-NetConnection for basic connectivity tests to public IPs
Write-Host "`nNetwork Connectivity Tests to Public IPs:"
$publicIps | ForEach-Object {
$testResult = Test-NetConnection -ComputerName $_.IpAddress -Port 80
Write-Host "$($_.Name) to $($_.IpAddress): $($testResult.PingSucceeded)"
}

# Note: This script assumes you have the necessary permissions and that your environment is configured for the Azure PowerShell module.
# Adjust the script as per your specific needs and Azure setup.
22 changes: 22 additions & 0 deletions scripts/# Streamlined script without the need to.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Streamlined verification script without defining multiple variables

# List all resources in the resource group 'devResourceGroup'
az resource list --resource-group devResourceGroup --output table

# Verify Virtual Networks and Subnets
az network vnet list --resource-group devResourceGroup --output table

# Check Virtual Machines
az vm list --resource-group devResourceGroup --show-details --output table

# Verify Network Interface Cards
az network nic list --resource-group devResourceGroup --output table

# Check Public IP Addresses
az network public-ip list --resource-group devResourceGroup --output table

# Inspect Azure Firewall Configuration
az network firewall show --name hubVnet-firewall --resource-group devResourceGroup --output json

# Inspect Bastion Host
az network bastion show --name hubVnet-bastion --resource-group devResourceGroup --output json

0 comments on commit 1ffcfbb

Please sign in to comment.