How to debug a Portnox Docker container in Azure Container Instances

In this topic, you will learn how to debug your local RADIUS or local TACACS+ server in Azure Container Instances (ACI).

Troubleshoot in the Azure Console

In this section, you will learn how to temporarily turn on the debug mode using the Azure Console, which lets you capture debug logs during the current session without the need to redeploy the container instance.

  1. Navigate to your container instance in the Azure portal.
  2. In the left-hand side menu, go to: Settings > Containers.
  3. In the right-hand side panel, click on the Connect tab.
  4. In the Choose Start Up Command window, click on the Connect button.
  5. Enter the command to turn on debug mode for this session:
    • Local RADIUS:
      /local-radius-init.sh --debug
    • Local TACACS+:
      /app/tacacs-server -container-mode -debug

Activate the debug mode in Azure Container Instances

In this section, you will learn how to activate the debug mode in Azure Container Instances for the local RADIUS and local TACACS+ servers.

Important:
This topic modifies the following processes:
  1. Stop and remove the current container instance.

    To turn on the debug mode, you must create your container instance from scratch.

  2. Follow the steps as described in the relevant topic until you get to the Advanced tab in Azure. Complete all the steps in the Advanced tab as described but don’t go to the next tab yet.
  3. In the Command override field, enter the following command:

    For local RADIUS:

    [ "/local-radius-init.sh", "--debug" ]

    For local TACACS+:

    [ "/app/tacacs-server", "-container-mode", "-debug" ]
  4. Complete the instructions in the relevant topic.

Result: Your Azure logs will now contain debug information.

Note:
Remember to delete the container instance and create it again in regular mode after you finished debugging. Otherwise, the debug mode will consume more resources.

View the debug logs in the Azure portal

In this topic, you will learn how to view the Azure Container Instances logs after you activate the debug mode.

  1. Navigate to your container instance in the Azure portal.
  2. In the left-hand side menu, go to: Settings > Containers.
  3. In the right-hand side panel, click on the Logs tab.

Download the debug logs in the Azure portal

In this topic, you will learn how to download the Azure Container Instances logs, which allows you to see more history information.

  1. Navigate to your container instance in the Azure portal.
  2. In the left-hand side menu, go to: Monitoring > Logs.
  3. If you don’t have a predefined query or Log Analytics set up:
    1. Close the Queries hub window.
    2. Click on the Tables icon.
    3. Expand the Custom Logs category.
    4. Select ContainerInstanceLog_CL.
    5. Set your desired time range and data size to generate the logs.
    6. Once the logs are generated, click on the Share button in the top-right corner and then select the Export to CSV (all columns) option.
Note:
Focus on the Message column in the exported file. This column contains the most important debug output, which can be used for internal analysis or shared with the Portnox support team.