I have a Azure Linux web app. I can upload files via FTP (for example test.html) but then accessing them (https://mysite.azurewebsites.net/test.html) gives a 404. The files are there, and I can see them in kudu console, but I get 404? I even deleted the "hostingstart" file yet going to https://mysite.azurewebsites.net still returns the hostingstart file content? Do I need to trigger a "redeploy" somehow? The documentation I have read just says "upload the files via ftp to /home/site/wwwroot which is what I have done.
???
I turned on all logging, but was getting nothing meaningful. I raised a support ticket and got a response that explains it. A .Net platform on Linux cannot serve static content;
response from Microsoft:
Analysis:
http://mysite.azurewebsites.net/
Is a Linux web app with the custom image
DOTNETCORE|3.1
Hosted inside a B1 App Service Plan
The requests are served by a single Small web worker.
This type of web app expects .Net Core content not plain HTML. If you want to deploy plain HTML you can use a Windows web app or a Linux web app with PHP, as on a Windows web app there is IIS and on PHP there is Apache as web servers that by default are able to serve static content also.
for static content you can also use only your storage to deploy.
https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website
Related
I am hosting an angular application in azure web app. I want my application should be only accessible on chrome browser. If someone access the site from other browser then user should redirect to browser restriction page. So to achieve this is there any policy available that can be added to web app, instead of writting the code to detect the browser and then redirect?
Rajesh
Azure web app does not have the functionality to restrict access to the browser as you described.
Reason
Azure app service (Windows & Linux) is essentially a webserver running in a sandbox, which is no different from real IIS or Nginx and Apache.
WebServer provides program deployment and access functions, and only receives HttpRequest. As for the information contained in HttpRequest, azure app service does not provide analysis.
For example, adding User-Agent: Chrome is the specific information contained in HttpRequest. This means that we can only determine the source by parsing the HttpRequest through the code.
I have a java jsp project need to upload to azure web apps. So I created web app service but in ftp there is no web apps folder, so I created one but still I can't access it.Any suggestions please.
First, make sure your App Service Web App has Tomcat as the Java web server in general settings:
Then make sure your JSP files are copied under /wwwroot/webapps/ROOT/
You might need to restart the web app after your files are deployed
For more information, please check our quickstart and configuration guide:
https://learn.microsoft.com/en-us/azure/app-service/quickstart-java
https://learn.microsoft.com/en-us/azure/app-service/configure-language-java
I have built a web app that has a Vue front-end and an express back-end.
I am trying to host these on an Azure Web App Service but I am a complete novice with Azure.
I have gotten the web app working fine when I place the Client side in one web app and the Server side in a different one.
I want to have both running in the same web app.
From researching online it seems that I need to go to:
my web app-> configuration-> path mappings ->Virtual applications and directories.
I created a new application with Virtual Path "/app" and physical path "site\app".
I deployed (using visual studio code) my back-end to my azure web app and thus this sits inside wwwroot.
In filezilla I create a new folder in the site directory called "app" and paste in my built Vue client side.
However, when I try to navigate to www.myapp.azurewebsites.net/app I am not presented with the expected Vue index.html rather a 404. If I just navigate to www.myapp.azurewebsites.net/ I get the default route from the server side as expected.
What am I doing wrong?
When creating a webapp, please choose Windows operating environment, because currently choosing Linux does not support Virtual Application and directories.
The directory structure should be like below.
Setting in portal.
For more details, you can refer my answer in another post.
I develop simple Web Api on Net Core 2 and add Angular app to it (inside wwwroot folder) and publish it from my VS 2017 IDE to Azure Web App Service. All work fine, but when I reload page of my app in browser, server can't find route. So It often happens when iis not setup for SPA, It's described in https://angular.io/guide/deployment, I must configure the server to return the application's host page (index.html) when asked for a file that it does not have. How I can setup server node of iis in Azure Web App Service (web.config in Net Core 2 was deleted).
I am afraid you cannot achieve this.
Cause: Azure App Services runs IIS so it behaves mostly the same as local IIS, routing requests using a native module called AspNetCoreModule. So, it needs your published web.config file. Even though you deleted the web.config file, Azure would also generate a new web.config file to be used.(Though I don't understand why you delete the web.config file)
Solution:
Even you can upload the web.config file to Azure again, I'm afraid of that it will be ignored and doesn't work. So, I suggest you redeploy your website which contains web.config file to Azure and configure it well.
Additional: Azure Web App service is a kind of PaaS. So, if you want to install IIS manually, you can choose to host your website on a Windows Azure VM.
I have created a Azure Web App and published my application from Visual Studio and I can access the website as expected. However, the aspx web pages in the website use calls to PageMethods using the asp.ScriptManager. All works fine if I host through IIS on a web server but any calls when hosted as an Azure Web App returns "Object doesn't support property or method....".
After some more investigation, I get 'Sys' is undefined and checking the network monitor, WebResource.axd and ScriptResource.axd return a 404. Odd
Does Azure not support this? Or am I missing some configuration?
Found the solution. I was running the WebApp in Classic mode. Switched to Integrated mode and the script files are delivered.