.NET 6 webapi deployed to Azure App Service, logging to AWS Cloudwatch does not work.

Pete Franklin 1 Reputation point

I've got a .NET 6 webapi hosted in an Azure AppService. I am using AWS.Logger.AspNetCore to log to AWS Cloudwatch. It is working when I run locally, but when I run in the deployed Azure AppService environment, I don't see any of the log messages in Cloudwatch.

In Program.cs I configure logging like so:


// Get AWS configuration  
var awsOptions = builder.Configuration.GetSection(AWSOptions.SectionName).Get
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,212 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 59,546 Reputation points

    check your AWS firewall rules

    0 comments No comments

  2. Takahito Iwasa 4,841 Reputation points MVP

    Hi, @Pete Franklin

    You're specifying an IAM user access key and secret, are they the same as localhost?
    I recommend checking the IAM policy first.


    The simplest possible cause is that he does not have the following permissions granted to his IAM user.

       logs: CreateLogGroup  
       logs: CreateLogStream  
       logs: PutLogEvents  
       logs: DescribeLogGroups  


    Deny Condition

    If the above permission is granted, does her IAM policy restrict her IP address or anything else?


  3. Alex Hales 0 Reputation points

    Hi there,

    I faced a similar issue recently with my .NET 6 webapi on Azure AppService and AWS Logger. It can be quite frustrating when logs don't appear where you expect them to.

    In your case, have you checked the Cloudwatch configuration and permissions in your Azure AppService environment? Sometimes, issues like this can be related to access permissions or network configurations.

    By the way, if you're interested in improving your English language skills, you might find some helpful resources on "Ways to Say" at Microsoft's English Language Learning Center.

    Hope this helps!

    0 comments No comments