Publish Static Website Using Azure - javascript

I have a single html file (index.html) and an image that I tried to host on Azure.
I put them in a dropbox folder and synced, the website got published and Azure status shows running.
I go the webpage and it shows:
You do not have permission to view this directory or page.
Do I need to add anything to make the site work?

You do not have permission to view this directory or page.
In general, when you access your web app : https://{webapp-name}.azurewebsites.net directly, you'd better make sure that the default documents you defined of your web app could be found within your web app. You could leverage KUDU or Azure App Service Editor to check whether your files exist.
#Dai No in Kudu I don't see the files...no index.html and my image file is there.
As I known, Azure would sync the changes (e.g add/remove file(s) in your DropBox deployment repository) and deploy the changes to your web app.
Note: When you delete file(s) synced from DropBox under your website folder(e.g D:\home\site\wwwroot\), the deleted file(s) couldn't be synced from DropBox in subsequent deployments. You could log into Azure Portal, choose your web app, select "APP DEVELOPMENT > Deployment options", check your deployment logs as follows to see the synchronization log.
According to your description, I assumed that you could log into Azure Portal, disconnect your deployment options and setup your DropBox deployment again. Also, you need to check the synchronization log mentioned above and check your files in your website folder via KUDU or Azure App Service Editor.

Related

How to display a page in Azure Apps Service?

