Azure.RequestFailedException: TableClient.UpsertEntity

Ramesh Bachu 0 Reputation points
2023-09-29T09:54:04.7933333+00:00

I have developed WCF application using .Net Framework 4.8 and hosted on the Azure appservice. I'm adding each incoming request into Azure.Data.Table. Whenever application calls Azuure tableClient upsert function application throwing below error message. I don't see the same issue on the local dev environment. I can able to add a record from dev machine to PROD Azure Data Table. I hosted application on the Azure appservice then it started throwing error.

System.AggregateException: Retry failed after 4 tries. Retry settings can be adjusted in ClientOptions.Retry or by configuring a custom retry policy in ClientOptions.RetryPolicy. ---> Azure.RequestFailedException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.PooledStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
Azure Table Storage
Azure Table Storage
An Azure service that stores structured NoSQL data in the cloud.
158 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,985 questions
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 15,351 Reputation points Microsoft Employee
    2023-10-03T23:53:52.2866667+00:00

    @Ramesh Bachu The error message indicates that there is an issue with the connection between your Azure App Service and Azure Table Storage. The error message "Authentication failed because the remote party has closed the transport stream" suggests that the connection was closed by the remote server, which in this case is Azure Table Storage.

    Here are a few things you can try to resolve the issue:

    Check the connection string: Make sure that the connection string used by your application to connect to Azure Table Storage is correct. You can find the connection string in the Azure portal under the "Access keys" section of your storage account.

    Check the firewall settings: Make sure that the firewall settings for your Azure Table Storage account are configured correctly. You can configure the firewall settings in the Azure portal under the "Firewalls and virtual networks" section of your storage account.

    Check the retry policy: The error message suggests that the retry policy is failing after 4 tries. You can adjust the retry policy in the ClientOptions.Retry property. You can also configure a custom retry policy in the ClientOptions.RetryPolicy property.

    Check the TLS version: Azure Table Storage requires TLS 1.2 or later. Make sure that your application is using TLS 1.2 or later to connect to Azure Table Storage.

    If none of the above solutions work, you can try enabling diagnostics logging for your Azure App Service and Azure Table Storage to get more information about the error.

    0 comments No comments