Hi @Abdullah Alhomedna I have tested making edits to my JavaScript function app through Azure portal and could upload a file using Kudu console without any issues.
I have created the app using Node 20 LTS version and windows OS. Here is my environment variables configuration of my Function app
If you see an Environment variable with name WEBSITE_RUN_FROM_PACKAGE
, delete that setting and restart the app to see if that helps.
Here are my configuration settings
Please let us know the error message you are encountering to help us better understand the issue.
Alternatively, you can use other development tools such as VS Code or Visual Studio to develop and deploy the changes to the code and upload new files to the Function App. If you are using VS Code, you can use the Azure Functions extension v1.10.4 extension to create a function app locally and deploy the code to an existing function app or a new app. Please refer the QuickStart guide for detailed steps on the set up.
Here is a sample project directory where I have added a few files to the function app through my VS Code under assets directory of my function app project.
Once deployed, the files would be available under base directory "C:\\home\\site\\wwwroot\\src\\"
of the function app if it is hosted on Windows OS. I can access the file as follows through my code
const baseFolderPath = "C:\\home\\site\\wwwroot\\src\\";
const fileRelativePath = "assets\\apim-liquid-json-parse-policy-sample (1).txt";
const filePath = baseFolderPath + fileRelativePath;
fs.readFile(filePath, 'utf8', function(err, data) {
if (err) {
return context.log(err);
}
context.log(data);
});
Hope this helps!