skip to Main Content

I have an Azure Container Instance running a docker image of Coldfusion application.
I also configured this Container Instance to Log Analytics Workspace.

Now I need the Coldfusion logs to show at Log Analytics Workspace. I am unable to get those logs.

Is there a way to get those logs at Log Analytics Workspace.

2

Answers


  1. Assuming you have integrated the log analytic workspace after creation of azure container instance.

    1. If this is the case it won’t works for you, for storing logs of container instance we have to create the log analytic workspace while creating the azure container instance.
    2. So you will need to delete and recreate the container instance.

    You can refer this microsoft document for detailed information of how to store the logs in log analytic workspace.
    you can also refer this link. for custom log.

    Login or Signup to reply.
  2. Creating the log analytics workspace first and then providing the workspace ID and workspace key at container group creation worked fine for me (no need to create them both "at the same time"). Note, that it does take up to 10 minutes (according to the docs) for the ContainerInstanceLog_CL table to populate with your container’s console logs.

    Various programmatic ways to specify this at container creation, pertinent bit of C# client code shown below.

    var containerGroupData = new ContainerGroupData(location, new[] { container }, ContainerInstanceOperatingSystemType.Linux);
    var logAnalyticsWorkspaceId = ConfigurationManager.AppSettings["LogAnalyticsWorkspaceId"];
    var logAnalyticsWorkspaceKey = ConfigurationManager.AppSettings["LogAnalyticsWorkspaceKey"];
    containerGroupData.DiagnosticsLogAnalytics = new ContainerGroupLogAnalytics(logAnalyticsWorkspaceId, logAnalyticsWorkspaceKey);
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search