deploy azure function from visual studio via proxy - azure

I am trying to deploy an Azure function project from Visual Studio 2017 to Azure but I am getting a proxy authentication error.
I have added the local proxy settings to Visual Studio config but still cannot get it to work.
<defaultProxy enabled="true" useDefaultCredentials="true">
<proxy bypassonlocal="True" proxyaddress=" HYPERLINK "http://<yourproxy:port#>"
http://<yourproxy:port#>"/>
</defaultProxy>
Is there anyway I can set the proxy in the JSON configuration similar to how it can be done in web application config to get around this problem?
I appreciate your help on this.
Thanks

I found a solution to this problem. If anyone has the same problem this may work for you
Add proxy settings for msdeploy.exe, you need to find it first (usually in C:\Program Files (x86)\IIS\Microsoft Web Deploy V3) and edit msdeploy.exe.config file
<system.net>
<defaultProxy useDefaultCredentials="true" />
</system.net>
In the publishing profile of your project (you can have multiple) which is located under your project > Properties > PublishProfiles, you need to add the following line so that it uses msdeploy.exe for publishing.
<UseMsdeployExe>true</UseMsdeployExe>

Related

How do I configure a .net core API to work in IIS?

I've got a .net core API created in Visual Studio 2017 that's working fine. When I go to deploy it I get error message HTTP Error 500.19 with error code 0x8007000d. I've found multiple solutions online such as making sure windows features are installed, removing the .net CLR version, changing the application pool identity, changes to web.config and applicationHost.config, but nothing has worked. Is there a way to definitively find what the problem is or am I stuck doing trial and error with the myriad of possible solutions? Any specific solutions you know of?
Here are screenshots of the IIS settings and my Windows features:
Here's my web.config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*"
modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet"
arguments=".\DishbooksAPI.dll"
stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout"
forwardWindowsAuthToken="false" />
</system.webServer>
</configuration>
Here's the IIS error:
Some stackoverflow pages I've tried (this is not an exhaustive list):
HTTP Error 500.19 when publish .net core project into iis
HTTP Error 500.19 with Error Code 0x8007000d visual studio 2017 while deploying .net core application
ASP.NET: HTTP Error 500.19 – Internal Server Error 0x8007000d
HTTP Error 500.19 - Internal Server Error web config .net core web api
asp.net core web api published in IIS after moved to different IIS server pc gives error 500.19
First of all, you need to install ASP.NET Core Module in web server.
Here is the download link.
Then install either SDK or Runtime in web server.
Trouble Shooting
If it still doesn't work, open a command prompt. Navigate to the web application folder and type dotnet YOUR_APP.dll. You should see something like this -
C:\APIs> dotnet YOUR_APP.dll
Hosting environment: Production
Content root path: C:\APIs
Now listening on: http://localhost:5000
Application started: Press Ctrl+C to shut down.
It means your application can run in the web server without IIS. Then you need to trouble shoot in IIS or some other things.
You would need the hosting bundle to be installed on IIS
https://dotnet.microsoft.com/download/dotnet-core
Steps :
click the preferred version
Search for 'Hosting Bundle' word (should be on the right side)
Install the same
re-start IIS. And validate your site and see the magic
Why Hosting bundle is needed? Check following article
https://dotnetcoretutorials.com/2019/12/23/hosting-an-asp-net-core-web-application-in-iis/
How to check if hosting is installed?
How to determine if asp.net core has been installed on a windows server

Core 2.0 Publish IIS HTTP Error 500.19 - Internal Server Error

I have read a lot of post with the same error I have. The problem I have is that I have it running on the same machine I developed the solution.
I have Windows 8.1 and IIS 7.5. Express I am running several MVC Framework XXX solutions on me IIS and I do not have problems. The problems appears when I publish a solution Core 2.0...
I have created a basic Web Core 2.0 MVC solution. Just the same project it is created by Default. (Created an Core 2.0 MVC and Publish it).
I have Visual Studio 2017, so I have installed SDK installed.
I have created a site in IIS (inetpub/wwwroot) for it, drop in the published code, and configure the App Pool to run "No Managed Code". I set port to 5010.
When I run the Project from cmd: dotnet core20.dll it says it is running listening on port 5000, instead on port 5010.
So, i set port 5000, but when i run it from cmd it shows an error.
Microsft.AspNetCore.Server.Kestrel[0] Unable to bind to localhost:5000 on the IPv4 loopback interface: Error 4092 EACCES permission denied. Unabled to start Kestrel.
Why it runs on port 5000 if I set on port 5010?
When I run it from Browser i have this error
My web.Config is the basic web.config created ruting the publishing..
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\core20.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
<!--ProjectGuid: 21dc60b6-a958-447d-8ed3-25a6195a06ea-->
On Windows Features turn on or off--> IIS Services--> Application Development Features, all options are selected
The error I have
I have the same problem with Core 2.0 Angular Application... So I miss to install something.
I have not installed the .NET Core Windows Server Hosting bundle. I do not know it is necessary.
I do not know if i have to install Kestrel, or how to install it.
I asume all this has to be installed when I installed Visual Studio 2017.
Any ideas what I am missing?
thanks
I have not installed the .NET Core Windows Server Hosting bundle. I do not know it is necessary.
There's your problem. Install the hosting bundle. Without it, IIS has no idea how to handle an ASP.NET Core app. In particular, your error here is because the <aspNetCore> tag doesn't exist for usage by Web.config, without that bundle either. So, while the error is a bit obtuse, it is technically telling you what the issue is.
Additionally, after installing the bundle, you must either restart your server or completely stop and restart the IIS service (not iisreset):
> net stop was /y
> net start w3svc
It's better to restart the server entirely, if you can, just to make sure everything is fresh, but starting and stopping web services should be enough to load in the ASP.NET Core module.
All of this is covered in the documentation.

