This solution is an Azure Container App Job that tests network connectivity to a remote server using an SSL/TLS connection. It validates network connectivity at the Azure Container Apps infrastructure level.
The application tests different layers of network connectivity:
Create a new Container App Job within the same Container App environment for isolated testing.
You can either:
Option 1: Build from Source
Option 2: Pull from Docker Hub
docker.ioyass101010/containerappjob_networktester:latest# Pull the image
docker pull yass101010/containerappjob_networktester:latest
# Or use directly in Azure Container Apps Job
az containerapp job create \
--name network-connectivity-test \
--resource-group <your-resource-group> \
--environment <your-environment> \
--trigger-type Manual \
--image docker.io/yass101010/containerappjob_networktester:latest \
--cpu 0.25 --memory 0.5Gi \
--env-vars SERVER_FQDN=<server-to-test> SERVER_PORT=<port>
┌─────────────────────────────────────────┐
│ Azure Container Apps Environment │
│ │
│ ┌──────────────────────────────────┐ │
│ │ Container App Job │ │
│ │ (Trigger: Manual) │ │
│ │ │ │
│ │ ┌────────────────────────────┐ │ │
│ │ │ .NET 8 Console App │ │ │
│ │ │ - Test DNS │ │ │
│ │ │ - Test TCP │ │ │
│ │ │ - Test SSL/TLS │ │ │
│ │ │ - Test Server Response │ │ │
│ │ └────────────────────────────┘ │ │
│ └──────────────────────────────────┘ │
│ │ │
└─────────────────┼───────────────────────┘
│
▼
┌─────────────────────┐
│ Log Analytics │
│ Workspace │
└─────────────────────┘
The C# (.NET 8) application performs the following connectivity tests:
var addresses = await System.Net.Dns.GetHostAddressesAsync(server);
tcpClient.ConnectAsync(server, port);
sslStream.AuthenticateAsClientAsync(server);
var bytesRead = await sslStream.ReadAsync(buffer, 0, buffer.Length);
The application uses two configurable environment variables:
| Variable | Description | Default Value |
|---|---|---|
SERVER_FQDN |
Server FQDN to test | imap.gmail.com |
SERVER_PORT |
Server port | 993 |
ContainerAppConsoleLogs_CL
| where ContainerAppName_s == "container-app-job"
| where TimeGenerated > ago(1h)
| order by TimeGenerated desc
| project TimeGenerated, Log_s
ContainerAppConsoleLogs_CL
| where ContainerAppName_s == "container-app-job"
| where Log_s contains "❌" or Log_s contains "failed" or Log_s contains "Error"
| order by TimeGenerated desc
| project TimeGenerated, Log_s
ContainerAppConsoleLogs_CL
| where ContainerAppName_s == "container-app-job"
| where Log_s contains "✅"
| order by TimeGenerated desc
| project TimeGenerated, Log_s
ContainerAppConsoleLogs_CL
| where ContainerAppName_s == "container-app-job"
| where Log_s contains "Server FQDN:" or Log_s contains "Port:"
| order by TimeGenerated desc
| project TimeGenerated, Log_s
ContainerAppConsoleLogs_CL
| where ContainerAppName_s == "container-app-job"
| where Log_s contains "ms)"
| order by TimeGenerated desc
| project TimeGenerated, Log_s
| extend Milliseconds = extract(@"(\d+)ms\)", 1, Log_s)
let executionId = "container-app-job-<execution-id>";
ContainerAppConsoleLogs_CL
| where ContainerGroupName_s contains executionId
| order by TimeGenerated asc
| project TimeGenerated, Log_s
ContainerAppConsoleLogs_CL
| where ContainerAppName_s == "container-app-job"
| where TimeGenerated > ago(7d)
| where Log_s contains "Test Summary"
| summarize
TotalRuns = count(),
SuccessfulRuns = countif(Log_s contains "✅ All connectivity tests passed"),
FailedRuns = countif(Log_s contains "failed")
| extend SuccessRate = (SuccessfulRuns * 100.0) / TotalRuns
ContainerAppConsoleLogs_CL
| where ContainerAppName_s == "container-app-job"
| where Log_s contains "SSL Protocol:"
or Log_s contains "Cipher Algorithm:"
or Log_s contains "Certificate"
| order by TimeGenerated desc
| project TimeGenerated, Log_s
Navigate to Log Analytics Workspace
Open the query editor
Execute a KQL query
Analyze results
=== Network Connectivity Test ===
Starting test at: 2025-12-12 10:30:00 UTC
Configuration:
Server FQDN: imap.gmail.com
Port: 993
Timeout: 30s
📡 Testing connectivity to: imap.gmail.com:993
⏱️ Timeout: 30 seconds
Step 1: DNS Resolution
✅ DNS resolution successful (45ms)
Resolved IP addresses:
- 142.250.185.109 (InterNetwork)
- 2a00:1450:4007:80d::6d (InterNetworkV6)
Step 2: TCP Connection
✅ TCP connection established (23ms)
Local endpoint: 10.0.0.4:54321
Remote endpoint: 142.250.185.109:993
Connected: True
Step 3: SSL/TLS Handshake
📜 Certificate validation callback triggered
Subject: CN=imap.gmail.com
Issuer: CN=GTS CA 1C3, O=Google Trust Services LLC, C=US
Valid from: 11/20/2025 8:00:00 AM
Valid to: 2/12/2026 8:00:00 AM
SSL Policy Errors: None
✅ SSL/TLS handshake successful (87ms)
SSL Protocol: Tls13
Cipher Algorithm: Aes256 (256 bits)
Hash Algorithm: Sha384 (384 bits)
Key Exchange Algorithm: None (0 bits)
Is Authenticated: True
Is Encrypted: True
Is Signed: True
Step 4: Reading IMAP Server Greeting
✅ Received IMAP greeting (12ms, 45 bytes)
Response: * OK Gimap ready for requests from 10.0.0.4
=== Test Summary ===
✅ All connectivity tests passed!
Server: imap.gmail.com:993
Status: REACHABLE
SSL/TLS: WORKING
IMAP Protocol: RESPONDING
Test completed at: 2025-12-12 10:30:01 UTC
=== End of Test ===
Version: 1.0
Last updated: December 12, 2025