I tried several times to publish my website from Visual Studio 2019 to the Azure server but I getting errors.
I have an MVC-CORE 3.0 project which works fine using IIS EXPRESS (localhost).
In my web-application, there is a login page (home page), which is the first view. It perfectly works both on Azure and the localhost.
But once I using the published website and log in to my account (=move to the next view), I got this error:
*The login process works great using localhost
*I already published my app 2 months ago and it perfectly worked!
This error appeared just after republishing (private needs).
Please HELP ME !!!
I think you should try these way to solve you issues.
According to your describe, you can open you site correctly. But when you do other operations, the error occured. Here are my advice,
Tips 1, check your web.config file ,make sure you dbConnection is correct. Pls pay attention to Connection strings in portal.And the priority on the portal is higher than that in the web.config.
Tips 2, check your web.config file ,modify the config, like the post. Add settings like below,
<configuration>
<system.web>
<customErrors mode="Off" />
</system.web>
</configuration>
If my advices don't work, you can try to solve the problem by Monika Reddy-MSFT's way.
Update
If you can't open you site correctly, pls check Stack settings in portal.
And next time when you republish your apps, you can backup publish file first in order to restore previous version. Or you can publish your app in slot, if it works fine then you can swap it.
Have you tried to set the environment variable inside the web app on Azure?
If not, please try this:
Open the Application Settings blade --> Scroll Down to -->"Application Settings" --> add the "ASPNETCORE_ENVIRONMENT" and "Development".
Also please take a look at this doc for more reference.
I run my laravel app #localhost.
```php artisan serve --host=localhostIP```
On top I run an Andoid app with the same base URL.
Could anyone tell me how can I debug incoming API´s calls
like if BASEURL/users is called?
Furthermore, how can I log the happening events in the console
I am developing API's with laravel too, i do it this way:
composer require laravel/homestead to have it all in a vm 😉 see https://laravel.com/docs/master/homestead for more information, i use the "per project" installation
Download postman to have the best tool for sending querys to your api and to test your api quick -> https://www.getpostman.com (i use it free)
configure and run your homestead (it's not that complicated).
your homestead is fit with php and xdebug enabled
i am using phpStorm and have my vagrant setup as deployment target
"listen to debug" with phpstorm
to your GET requests, add a queryparam XDEBUG_SESSION_START=PHPSTORM
i can debug my api now 😉
i also wrote https://logcrawler.de to receive the log informations of all my api's and all my server 🤩
I hope, i could help you a little bit
This is my way, but I think it's not good!
Create router api in config/web, Eg:
router/api: Route::post('/check_api', [CheckController::class, 'testFunc'])->name('api.check_api');
web/api: Route::post('test/check_api', [CheckController::class, 'testFunc'])->name('test.check_api');
Create a post by form or ajax in one resource/view like index
Go to page, and debug with phpstorm
You can use logging feature of Laravel. Apply Logs on entry point of application to test whether API url is hitting or not.
use postman
https://www.getpostman.com/downloads/
it's an excellent thing very much usefull
I am in a corporate env so I have to use a proxy to reach servers. This works well in postman and in browsers. What I can't reach is localhost in postman but I can reach localhost in the browser.
I am running Postman for Linux Version 6.0.9. I have tried reaching localhost:9082/rest/myapi.... and 127.0.0.1:9082/rest/myapi with both global proxy and system proxy turned on and with either turned on and with non turned on. In all cases I am not able to reach localhost.
What I get as an response is an error page from the proxy server! Someway the call gets out on the network instead of being kept on my machine.
The postman console:
My request headers are:
Cache-Control →no-cache
Connection →Keep-Alive
Content-Length →986
Content-Type →text/html; charset=utf-8
Pragma →no-cache
Proxy-Connection →Keep-Alive
My response headers are:
cache-control:"no-cache"
pragma:"no-cache"
content-type:"text/html; charset=utf-8"
proxy-connection:"Keep-Alive"
connection:"Keep-Alive"
content-length:"986"
My response body is an html page.
How can I make a call to localhost work with postman?
I was having similar issue with HTTP calls to local ASP.NET Core Web API apps. Changing the proxy settings didn't fix it for me.
Finally fixed it by turning off File > Settings > General > SSL Certificate Verification
I have the same issue. What works for me is:
Open File -> Settings -> Proxy
Then, enable proxy and put 127.0.0.1 : 80, if your web server runs on 80.
In the git thread, they say it is a known issue, so hopefully it will get resolved soon.
I solved this by Turning off System proxy of Postman.
Open File -> Settings -> Proxy
Then Turn off Use System Proxy
#Menuka Ishan Answer is correct. But in mac only if we change the turn off proxy won't work. You need to turn off the SSL Certificate verification also you need to disable.
I found a temporary solution:
In terminal, go to the directory where postman is installed and add:
machine#dev:~/Documents/Postman$ export NO_PROXY=localhost,127.0.0.1
machine#dev:~/Documents/Postman$ ./Postman
This will make calls to localhost work.
I found a similar problem on Windows machines here
The problem mentioned as an issue here. You should just write a simple batch file like this:
set HTTP_PROXY=
set http_proxy=
set HTTPS_PROXY=
set https_proxy=
START %LOCALAPPDATA%\Postman\Update.exe --processStart "Postman.exe"
open a simple text file, save this as a ".bat" file, and just run it!
I also faced the same issue, but the trick was I implemented both the methods that were stated earlier in the stack.
First I turned off the postman proxy as shown in below image.
Click Settings -> Proxy
And then turned off the SSL certificate verification check button.
Click Settings -> General
And then tried to hit my local server and finally it worked.
While attempting to Get https://localhost:5001/WeatherForecast via PostMan while developing a basic .NET Core (3.1) Web API (on Ubuntu Linux)
I got the error:
Could not get any response There was an error connecting to
https://localhost:5001/WeatherForecast.
I didn't notice the actual solution in the things to try at first, but if you check the highlighted text in the image you will see it.
You can see that the option is turned on in PostMan by default:
I turned the SSL Certificate Verification off and tried again and it worked.
If you are under corporate proxy and you are deploying your webapplication in localhost then no need to set proxy configuration like
http://username:password#corporateProxyServer:ServerPort in postman (Global Proxy Configuration).
As the app is deployed in local machine just use the localhost configuration in setting -> Global Proxy Configuration as :
proxy server : 127.0.0.1
port : 8300 (this is the port where the web application is running )
My problem was that i was setting an invalid Header token and it gave me the error
Error: Header name must be a valid HTTP token ["Accept "]
Warning: This request did not get sent completely and might not have all the required system headers
Just check your Headers.
Adding another potential answer to this for people to check after they've tried the other ideas here.
I was able to solve my own problem by checking the Postman console (View -> Show Postman Console) and then examining the error from the request (in my case it was because I had a newline character on an auth token).
In my case, I had to precede the localhost with https://
These steps solved this issue after 1 whole day struggle:
1) HTTP_PROXY= proxy.company.com:port
HTTPS_PROXY=proxy.company.com:port
to user variables, not to System variables. Make sure the the case is all cap.
2) Updating newtwork driver, and turning on Windows Defender......Make sure you don't see no reds in here.
I was not able to make any calls from postman to docker container running Couchbase Server. Very frustrating. Turns out I had proxy setting configured to some aws instance which has been long deleted.
Goto setting and remove the proxy setting and it worked like a charm on localhost/127.0.0.1/mac laptop eno IP addr or 0.0.0.0
In my case, I was using django-tenants and had to add the domain for the tenant in etc/hosts to get it working on localhosts. My entry for 127.0.0.1 now looks like
127.0.0.1 localhost test.localhost
My problem was forgetting to select Environment. From the drop down where you see No Environment in the image, select the name of your environment.
Menuka Ishan's solution above saved my hours of pain! I left the Global Proxy Configuration switched ON and changed the Proxy Server to 127.0.0.1. Switched OFF the Use System Proxy. I already had the entry 127.0.0.1 localhost in my hosts file under the path C:\Windows\System32\drivers\etc.
If you have active proxy in your system then make sure Global Proxy Configuration and Use System Proxy are turned off. To do this go to Postman preferences > Proxy. You can also try sending a request in postman without typing localhost (e.g. :8080/send)
i think i also found a perfect fix.
First you turn on global proxy configurations, add your local machine Ip which is 127.0.0.1,then also add localhost in the bypass.
Also turn off SSL verification.
It worked for me
This worked for me, i dissable the parrameter host in the header.
HOST Disabled
If anyone is looking for a solution to WooCommerce local install, here are the steps to make this work:
Go to Wordpress Admin > WooCommerce > Settings > Advanced
Create new API key, give it a name
Copy the Consumer Key & Consumer Secret to
your text editor
Open Postman
Create new connection Set the URL for
testing (GET) : http://mylocalsite/wp-json/wc/v3/orders (change
"mylocalsite" to yours)
Click on Authorization tab
Now here is the main change: Although in WC Rest docs, it says to use the "Basic Auth" - IT WILL NOT WORK. Since usually your localhost is HTTP
and not HTTPS. So "Basic Auth" is not relevant in our case.
You will need to change the Authorization to OAuth 1.0
Set Consumer Key & Consumer Secret respectively as it shows in Woocommerce
Click "Send" - it should work now
If still you have problems, try one by one the following:
File > Settings > Turn off SSL Verification
File > Settings > Turn off "Automatically follow redirects"
I go throught the intranet/internet using proxy auth.
I'm not familiar with automation throught a proxy or proxys, in IExplorer we set up the proxy on LAN settings in "Use automatic configuration script" with something like:
http://some-url/url/file.proxy
Uncheck "Automatically detect settings" and we don't set any in the "Proxy Server" section.
So we can go "out" (internet/intranet).I have a username/password so everytime I just open a new IE instance, I got a prompt for them. How should I set this values on PhantomJS to get access to the network/internet ? I jus can't make it work, everytime I try to get a screenshot from anypage I got a webpage screenshot related to the proxy auth.
I've tried set the full/script.proxy url in the proxy prop and username/password but didn't work. Hope someone can provide an example for my understanding. Also I'll appreaciate some resources/good-to-read articles.
Got it.
I take a look to the script I just mentioned in my question, and just got the proxy (ip:port) needed in phantomJS.
Basically the script do some decisions about what proxy to use based on the requested url and return the proxy ip.
So the PhantomJS docs it's preety straightforward, I wasn't understanding how my proxy was set (by script),if it's your case, you can copy/paste the script url into your browser so you can analyze it and retrieve the information you need to setup phantomJs
he code in the proxy script is kind of easy to read (if you have any programming experiencie).
I have cornered this error down to a redirect action call by DotNetOpenAuth(http://www.dotnetopenauth.net/)
Basically I have implemented the example here
http://www.dotnetopenauth.net/developers/code-snippets/programmatic-openid-relying-party/
In my application while running locally I hit this line
return request.RedirectingResponse.AsActionResult();
At this point it completes this action and then the azure dev fabric load balancer crashes.
Here is where it gets strange. If I debug line by line into the redirect action it will not crash.
Has anyone seen anything like this that can give me some direction on a fix?
#dthorpe points out that I should tell you all I have tested this by deploying to the production environment and this does seem to work.
We had same problem. There is no fix I currently know of and application still works fine, while deployed in the cloud.
Yet for the local testing purposes I merely introduced switch (it could be compile-time ifdef DEBUG or configuration switch). Whenever there is attempt to authenticate via the OpenID in local dev fabric, we immediately assume the identity is valid and authenticated by the DotNetOpenAuth. This worked for us and allowed to move the development forward.
I have a fix. It's a slight hack, but it does work and you don't have to fake anything.
Change this:
return request.RedirectingResponse.AsActionResult();
to this:
string location = request.RedirectingResponse.Headers["Location"];
return Redirect(location);
This gets around the issue and allows authentication to proceed. I'll allow someone brighter than myself to give a detailed explanation as to why this is the case.
Hope this helps!
If anyone's looking for a quick fix for this, one option is to turn off Azure diagnostics, if you happen to not be using it. This is added to the web.config when you create your project, just comment out the "add" element as shown and you're done.
<system.diagnostics>
<trace>
<listeners>
<!--<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>-->
</listeners>
</trace>
Of course this turns off diagnostics so only do it if you're not using diagnostics!