Enabling basic http authentication in IIS on Elastic Beanstalk?

For a demo site on Elastic Beanstalk, I'd like to enable basic authentication in IIS (not in the app, but instead have IIS handle it). I can't find how to configure IIS to do this - you don't seem to have much access to IIS configuration itself. Any tips on that appreciated, or if I'm missing the boat here.
thanks!
You need to use ebextensions to customize the server.
Create a yaml init.config file inside a folder called .ebextensions in your web application root. Set the contents as follows:
container_commands:
00-iis-features:
command: dism /online /enable-feature /featurename:IIS-BasicAuthentication
Read more about ebextensions here
Also, see my answer here https://stackoverflow.com/a/42336644/1165140 on how to modify root IIS config.
Hope this sorts you out.

MVC 6 Hosted on IIS HTTP Error 500.19

Am getting HTTP Error 500.19 when accessing MVC 6 app in IIS on Windows 10.
In IIS I have set the App pool to 'No Managed Code'
The app is hosted in the root of a new Web Site.
I published the app using Visual Studio 2015 with the following settings.
Configuration : Debug
Target DNX Version: dnx-clr-win-x64.1.0.0-rc1-update1
The web.config is the boilerplate provided by Visual Studio
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>
</system.webServer>
</configuration>
Any ideas what is going wrong?
Thanks
Mike
For RC2 and above, HttpPlatformHandler has been replaced by ASP.NET Core Module
Install the new module from here.
The announcement can be found here.
Figured it out, I needed to install the httpplatformhandler
http://www.iis.net/downloads/microsoft/httpplatformhandler
You have to install the "Hosting Bundle Installer". Without this, IIS doesn't understand routing and cannot host your application.
Go to microsoft site "https://www.microsoft.com/net/download/dotnet-core/runtime-2.1.0-rc1" and install "Hosting Bundle Installer":
Before installing this you have to install the right version of runtime:
https://www.microsoft.com/net/download/dotnet-core/runtime-2.1.0-rc1
Than install the right version of "Hosting Bundle Installer".
"Hosting Bundle Installer" is:
.NET Core Windows Server Hosting bundle installs the .NET Core Runtime, .NET Core Library,
and the ASP.NET Core Module. The module creates a reverse proxy between IIS and the Kestrel server on Windows platforms.

HTTP Error 403.14 - Forbidden asp.net 5 & MVC 6 iis10

I know this question has been asked and answered a few time but those questions are slightly different and the answers to those questions do not resolve my issue.
I have a asp.net 5 & MVC 6 application that works fine in IIS Express and self hosted in WEB. However when I publish to a folder and point IIS at the wwwroot folder I get the HTTP Error 403.14 - Forbidden error.
I have tried IISReset and I do have a default root.
Requirements
Windows 7 or better
Windows Server 2008 R2 or better
Have IIS installed
Procedure
First, make sure you have the HTTP Platform Handler installed in your IIS (x86 / x64).
Publish your application to the file system and take the content of the \artifacts\bin\MyWebApp\Release\Publish folder and copy it into your IIS Server.
When configuring your application, target the wwwroot folder that you copied over.
Now you'll need to unlock the system.webServer/handlers section which can be found in IIS Manager on the server node under Configuration Editor. Search for the right section and unlock it from the right action pane.
Make sure that the App Pool is set to No Managed Code. DNX is being run as an external process. IIS doesn't need to know about what it's currently running.
Finally, create a web.config with the following content:
<configuration>
<system.webServer>
<handlers>
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="false" stdoutLogFile="..\logs\stdout.log" startupTimeLimit="3600"></httpPlatform>
</system.webServer>
</configuration>
It should be running at that point.
Source

Resources