When working with deploying Azure Function Apps with Jenkins, I ran into an issue when trying to rebuild a Function App from scratch with the same name. I was unable to deploy the codebase via Pipeline due to the following error:
unable to get credential storage lock: File exists
I was able to fix by doing the following:
SSH into the server.
Log in as the user that runs when running a Jenkins job (for example):
sudo su -s /bin/bash jenkins
Access the user’s .git-credentials file, and remove the reference to the pre-existing Function App SCM.
Delete the .git-credentials.lock file.
After doing this, try running the job again and ensure the issue has been solved.
In the case where you want to copy a collection of jobs from one Jenkins server to another, here’s a process you can use to make the migration. This guide assumes you have two different remote Jenkins instances to copy jobs from.
SSH into the source server to determine where the /jobs directory is for Jenkins. Example would be in /
Use scp (on your local machine) to copy the jobs from the remote Jenkins instance with the jobs:
If you are looking to improve performance on your website, this will automatically convert the images on your site to the more efficient WebP format. This will help with Google Lighthouse scores (especially in solving the “Serve images in next-gen format” issue).