I'm trying to connect my application to Azure SignalR Service. The application works fine using SignalR locally or even using Azure App Services.
services.AddSignalR();
The code above is what I had and everything works.
services.AddSignalR().AddAzureSignalR(Configuration.GetValue<string>("SignalRConnectionString"));
This is the change to be able to use Azure SignalR Service.
In the logs, I can see that the request is being forwarded to the Azure End Point.
I keep getting this error.
failed: HTTP Authentication failed; no valid credentials available
Related
I'm facing issue with my multiple project solution in .net core webAPI. I've gatewayAPI which internally makes call to different microservices via http call.
Gateway API URI exposed to outer world which has domain as azure app name but the internal calls from gateway to microservices are configured with http://localhost:5001/{apiEndPoint} which is working fine in my local machine but after deploying it on azure app service I'm getting below error:
PostToServer call URL:'http://localhost:5001/api/authservice/authenticate' with Exception message An attempt was made to access a socket in a way forbidden by its access permissions. (localhost:5001).
Can someone please help me with this, I'm new to azure and learning on my own but could not find any solution for this yet.
PS: After going through some YouTube videos and blogs I got to know we have to use AKS but I'm not confident in that.
Would really appreciate any help on this issue.
The Gateway API you deployed to azure app service, it doesn't support custom port usage for 5001. Azure App Service only supports port 80|443(HTTP|HTTPS).
If you must use multiple ports in your actual project, then it is recommended to check whether Azure Cloud Service meets your needs. But it not the best choice.
The Best Practice:
Microservices architecture design
In short,create a Azure Gateway service, and your other microservice can be deployed in any where.(azure app service, vm or aks)
You just make sure you can access your microservices in your internal or public network environment.
If you're just learning, or the app isn't actually used by a lot of users, you can try the following suggestions:
Use SignalR (not azure signalr) to replace the websocket in your current project.
You have on azure app service, you can deploy your Gateway API Application to app service, and your other microservices can be deployed to Virtual Application in azure app service.
I'm trying to use the Azure SignalR service. I've already got SignalR working locally, but when I upgrade it to use the Azure service I see the following:
Client connects to (local, .NET) hub server configured to use Azure SignalR service and is 'redirected' to our hosted SignalR service on Azure.
Client connects with https to SignalR service at https://blabla.service.signalr.net and (after a preflight request) gets a 200 response with a json payload containing list of available transports etc.
Client opens a WebSocket to the wss://blabla.service.signalr.net host. First upstream message is {"protocol":"json","version":1}.
Server responds immediately with the following response:
{"error":"An unexpected error occurred during connection handshake. NullReferenceException: Object reference not set to an instance of an object."}
What's puzzling me is that
There is no code of ours running in the SignalR service which could be causing this.
Our Hub server shows no errors related to calls from the SignalR service.
I've successfully run a chat hub on the same SignalR service using the same hub server.
How do I debug this? I can't see any activity logs on the Azure portal, and nothing is showing up locally on the hub server.
I managed to find the source of the problem by adding debugging entries to my app settings.json as follows:
"Microsoft.AspNetCore.SignalR": "Debug",
"Microsoft.AspNetCore.Http.Connections": "Debug"
This revealed that the problem was related to a call made from the SignalR service to my local hub server (via a WebSocket connection presumably)
I am attempting to publish a net core 6.0.100-preview.4.21255.9 api app to Azure App service.
The application publishes correctly from VS2019 as a self contained deployment. When hitting the url of the app service i get HTTP Error 500.32 - ANCM Failed to Load dll. I expect the swagger to come up.
If I create a web app with net core 6.0.100-preview.4.21255.9 and deploy that it works fine.
Any ideas on how do get this to work on azure app service?
Looks like this was my mistake. The API is working just fine.
We are consuming WCF service from a console application with NetworkCredential(UserName && PWD) ,WSHTTPBinding.
When we call Service from Azure PAAS Service , we land into issue The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate,NTLM'.
The Client Config for both PAAS Consumer, Console app looks exactly same. Not sure why the error is seen only in case of PAAS Consumer.
The reason is because the PaaS service is not in the same network of your WCF service or the credentials you're using are not valid.
For example:
you're using a valid / existing credential from your company network locally:
CONTOSO\thdotnet
When publishing to Azure and trying to use the same credentials it will fail unless you're using a VPN to allow your PAAS app to call the servers running in your company's network.
I am using web for container in azure
- platform linux
My application was written in Node.js with socketio.
I use docker for create container.
I've already tested in local machince websocket is work fine but when I deploy to azure web for container.
When I try to connect websocket, I always got error code 503 Service Temporarily Unavailable.