Skip to content

Azure Notes

Franknaw edited this page Aug 16, 2021 · 30 revisions

Azure Container CLI

  • az container list --resource-group Development --subscription Development
[
  {
    "containers": [
      {
        "command": null,
        "environmentVariables": [
          {
            "name": "MOODLE_DOCKER_DB",
            "secureValue": null,
            "value": "'pgsql'"
          }
        ],
        "image": "lmscontainerregistry6.azurecr.io/moodle-app:v1.3",
        "instanceView": null,
        "livenessProbe": null,
        "name": "lmscontainer",
        "ports": [
          {
            "port": 80,
            "protocol": "TCP"
          },
          {
            "port": 443,
            "protocol": "TCP"
          }
        ],
        "readinessProbe": null,
        "resources": {
          "limits": null,
          "requests": {
            "cpu": 2.0,
            "gpu": null,
            "memoryInGb": 8.0
          }
        },
        "volumeMounts": null
      }
    ],
    "diagnostics": null,
    "dnsConfig": null,
    "id": "/subscriptions/b0f019f4-10cd-4344-a744-db53ca2b95e9/resourceGroups/Development/providers/Microsoft.ContainerInstance/containerGroups/lmscontainer",
    "identity": null,
    "imageRegistryCredentials": [
      {
        "password": null,
        "server": "lmscontainerregistry6.azurecr.io",
        "username": "lmscontainerregistry6"
      }
    ],
    "instanceView": null,
    "ipAddress": {
      "dnsNameLabel": null,
      "fqdn": null,
      "ip": "172.16.6.4",
      "ports": [
        {
          "port": 80,
          "protocol": "TCP"
        },
        {
          "port": 443,
          "protocol": "TCP"
        }
      ],
      "type": "Private"
    },
    "location": "eastus",
    "name": "lmscontainer",
    "networkProfile": {
      "id": "/subscriptions/b0f019f4-10cd-4344-a744-db53ca2b95e9/resourceGroups/Development/providers/Microsoft.Network/networkProfiles/lmscontainer-networkProfile",
      "resourceGroup": "Development"
    },
    "osType": "Linux",
    "provisioningState": "Succeeded",
    "resourceGroup": "Development",
    "restartPolicy": "OnFailure",
    "tags": {},
    "type": "Microsoft.ContainerInstance/containerGroups",
    "volumes": null
  }
]
  • Test-NetConnection -ComputerName 172.16.6.4 -InformationLevel Detailed
ComputerName           : 172.16.6.4
RemoteAddress          : 172.16.6.4
NameResolutionResults  : 172.16.6.4
InterfaceAlias         : Hub
SourceAddress          : 10.10.0.2
NetRoute (NextHop)     : 0.0.0.0
PingSucceeded          : True
PingReplyDetails (RTT) : 8 ms
  • az container logs --name lmscontainer --resource-group Development
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.16.6.4. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.16.6.4. Set the 'ServerName' directive globally to suppress this message
[Mon Aug 09 00:42:57.700205 2021] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.4.21 configured -- resuming normal operations
[Mon Aug 09 00:42:57.700263 2021] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
[Mon Aug 09 13:05:24.093123 2021] [autoindex:error] [pid 18] [client 10.10.0.2:59971] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
10.10.0.2 - - [09/Aug/2021:13:05:24 +0000] "GET / HTTP/1.1" 403 492 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 Edg/92.0.902.62"
10.10.0.2 - - [09/Aug/2021:13:05:24 +0000] "GET /favicon.ico HTTP/1.1" 404 488 "http://172.16.6.4/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 Edg/92.0.902.62"
10.10.0.2 - - [09/Aug/2021:13:06:15 +0000] "-" 408 0 "-" "-"
10.10.0.2 - - [09/Aug/2021:13:07:25 +0000] "-" 408 0 "-" "-"
10.10.0.2 - - [09/Aug/2021:13:07:25 +0000] "-" 408 0 "-" "-"

  • Ubuntu
    • sudo apt-get install -y docker.io
  • docker exec -it bash
az container exec --exec-command bash --container-name moodle --resource-group Development --subscription Development --name lmscontainer-test

Azure VNet Peering

  • Setup peering from Hub Vnet to LMS Vnet
  • Selected "Use this virtual networks gateway or route server"
  • Setup peering from LMS Vnet to Hub Vnet
  • Selected "Use the remote virtual networks gateway or route service"

Azure Route Tables

  • Virtual network peering is a non-transitive relationship between two virtual networks.
  • In Azure "peer-to-peer transitive routing describes network traffic between two virtual networks that are routed through an intermediate virtual network with a router
  • For example VNet1 has peered with the VNet2 network, and VNet2 has peered with VNet3, but VNet1 and VNet3 are not connected. For network traffic to get from VNat1 to VNet3, it would have to go through the VNet2 network. This action is known as transitive routing.

Testing Network Connectivity via powershell

  • Test-NetConnection -ComputerName 172.16.4.4 -InformationLevel Detailed -DiagnoseRouting
  • Test-NetConnection -ComputerName 172.16.4.4 -InformationLevel Detailed


Development and Staging:

    VPN: 10.10.0.0/24
    Gateway Network: 172.16.0.0/22


Development:

    LMS Network: 172.16.4.0/22
    CRMS Network: 172.16.8.0/22
    Range Resources Network: 172.16.16.0/22


Staging:

    LMS Network: 172.31.4.0/22
    CRMS Network: 172.31.8.0/22
    Range Resources Network: 172.31.16.0/22



Production:

    Gateway Network: 10.16.0.0/22
    LMS Network: 10.16.4.0/22
    CRMS Network: 10.16.8.0/22
    Range Resources Network: 10.16.16.0/22




accounts receavle
accprec@mountgomcollage edu


zoom work


Install Terraform

hashicorp                                                               Hashicorp Stable - x86_64