"An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail." - azure

I have hosted an MVC application in Azure App Service. The application is not creating any problem when i am testing it in local host. I can easily connect to the Dynamics-365 through the SDK and can do easily CRUD operation.
But when i am trying to login which is hosted in Azure it is giving that error though am not getting this error if i restart the app service. If i restart the app service in every morning then i am not getting this error. But i don't want to restart the app service daily.
Here the same question also has been asked but there is not any solution which has been marked as Solved. Time zone difference between client and server has been discussed here but the part which confused me when i am restarting the app service it is working.
How to solve this issue? I am thinking about app service Auto Healing. Should this work?
Any solution would be appreciated.
Thanks in advance.

From your description of Question it looks like connection pool issue. You probably are not closing connection after your transaction is completed. Try force closing connection (threads) that might solve your issue.
OR
The clock on the Server hosting client application was out of sync with the server having the service.
This is almost always because of a server time skew. The remote server
and the client's system time must be within (typically) 10 minutes of
each other. If they are not, security validation will fail.
I'd check azure service bus and find out what their server time is, and
compare that to your server time.
WCF gives an unsecured or incorrectly secured fault error
https://social.msdn.microsoft.com/Forums/vstudio/en-US/ae4172dd-e215-4a72-b927-d164ce4cc318/an-unsecured-or-incorrectly-secured-fault-was-received-from-the-other-party?forum=wcf

Related

Why does my Azure Hybrid Connection show a "Status Unknown"?

So...about 5pm 2 nights ago, all 14 of my listeners on my Azure Service Bus dropped. So I logged in to my on-prem SQL Server to check on my Hybrid Connections and both of them showed a status of "Status Unknown". I can't find anything on the internet about this specific status.
Nothing changed on my SQL Server other than the fact that I've pegged the RAM....it's at 100% usage.
If I go to the Azure Portal, navigate to either of my Hybrid Connection Overview pages and click on the "Hybrid Connection Url", I get the following message in the browser:
"error": {
"code":"TokenMissingOrInvalid",
"message":"MissingToken: Relay security token is required. TrackingId:*SOME GUID*, SystemTracker:*SERVICE BUS NAME*:*HYBRID CONNECTION NAME*, Timestamp:2021-08-04T04:19:16"}
}
Now....I didn't change anything on my Hybrid Connection configurations. I haven't changed anything about tokens. I have no idea what's going on other than my Azure App Services have been down for 2 days, now.
Any help would be greatly appreciated....
This looks like an authentication error where a token might not be generating when you are trying to make a call to the underlying On prem server
You can refer the SO thread for ServiceBusAuthorization and still if you are facing the issue kindly raise a ticket with MS-Q&A
Microsoft support led me to this article where I found the following information:
Make Sure that the Date and Time are Correct
The Hybrid Connection Manager connects to Azure Relay using Secure Sockets Layer (SSL) on port 443. If there's a problem with your SSL handshake or connection, it will break your Hybrid Connection. If you find that your Hybrid Connection works initially, and then it stops working after about 10 minutes, that's a sign that you need to check the date and time on the machine running the Hybrid Connection Manager. Make sure they are correct because if they're not, your SSL connection may not work.
Well...the time on my server was off by about 16 minutes b/c of a group policy that I had never bothered to fix b/c I don't know anything about group policies. So I looked up how to fix the server's clock and, once that done, resolved this issue.

Connections lost on slot swap

I want to use deployment slots for my Blazor server side application, but it stops working for the current users during the swap and they have to refresh the page.
I'm using an Azure SignalR Service for performance reasons, so it kinda makes sense, I imagine it like this:
Connections are held in memory and when I swap, obviously that is gone. At least without a SignalR Service. But shouldn't my SignalR Service keep SignalR connections (see red)? Did I set it up incorrectly?
I found others having similar problems (without using Blazor), but I'm not sure if these are viable with Blazor, especially because I just want to mitigate that 1-2 minute downtime for an update...
Automated reconnect
SignalR client disconnected on Azure slots swap
Storing connections in an external storage. But manually handling connections is absurd effort?
https://learn.microsoft.com/en-us/aspnet/signalr/overview/guide-to-the-api/mapping-users-to-connections
Update:
See: https://www.youtube.com/watch?v=Vvjdqq8MB44&t=12m10s
It seems there is "Web traffic" going directly to the Blazor app. My guess: After a swap the "Web traffic" still goes to the previous instance, while SignalR traffic goes to the newly swapped in instance. That sounds like a problem.
But once again, I have no clue what "Web traffic" actually is or if that is the problem and if Azure offers a way to solve the issue, so a definitive answer would still be appreciated.
I don't think you have it setup incorrectly. I looked into doing a similar thing and had the same results.
The azure signalr service is basically acting as a proxy, when you switch slot the azure signalr server is losing its connection to the blazor server hub which holds the current state.
I don't think there is anyway around it, when you want to update your blazor server site every connected client will lose its connection because it's not possible to move the client 'states' over to the new slot/site.
What would be nice is the ability for azure to switch the new slot in once all old connections have disconnected, but I don't think we'll ever get that as it's a very specific blazor server requirement.

