Kudu Debug Console access denied error when trying to save edits - azure

I'm getting the following message when trying to save edits to rootweb.config:
Could not write to local resource 'D:\local\Config\rootweb.config' due
to error 'Access to the path 'D:\local\Config\rootweb.config' is
denied.'.
I'm trying to add the following to the file's default configuration after uploading my PHP project (my PHP project didn't include a web.config file):
<system.webServer>
<security>
<ipSecurity allowUnlisted="false" denyAction="NotFound">
<add allowed="true" ipAddress="<ip-address>" />
<!--add allowed="true" ipAddress="<ip-address>" /-->
</ipSecurity>
</security>
</system.webServer>
Is this file supposed to be editable, or do I need to include my own web.config?

Based on another Stack Overflow post I believe you just want to make a web.config and put it in the folder of your php app. You can not edit the configs in that folder you tried to access. You can modify the applicationHost.config via a site extension with a transform. I have experience doing that.
Windows Azure and web.config doesn't run with PHP web site
About Site extensions:
https://github.com/projectkudu/kudu/wiki/Azure-Site-Extensions

Related

Azure vue issuse with missing server.js/app.js?

I am new to web development and I have tried to upload my vue app to a azure web app service but i am getting some problems
so when I try to try to open the webpage up it says
"You do not have permission to view this directory or page."
I have been trying to follow a few guide about a web.config file, and when i added it, the message disappered, but now it shows nothing. Then i tried to take a look at my output when i try to upload my code, here it says
missing server.js/app.js
my app file is a vue file, but i don´t really know how to fix this, it´s also not located at the root but in a src folder
i added the web config file to the public folder
<configuration>
<system.webServer>
<!-- indicates that the index.js file is a node.js application
to be handled by the iisnode module -->
<handlers>
<add name="iisnode" path="index.js" verb="*" modules="iisnode" />
</handlers>
<!-- adds index.js to the default document list to allow
URLs that only specify the application root location,
e.g. http://mysite.antarescloud.com/ -->
<defaultDocument enabled="true">
<files>
<add value="index.js" />
</files>
</defaultDocument>
</system.webServer>
</configuration>

Azure Web App Virtual Application, The resource you are looking for has been removed, had its name changed, or is temporarily unavailable

I have an Azure Web Application with Virtual Application configured under the Path mappings section. The virtual path /SP2019resources has the Physical Path as site\wwwroot\SP2019resources.
My Azure DevOps pipeline will upload the contents (SharePoint SPPKG files) to this virtual path. And I have already verified that the contents are there, however whenever I formulate a URL as https://{AzureAppName}/SP2019resources/{PackageName}.SP2019.sppkg and open it in the browser the file is not getting downloaded and always getting an error as "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.".
Here is the file view from my web app SCM.
Any idea what I am missing here?
After spending some time with this issue, I understood what I am missing. Essentially, you will need a Web.config file in your virtual application folder to handle the requests.
The content of the file can be as follows.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<clear />
<add name="StaticHandler" verb="*" path="*" type="System.Web.StaticFileHandler" />
</handlers>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
After I add this file to the /SP2019resources, the files inside were getting downloaded.

IIS Can't Serve .LDF or .MDF extensions

I'm trying to serve the extensions .ldf and .mdf and even though files of these types actually exist on the server, IIS keeps throwing 404 error whenever they are requested.
I've double checked IIS manager and both extensions are added MIME-types of application/octet_stream. Is there perhaps some other setting or place I've missed that needs something set?
Thanks for your help chaps.
Adding the following to web.config worked as suggested by Sergey Kornilov:
<security>
<requestFiltering>
<fileExtensions>
<remove fileExtension=".ldf" />
<remove fileExtension=".mdf" />
</fileExtensions>
</requestFiltering>
</security>

Azure Cloud Services, deny access to subfolder using web.config

I have PHP application that I develop on my local Server 2008 dev server, I then push this to my live site on Azure Cloud Services. This all works fine. In one of my sub folders I have a web.config file with the following in it:
<configuration>
<system.webServer>
<security>
<authorization>
<remove users="*" roles="" verbs="" />
</authorization>
</security>
</system.webServer>
If I attempt to go in to that folder, or view any file in a browser on my dev server I receive the message:
401 - Unauthorized: Access is denied due to invalid credentials.
Which is great!.. If I attempt to go to a file in that folder on my live site, it displays the file just fine. It is completely ignoring the web.config file. I have connected to the running cloud instance of my live site, and can see the web.config file in there.
Why is it being ignored on Azure, but working fine on my dev site?
In case anyone else has the same issue, you need to add a location element to your root web.config/web.cloud.config. It needs to be directly within the configuration element like so:
<configuration>
.....
.....
<location path="--folder or file--">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
</configuration>

How to provide an .exe file as download on Windows Azure Website?

I am trying to publish a ClickOnce installer onto a website which is hosted on Windows Azure. The publishing process works as expected, nontheless the setup file is not available for download via HTTP. Obviously it is not possible to provide executables (.exe) and libraries (.dll) via HTTP. They are available via FTP, but HTTP requests yield a 'File not found' (404). After renaming the file to setup.txt, it can be downloaded, this doesn't really help, though. Can this be configured somehow?
Please try by adding the following in your web.config file:
<system.webServer>
<handlers>
<add name="Client exe" path="*.exe" verb="*" modules="StaticFileModule" resourceType="File" />
</handlers>
</system.webServer>
Source: http://mike-ward.net/blog/post/00631/how-to-configure-iis-7-to-allow-downloading-exe-files.
Add the allowed mime type to web config. Eg:
<system.webServer>
<staticContent>
<mimeMap fileExtension=".exe" mimeType="application/exe"/>
</staticContent>
</system.webServer>

Resources