A few days ago I took a look over Application Insights information that I have on one of my websites that are hosted as a Web App inside Microsoft Azure. In the last weeks I’ve made some improvements, and in theory, I should not have any errors reported by the Web App.
Taking a look on the Application Insights, I notified a 409 error that was repeating pretty often. It seems that the HTTP Error is thrown each time when a new user session is an initiate, and some information is read from the Azure Table.
POST azurestorageaccountname/Tables 409
The error was pretty odd initially, mainly because from the user flow and functionality, all things were on the right track. No errors reported on the UI, and the application behaved as expected.
The 409 error represents reported at the moment when an entity already exists, for example when an Azure Table already exists. Looking closer on the call stack I notified that the error happens each time when ‘CreateIfNotExists’ method on the table was called.
Even if the method does not throw an exception, behind the scene a call is made to the Azure Table that checks if the table exists. Without Application, Insights it would not be easy to catch the error on this use case.
If you want to avoid having the error you could have the following approach related to checking if an Azure Table exists or not:
Taking a closer look at the code, it does not make sense to check each time if an Azure Table exists, especially if you don’t create them at runtime. When an Azure Table is missing it is clear that something happens behind the scene that it is not right and you shall investigate the cause.
Taking a look on the Application Insights, I notified a 409 error that was repeating pretty often. It seems that the HTTP Error is thrown each time when a new user session is an initiate, and some information is read from the Azure Table.
POST azurestorageaccountname/Tables 409
The error was pretty odd initially, mainly because from the user flow and functionality, all things were on the right track. No errors reported on the UI, and the application behaved as expected.
The 409 error represents reported at the moment when an entity already exists, for example when an Azure Table already exists. Looking closer on the call stack I notified that the error happens each time when ‘CreateIfNotExists’ method on the table was called.
Even if the method does not throw an exception, behind the scene a call is made to the Azure Table that checks if the table exists. Without Application, Insights it would not be easy to catch the error on this use case.
If you want to avoid having the error you could have the following approach related to checking if an Azure Table exists or not:
- At the deployment phase check from a script if all Azure Tables exists
- Ensures that during the deployment all missing tables are created
- In the application, make calls to the tables
Taking a closer look at the code, it does not make sense to check each time if an Azure Table exists, especially if you don’t create them at runtime. When an Azure Table is missing it is clear that something happens behind the scene that it is not right and you shall investigate the cause.
Comments
Post a Comment