Azure web app is 503 Service Unavailable. How do I get it back running?

Our website has been hosted on Azure for a few years. Tonight it is throwing 503 Service unavailable errors. I cannot even load a url to a .jpg file. I have restarted the app and still nothing loads from the website. I cannot buy Azure support because I have bought and cancelled Azure support in the past. We are a 3 person business and depend on our small website and it is down and I don't know what to do. None of the trace logs make any sense to me.
I think 503 could mean that you reached a quota and Azure now respond with a 503 for requests. So I would check the Quotas section within your App Service Plan.
Also check:
Troubleshoot HTTP errors of "502 bad gateway" and "503 service unavailable" in Azure App Service
There are several things you can do to help remedy the situation.
Restart the application (please indicate what it is that will help
us)
Restart the instance that the application is running on.
Restore from a previous working backup of the site.
You should also add more information to your post so we can help, like what application you are using e.g. Apache, Nginx ect.
I've also had a similar problem. I had two deployment slots and in the first slot (production) which I had the latest code and in the second slot, I've missed deploying the latest code and configured traffic as 60-40 which gave me hard time finding it.
Once I've set 100% to the production slot it started working.
Just thought to share this in case it could be useful if you come across the same stuff in the future.
For me it was "Path mappings" in "Configuration".
As soon as i added a new Azure Storage Mount, the application broke.
Setting my Storage account -> Networking, to "Enabled from all networks" fixed the issue.
For us it was a result of the remote debugger. Disabling remote debugger and restarting the app service fixed the 503 error. I think one dev was remote-debugging while another was deploying the app and that seems to have caused an issue under the hood of the app service that broke port binding (we were seeing a stack track in logs about failing to bind to port).

Getting an intermittent error while connecting to on-premise sql database from Azure service

Created an azure MVC website, from service (controller) code we are connecting to an on-premise sql server using Azure Hybrid Connection. Intermittently we are facing below issue.
"A transport-level error has occurred when receiving results from the
server. (provider: TCP Provider, error: 0 - The specified network name
is no longer available.)"
Please provide suggestions to resolve this issue.
You can try following solutions :
Try increasing connection time-out.
check if remote connection is enabled.
Try adding firewall exception.
First of all the error means either the networks has some extra latency, the database is down or you may have too many concurrent connections open the database.
(Make sure you are closing all open datareaders.)
also it may be due to this
These are transient faults and are to be expected in the cloud. Implementing defensive programming is usually a must in the cloud. Try using some retry logic. Microsoft's transient fault exception library is an excellent start. Though meant primarily for SQL Azure and Azure Service bus, you can use the library for SQL IaaS.
In my opinion, 98% sure, because I recently had the same experience, it is a network issue from the server provider.
For instance: if you are rent the server from Ionos, by default all remote connections are blocked, even though you disable the firewall in the server. You still won't be able to connect remotely. You can, however, do your work on the server without any problem.
To connect remotely, you have to contact the server provider. They will explain how to enable firewall ports from your control panel.
I contacted my server provider as I almost get frustrated. Here was their response.
enter image description here
After this, every permitted client can connect remotely to the server.
I wish you success.

HTTP Request Timeout Windows Azure Deploy

I have an MVC 4 website using a WCF service. When I deploy to Windows Azure using the VS 2012 publish wizard, I get this error:
10:13:19 AM - The HTTP request to 'https://management.core.windows.net/42d4257b-5f38-400d-aac5-2e7acee9597d/services/hostedservices/myapp?embed-detail=true' has exceeded the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout.
After cleaning the project and publishing a few times, the error goes away. What am I doing wrong?
Whenever you start publish process from VS machine, a SSL tunnel is established first and once the tunnel is created, the package is transferred from your machine to Windows Azure Portal first. After the upload is completed, you will see the result notifications are posted back to Publish result windows and that is how it happens.
In your case, the time to build the SSL tunnel doe secure package transfer is longer then normal, this could be because of network latency between your machine and the Windows Azure Management Portal. For security reason the time to create the tunnel smaller windows and if the connection is not created, the retry cycle starts the process again and even if that fails you are greeted with the failure message. This could be caused by excessive traffic on either side or both sides. So this is mainly a networking related issue rather then specific to Windows Azure as after some time successive tries, you could upload your package.
In such failure/situation, you can run network capture utilities i.e netmon, wireshark, and see the time taken during failure and success to see the different in various transfer. This will help you to understand the underlying delaying issues.
Try to update your roles diagnostics
like below
then update your storage credentials because it may be expired.

Resources