Querying Azure App Service Backend From Localhost - azure

I recently migrated my app backend from azure mobile services to azure app services. I am using the node.js backend with multiple "easy tables" and "easy api's".
After configuring CORS all of my sites that query this backend are up and running properly.
Unfortunately I have not been able to figure out how to query this backend from localhost. I have tried running sites hosted on my local machine that use the exact same code as working sites hosted elsewhere. I have also tried using postman. All of these attempts result in a 400 bad request error.
Edited o be more clear. I have a migrated azure mobile service running on azure. I am attempting to hit that endpoint from localhost. I have tried to hit this endpoint using postman. I have also tried to hit this endpoint using a locally hosted copy of a website that is currently working when not hosted locally. All requests from localhost end up with a 400 error.
I have added https://localhost, localhost:portnumber, https://myIp to the cors page. On the application settings page my MS_CrossDomainWhitelist setting contains [{"host":"localhost"}] (I have also tried without this setting). I have also tried setting MS_SkipVersionCheck to true. What am I missing?

Related

.NET 5 based API deployed on Azure App Service replies with 404 Not Found

I have .NET Core based backend application (Swagger API) deployed in Azure App Services at https://myapi.azurewebsites.net
It works fine except of one method where I invoke a redirection to another website via GET request in browser as following:
https://myapi.azurewebsites.net/api/Method/Ext&RedirectUrl=https://externalsite.com
The link above shows Error 404 Not Found in a browser and I see that one "/" is missing from the RedirectUrl in IIS logs so this must be the reason:
GET /api/Method/Ext&RedirectUrl=https:/externalsite.com
The IIS error code is the same - 404.
There is no Application Gateway or anything else that can modify the URL.
I checked my App Services instance configuration and did not find any settings that could modify the URL.
Did anyone experience the same issue?

IIS web app stops working if Negotiate:kerberos is selected as provider under windows auhentication

we have a web app hosted on IIS. The spn is set for hostname and works fine when negotiate, ntlm is set and user kerberos authentication. However, if we remove both of them and set negotiate:kerberos, the web app stops working.
On accessing the web page, we get error stating that the site cannot be reached. Even the app pool is also running. Still facing this prolem. Anyone have any idea on how to fix this.

How to create https endpoints for Azure Service Fabric on local machine using HttpSys?

I'm trying to create https endpoints for three apps in a cluster of Service Fabric. Because I have more than one app I use HttpSys. So far I worked only on http but requests from frontend are from a secure transmission(https) so I have to put my backend on https.
I tried to follow this 1 but it doesn't work with WebListener so I move the implementation to HttpSys.
I don't have any errors and my cluster is working well but when I try to access my https endpoint I get nothing.

Running Angular5 app locally against Azure AD protected backend

We have an Angular5 application with a DotNet OData backend API. The application is hosted in a Web Application with a virtual directory for the Angular5 app and another virtual directory for the DotNet backend. The web application is secured by Azure AD, with an Azure AD Application defined for the web site.
This all works perfectly. We have no authentication code in the front end (except for 'withCredentials: true' set in the service calls) but apparently having the whole application protected by Azure AD makes the front end able to call the backend without issue (Azure makes you authenticate when you access the Angular5 front end).
The problem comes when we try to develop the front end. When developing Angular5 one needs to run the Angular5 code locally, so I've set up a web app which hosts only the backend code and point the local configuration for the Angular5 app there. This fails with the first backend call with a 401. One of our developers discovered that if you simply plug in the URL to the backend with the same browser (i.e. copy the failing call from the browser network developer tab into a new browser tab in the same browser) you will go through the authentication process and then when you run the local Angular5 app again it works. We thought we had found a workaround until we noticed that for some reason this only seems to fix the "read only" calls. GET works, OPTIONS works but POST fails with a 401. I put some debugging code in the backend but it seems this code does not even get called (i.e. Azure, not our backend, is blocking the call).
So I've tried to figure out how to get the local Angular5 instance to behave as the one hosted by the Web app but I can't figure out what I need to be doing. I have also been unable to find anyone else doing this so I can't find a solution.
I have tried various solutions of actively getting a token (e.g. setting up /.auth/me, using adal5 to "login", etc.) for the front end but it seems every possible solution is defeated by CORS in the end. Our backend has an Allow-Origin for localhost:4200 but this doesn't apply to login.windows.com for the authentication step. I tried putting localhost:4200 in the CORS setting on the Azure Web App but then it complains about an Allow-Authentication header being missing and I have no way to force Azure to provide that. I read online that this is happening because Azure didn't expect people to be using "cookie authentication" so after some research I found that "cookie authentication" was being used because of the "withCredentials: true" calls, so I changed all of those to false. Then the Allow-Authentication failure goes away but I just run into more CORS failures during the authorisation (login.windows.com).
So I'm really stuck here. I can't believe I'm the only person on earth who's trying to run a local instance of Angular5 against an Azure AD secured Azure Web app backend but I can't find any examples anywhere of people successfully doing this. I also would like to avoid having to do some elaborate local authentication because the code works perfectly as-is when hosted on the same Azure Web app as the backend. Does anyone have a setup like I describe that is working?

Azure Get Ip address of hosting server for Google Cloud Services

I have a Web Api 2 project that sends Push Notification to an android app via Google Cloud Services. Running locally, I can get my machine's ip address and set this in my included IP's for my service api in Google API console, which works fine. However, I now deployed to azure and this is no longer working. I did an ip looking on my site name, so for example mySite.azurewebsites.net, where the site is hosted, but this does not seem to work.
Is there a way I can get the ip address of the service that is hosting my asp web api project in azure?
Have a look at the following tutorial. This might help you out in finding out the the IP address of the web api project you have hosted on Azure.

Resources