Azure Function Kudu (SCM) failing to start - azure

Having tried multiple times to restart the function the SCM (Kudu) instance fails to start.

This was due to the WEBSITE_CONTENTSHARE pointing to a file share that did not exist.

Related

Error: Error: Failed to deploy web package to App Service. Bad Request (CODE: 400)

I am using the Devops release pipeline to deploy new releases to my function apps.
However a few days ago, the release pipeline stopped working and I continue to receive the following error message on deployments:
Error: Error: Failed to deploy web package to App Service. Bad Request (CODE: 400)
After digging in the kudu stack trace, I find the following:
Error occurred, type: error, text: No space left on device
However, when I look at my quota usage on the app service plan that hosts my function apps, I have not even exceeded 1% of my quota. I am on a basic app service plan that provides 10gb of storage and my function apps combined have used 50mib.
I am reaching out to see if anyone else has/is currently experiencing this issue and what they did to resolve it.
Many Thanks!
Adam
Some advice for trouble shooting:
You can use the Kudu service to see the size of all the files on the Azure. This way you can further check your storage. Go to Azure portal -> Your_APP_Service -> development tool -> advanced tool to access Kudu service and download the extension. You can click this blog for detailed information.
The issue may be that your source code and output are too large. In this case, try using a self-hosted agent and clear the cache.
The reason for the issue may also be that the packages uploaded at one time are too large, which leads to the shortage of temporary files. Click on the link to see if you have exceeded the temporary file limit.
I had the same problem, I connected with ssh to app service and run:
$ df -h
and scale up (App service plan)(be careful the server IP can change)
And after run the pipeline, Its run Correctly, if you wish you can return to the previous plan.
If anyone encounters this issue in the future this may resolve your problem.
I believe the problem with deployments may have been caused by a corrupt function app in the app service plan. I noticed that the function app I recently added had been categorised as a container although I never specified it as such. Anyway, deleting that function app and recreating it resolved the issue. All deployments to that app service plan are now working fine!

Azure WebApp: cannot modify file even though service is stopped

I am trying to deploy my app to an Azure WebApp slot but it seems that the file (Microsoft.Data.Edm.dll) it is trying to update is locked even though I have manually stopped the WebApp. I got the following error while deploying my app.
Web deployment task failed. (Web Deploy cannot modify the file 'Microsoft.Data.Edm.dll' on the destination because it is locked by an external process. In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.)
I tried on both VSTS web deploy task and manual deploy from Visual Studio, it returns me the same error message. I tried restarting the WebApp, setting the COR_ENABLE_PROFILING = 0 then 1 too but again, same error. The last resort that I didn't try is delete the WebApp and recreate again.. but i would like to know if there are other suggestions first before I do this desperate measure.
Thank you in advanced.
Restarting works better, stop just stops the http listener, restart restarts the running proces
Please try to use Resources explorer portal to full stop your web app. In this way, we can delete some locked files via FTP without anything running. For more details about how to full stop your web app, please refer to this article
As of time of this writing, if you are using Azure DevOps (VSTS) to deploy your application, you can select "Run From Package" in the "Azure App Service Deploy" task/step - this is available in version 4 of the task, under the "Additional Deployment Options" node.
This deployment option eliminates file locking issues as it provides atomicity, in that the application is pointed to the new zip file rather than deploying a bunch of loose files under wwwroot, some of which may be locked.
It provides you with a number of other benefits that you can read about it if you search and read about the feature.
HTH

Azure WebJob running old code

We have a bug in our WebJob running in our live environment, I have identified the bug and fixed it, this I can verify in our Dev-environment. I published my WebJob as a "Azure WebJob" to our live environment but the bug i still present. To add to the confusion the bug now just occurs sometimes. So for some reason the old code is running somewhere sometimes.
Can someone please help me understand this?
I had a similar problem. We deploy using a stage environment in Azure and it turned out that the "old" WebJobs (running code with an old version of the entity framework model) where still running on the queue. These jobs where then fetching messages and consuming them. To add to the problem the exception was consumed in a try catch and the status of the WebJob was success.
Check if you have a stage environment (add -stage to the Webapp name) and if so go in to the Azure management portal and stop them.
Note, it is not enough to stop the Webapp, you must stop the WebJobs directly. This is done (in the new portal) under Settings->WebJobs and then right-clicking on the webjobs name selecting stop.
I spent ages looking into this problem. Turns out I had the web job project running in a console on my PC at work! No matter what I did on Azure the presence of this exe running and using the same storage for the web jobs meant that the old code running on my work PC picked up the jobs before Azure did. Easy fix: just make sure no exes are running outside of Azure!
In our case the web app was published to physical path /site/www instead of the default /site/wwwroot, because of this the Azure web portal interface adds the WebJobs to folder /site/jobs, but the webdeploy via VS or Azure are still trying to publish the webjobs inside the /site/www.
More details at Publishing WebJobs with Azure Pipelines

Web Deploy and Microsoft Azure ApplicationInsights

I have an on premise IIS instance that I publish to using web deploy. When I added Application Insights I get the following error.
(Unable to perform the operation ("Delete File") for the specified directory
("Microsoft.ApplicationInsights.Extensions.Intercept_x64.dll").
If I try to delete the file manually it says it is in use by the IIS Worker Process. Is there any way to reset the site or override the lock so that it can successfully publish? Or is there a way to not publish this file?
This is known issue and fixed is being worked on. We plan to deploy the fix with the next version of SDK release (0.13).
In SDK 0.12 the only workaround is to stop application pool which your web site is running on before running deployment, so locked modules will be unloaded and deployment procedure will be able to rewrite file(s).
And yes, this issue is prioritized to be fixed in 0.13.

AZURE Worker Role Deploy with extra DLL's and app.Config

I'm trying to deploy an Azure Worker Role Cloud Service. When testing a "Hello World" scenario, it's very simple and works fine.
Once I add references to custom DLL's, and EntityFramework, the Worker Role will no longer deploy. My thought is the extra DLL's and the app.config file is not getting deployed.
Here is the error:
1:25:03 PM - Uploading Package...
1:25:57 PM - Updating...
1:29:04 PM - Your role instances have recycled a number of times during an update or upgrade operation. This indicates that the new version of your service or the configuration settings you provided when configuring the service prevent the role instances from running. Verify your code does not throw unhandled exceptions and that your configuration settings are correct and then start another update or upgrade operation.
Does anyone know why it's failing and if this is possible or how to deploy a more complex worker role?
Sounds like something is present locally that doesn't exist (or is not available) once deployed.
Easiest thing to do is remotely debug your worker role:
http://msdn.microsoft.com/en-us/library/azure/ff683670.aspx#BK_Debugging_Cloud_Azure
Both feedback items helped me resolve the error. Below are the steps:
1.) I made sure I had both a web site and worker role added to the solution.
2.) I verified they both ran and could be published to Azure.
3.) I then added my custom code, and ensured the config file for the worker role was correct and working in the compute emulator.
4.) I ensured the app.config and dll files had the property copy local to true, which ensured they were deployed.
5.) Deployed to Azure and it worked!
Thanks...

Resources