Azure App Service custom deployment (kudu) - permission denied - azure

I've an App Service running in Azure, it's only a simple node.js app.
I wanted to use a custom deployment script (because I've to execute npm install in a subdirectory) as it is described here:
https://github.com/projectkudu/kudu/wiki/Customizing-deployments
https://github.com/projectkudu/kudu/wiki/Custom-Deployment-Script
https://medium.com/#premchandrasingh/custom-continuous-deployment-script-kudu-for-azure-75217ddcebc5
After uploading the deployment package (via .zip file), the execution of the script "fails".
Reason:
/opt/Kudu/bin/Scripts/starter.sh: line 2: /tmp/zipdeploy/extracted/deploy.sh: Permission denied
There must be any problem with kudu or the VM of the webapp.
Any idea?

Related

Azure App Service - Install .msi using Azure DevOps Pipeline or Kudu terminal

Need to install LibreOffice to my Azure App Service.
1. Azure DevOps
I used powershell Start-Process to silent install but getting Permission denied.
Start-Process: /home/vsts/work/_temp/5cc8c99d-ed13-4b1b-823b-3cd9b56fdd1b.ps1:5
Line |
5 | Start-Process /home/vsts/work/1/s\LibreOffice_7.4.0_Win_x64.msi -Argu …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| An error occurred trying to start process
| '/home/vsts/work/1/s/LibreOffice_7.4.0_Win_x64.msi' with
| working directory '/home/vsts/work/1/s'. Permission denied
2. Kudu terminal
Getting Access Denied error when trying to run Start-Process manually.
Are there any alternatives to achieve this?
Not possible to install something on the host. The alternative is to use a docker container which has it already installed.
https://azure.github.io/AppService/windows-containers/
App Service supports Windows Containers! Deploying your application in a Windows Container enables you to bring along dependencies such as custom fonts, cultures and GAC deployed assemblies. When deploying a containerized application, the Windows Container is an isolation and security boundary. As a result, calls to libraries that would normally be blocked by the Azure App Service will instead succeed when running inside of a Windows Container.

Permission denied on deploying react web app on azure

I am deploying a react web app on azure by creating a workflow on github.
Now after committing changes it shows an error on creating build as:
The same error occured when I was deploying it using surge.sh
Can anyone help me out?
It seems to be a problem related to the Node.js module in your repository. Therefore, I suggest you do the following
Part 1: Reinstall the Node module
yarn uninstall
yarn install
Part 2: Redeploy the project via GitHub Action
Part 3: Deploy the React app directly from Azure Portal
Adding to Mark's response. Try the following steps to further narrow-down the issue:
-Please check if there is a .deployment file in the root of the repository, and provide this file if present, along with the deploy._ file if present (deploy.cmd, deploy.sh, deploy.ps1).
-Just to isolate, test the deployment directly from your local Git repository to a new App Service.
--If a .deployment and deploy.sh file are included in the root directory of the app code, Kudu will use the legacy build to run the commands specified in the deploy.sh script.
--Just to highlight on this, Kudu is the engine behind Git deployments on both Windows and Linux. By default, App service uses Oryx to build/install and Kudu will determine type of stack is used and creates a generic deploy.sh script to install the packages.
-App Service sets the environment variable PORT in the Node.js container, and forwards the incoming requests to your container at that port number. your app should listen to that port using process.env.PORT
const port = process.env.PORT || 3000
1.Add a start-up script: Add the PM2 configuration file or your script file
2.Go to Azure Configuration>General Settings
If your build folder is at the root of the project:
Start up command: pm2 serve /home/site/wwwroot --no-daemon --spa
Certain web frameworks may use custom startup scripts when running in production mode.
Refer this doc Customize build automation for more details.

Getting Warning: SCM Credentials on Azure WebApp deployment

We are migrating from Jenkins to Azure and in our deployment we used Powershell scripts, for our initial move we are trying not to adjust our Powershell scripts and just change the bare minimum to get them working.
On the running of command:
az webapp deployment source config-zip --name Name --resource-group RG --src Path/To/Zip.zip
When we used this command before we got the warning:
WARNING: Getting scm site credentials for zip deployment
We now get this warning as an Error:
[error]WARNING: Getting scm site credentials for zip deployment
I have adjust the settings to try continue past errors but it falls out anyway. Anyone know how to fix this?
I am using version 2.0.60 of Azure-cli. I have tried with az webapp deployment source config-zip command, I also got the warning. But the webapp was deployed successfully.
You can also deploy the zip file via browser.
1.In the browser, navigate to https://<app_name>.scm.azurewebsites.net/ZipDeployUI.
2.Drag the zip file to the file explorer area on the web page

Unable to install the VSTS Agent Azure VM extension

I am unable to install the VSTS Agent Azure VM extension on an Azure VM. I tried both the Install extension blade in the Azure portal and the Powershell option. When I try from the portal it just gets stuck at transitioning. If I run the Powershell script it gets stuck trying to connect to server.
I was able to install it on another server without any issues. The 2 servers are part of a web farm so they are exact images.
I am following the steps detailed at this url https://learn.microsoft.com/en-us/vsts/build-release/concepts/definitions/release/deployment-groups/howto-provision-deployment-group-agents?view=vsts .
I am trying to deploy from VSTS to an Azure VM.
This is the screen when I try to run the powershell script.
Run the config file directly (from C:/vstsagent folder) in cmdline and try again with dev.azure.com/{organisation name} url.

what happens when the command gcloud app deploy --version v1 is issued to deploy a nodejs application?

Can any one help me understand gcloud app deploy? I tried deploying an application but it gave me the error:
ERROR: (gcloud.app.deploy) Error Response: [13] An internal error
occurred while creating a Google Cloud Storage bucket.
Thanks,
-VR
gcloud is google sdk command to interact with its cloud services, you can read more about it here https://cloud.google.com/sdk/gcloud/
you can run gcloud commands either by installing gcloud sdk or from a gcloud shell where sdk is pre-installed.
gcloud app deploy looks for app.yaml which can be configured based on this documentation https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml
To address the error try running this command gcloud config set app/use_deprecated_preparation True; and give a try.
once we run gcloud app deploy --version v1 a version of the application is created and can be accessed by the corresponding url from version column.
one can even login to the running instance of VM by accessing respective instance ssh.
this command will tar ball the folder containing app.yaml and will be used to create the running nodejs instance; the entire deployment depends on PORT being used as part of NodeJS application for running production instance, and a proper package.json which will have all the dependencies listed and contains a start script to run the application.


Resources