I am trying the sample code below.
https://learn.microsoft.com/ja-jp/azure/storage/blobs/storage-upload-process-images?tabs=javascript%2Cazure-powershell
I was able to move locally.
(Start URL: http: // localhost: 3000)
We are deploying the code to Azure Apps Service as a Zip file.
However, even if I access the site URL, it cannot be operated.
(Start URL: https: // {azure apps service} .azurewebsites.net)
I'm wondering if I should set Web.Config, but I don't know what to write.
If you know what to set in WebConfig with the above code, I would appreciate it if you could tell me.
Also, if there is a solution other than this, I would appreciate it if you could tell me that as well.
I have followed the document which you have provided and it is working fine for me.
I am able to upload images and check them in storage account.
"You do not have permission to view this directory or page."
The root reason can be there is no default page in your Azure website.
when you deploy the zip file via the azurewebsites.net/ZipDeployUI, make sure that you see the files being unzipped on the /wwwroot level.
If the files show up under /wwwroot/your-app-folder/ you may get this permission issue.
You could directly view the page with url.
https://{siteanme}.azurewebsites.net/views/yourpage.html
Add the default document in the project root folder and set it as default page in appsetting on the Azure portal and save the setting.
The default document is the web page that is displayed at the root URL for a website.
Navigate to KUDU url: https://<your app name>.scm.azurewebsites.net/DebugConsole and go to site\wwwroot to check if the files are contained within a directory.
If you find any files missing , re-deploy the app.
OR
Just for checking Temporarily, drag the local files directly to the d:home\site\wwwroot directory and try again.
For debugging purposes you can turn on the Azure detailed messaging.
Login to Azure > App Services > Your Web App > App Service logs , then turn on Detailed Error Messages or turn on all of the logging options.
Add the below in your Web Config file,
add <customErrors mode="Off" /> BEFORE system.web closing tag, </system.web>. Similarly, add <httpErrors errorMode="Detailed"></httpErrors> BEFORE </system.webServer>.Upload the Web Config to Azure.
This will show the error messages in detail , from there you can figure out the exact issue.
Please refere SO thread for more details.

Chrome App - Dynamic Javascript

I have a Chrome App that displays slideshow/dashboard on the screen. Right now all of the website files (html and .js) are stored in the app. So when the application starts, it can be used completely offline because all of the files it needs are stored internally.
I'm looking for a way to host the dashboard's files (.js files) on a web server, that the app will query, pull down, and cache fresh copies of at startup. This will make it easier to update the dashboard but still allow it to be (mostly) offline.
I have been able to have the app query the server successfully and pull down the Javascript files as strings. Normally, I would just inject the JavaScript into the page but that's not allowed with Chrome Apps. My question is, how can I take the JavaScript (pulled down from the server) and load it in the page?

How to view local files in web browser by displaying and creating a link to local files stored in your computer in your webApp?

I have created a webapp using JSP,Html and Javascript which currently runs on my localhost using apache webserver. I want to display the files and folders and of a directory in local computer. I also want to create a download link or view link of those so that when anyone click on it it will be viewed in new tab or become downloadable as it happens in any ftp server. I know similar type of question has
been asked but none of them worked for me.
To create the download link I used
Download
this does not work as it is not in my webapp path and download attribute also does not work in internet explorer.
I'm not sure why you are exposing your local drive contents on the web but here's an option:
On the page that should display the files, in java code, list all
folders and files then for each file/folder show a link to some page
(for example "navigateLocalDrive" that sends the path of the clicked
file/folder like this:
Download
Now in that jsp, check if the GET variable is a path for a file or a directory,
if its a file, just send it back in the response, if its a
directory, list all files/folders and do the same as in step 1
Please note:
How I encoded the file path in the href in order to work properly.
The Access permissions for the webserver should allow write/read to that path (I'm already doing it on my Tomcat server on local host with the default setup no change needed)
For your reference, here are some helpers for this task:
How to list contents of a server directory using JSP?
Downloading file from JSP/Java
I am not sure if this is possible. In general the access rights are limited to the src and webContent Folder (for your html coding mentioned above for sure) . This is also reasonable, because you do not want to access or change data on your Computer in general, because after local development you want to deploy your web application to a server.
To make a test copy some file to the webContent and you will be able to download it. Within your Java coding you can use some IO package like java.io.File to navigate over folders and files. However keep in mind, that you will get some exceptions like
java.io.FileNotFoundException: C:\WeatherExports\export.txt (Access is denied)
if you want to access files outside the server.

Guacamole VNC File Transfer

I am using Guacamole HTML5 clientless VNC viewer. I am trying to upload a file via Guacamole over VNC. Is this possible?
I looked at the application's homepage and this function seems possible. There is an event called onfile in guacamole.all.js, but there isn't a code sample to replicate this functionality.
How do I upload a file via Guacamole over VNC?
Guacamole uses SFTP to transfer files back and forward to the computer, so it doesn't transfer files over the VNC connection like TightVNC can. This means that you will have to setup an SFTP server on the computer running the VNC-server to be able to transfer files to the computer. If you have done that, you will have to provide the SFTP server details in your connection details page.
Once everything is setup properly you can start uploading and downloading files. For uploading you need to set a "standard uploading directory" in your connection properties. To upload something to that directory simply drag a file and drop it in the view screen in your browser. A little dialog with the upload process will appear and the file will be transferred to the remote computer!
For downloading open the guacamole menu while viewing your remote computer by pressing ctrl+alt+shift. If everything is setup properly you will see a device which you can browse and select the files you want to download. Good luck with this.
P.S. If the VNC-server is running on a windows machine, look at freeFTPd. It's a free lightweight program that can be setup to start at windows startup. Perfect solution for using with guacamole. If you are running linux it shouldn't be too hard to find an sftp server.

Not able to see changes to UI files while using Websphere Liberty Profile through Eclipse on Mac

Within WebSphere Application Server Liberty Profile Guide for Developers pdf in section 1.4 (Frictionless application development), it mentions:
By default, the Liberty profile will monitor deployed applications for changes.
Updates to static files (HTML, CSS, or JavaScript) or JSP files are detected and
served immediately. Changes to servlet classes cause an automatic restart of
the application.
I am not deploying via dropins folder. I have a configured server.xml file within Eclipse
<application location="/Users/path/my_application.ear" type="ear"></application>
I am not able to make any changes to my source UI files and see updates on WebSphere.
I am also not able to find a particular js file deployed anywhere, so it seems the *.ear file is not expanded, so I could edit the file directly on the server.
The only way I can see changes to my UI files is to make the changes to the source files and rebuild the ear file.
I feel like I am not creating a proper mapping to my source files and/or perhaps the Liberty profile on Mac doesn't explode the ear files so that I can edit the deployed UI files.
Thoughts?
If you want to have automatic updates of your files on the server, the best way is to use Eclipse to deploy the project to the server using "Add Remove" option on the server. This configures server.xml to point to your expanded app in the workspace. As result any changes to the files in the workspace are visible and detectable by the server.
If you configured your server.xml with path to the ear, it will monitor only for ear changes. And since your UI files are in totally different place, changes are not detected unless you rebuild your ear.
For deployment options to Liberty see the following links:
Adding and running an application on the Liberty profile by using developer tools
Deploying applications to the Liberty profile
It is possible to indicate path to an already deployed application, in my case it's a web application:
<webApplication location="\programs\wlp\app1_war" name="app1" contextRoot="app1">
<classloader delegation="parentLast"/>
</webApplication>
Changes in some scripts will be loaded automatically, but java classes are loaded by class loader when server starts or when app is redeployed.
See classLoader and classloaderContext, maybe there is a way to make class loader to reload classes at change:
https://www.ibm.com/support/knowledgecenter/SSD28V_8.5.5/com.ibm.websphere.wlp.core.doc/autodita/rwlp_metatype_core.html?view=kc#mtFile17

Categories

Resources