Accessing Azure app configuration in a WCF service - authentication

We have an on-prem WCF service. Recently we added Azure app config to store some config values. We use certificate based authentication(using service principal) to access Azure App config. The issue is, when we try to connect to the Azure app config from WCF service, we get authentication failed error. We can successfully connect to and access the config values from Azure, using a console app in the same server using the same certificate.
The service account of WCF has all the access to manage the certificate. Why can't we access Azure app config in WCF service? Are we missing any settings?
Any help is appreciated.

Related

Cannot reach service fabric service

I create a service fabric application on my local development machine with 3 statless services, one of the service (Service1) has an endpoint with a static port assigned , Service is a .net core web api hosted using kestrel
After deploying the application to my local cluster , I am not able to acess this service using the following URL
http://localhost:8641/api/values
but I can access it using the reverse proxy url
http://localhost:19081/ServiceFabricApplicationName/Service1/api/values
Any ides why I cannot reach the service with first url ?

Azure API App service hosting wcf service

I have created a wcf service and self hosted it. I want to push it over the azure cloud as API APP service and not a cloud service? Please guide.
I actually something similar: hosting REST endpoints and a WCF endpoint in an Azure deployed API App
There was nothing special to consider. Just created the WCF within my solution, configured basicHttpBinding correctly to work with https.
Let me know where exactly you're struggling.

WCF on cloud is not working

I just created a WCF service and deployed in one of the machine's IIS and checked it works fine.
When I deploy the same service on Cloud VM's IIS I am not able to consume that service.
I am getting the error saying that "There is no listener with the endpoint".
Can i deploy normal WCF on cloud or do i need to create WCF cloud service?
Environment(IIS 8.5)
It could be several Things, most probably:
ASP.net not activated on IIS
Also check:
The url you are using
firewall problems
site not started

WCF + web api + No connection could be made because the target machine actively refused it x.x.x.x:443

I am accessing a third party web api from my WCF application. While development I was able to access those APIs but when I deployed my WCF to IIS, its not able to connect to the web API and throwing me the following error:
"System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it X.X.X.X:443"
Just to make sure that my server is fine where I deployed my WCF. I tried accessing those web api from a simple console application. It accessed those apis from my development machine and from the server machine as well. Now I feel the culprit is not the third party web api server, but something goes wrong when a WCF service access' a web-api hosted in IIS.
Please help!!!
Finally I found the issue. IIS runs my WCF under user 'network service' or 'application pool identity'. These are nothing but window built-in users which has limited access. When I tried accessing third party API from the console application it worked because it was running under my user credential which has admin credential. So I concluded that when an application making cross-domain call then it should be running under a user with enough credential to make such calls.
Solution was to change my application pool identity to a admin user identity (I changed it to my logged in user). It worked and making calls to third party API from WCF service

How to start/stop windows service from a remote machine through WCF service?

I have created a WCF service which is deployed on my local machine. This service exposes one method which start/stop a windows service on my local machine.
On the remote machine I have created a client that consumes the WCF service. When I try to invoke the method which start/stop service exposed from a WCF service , I get InvalidOperationException . I found that this is the Security issue.
Also when I do the same operation (start/stop windows service) on the local machine it works!!
The WCF service is hosted on IIS 7.0 which is using basichttpBinding. Also Anonnymous access is checked. I have also added <identity Impersonate = true > under the web section in the web config file but still no success.
Please help!!
You set impersonation for ASP.NET. Impersonation in WCF uses its own infrastructure. Moreover in WCF client has to allow service to impersonate his identity. Check this simple example.