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

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...

Related

Troubleshooting Azure Service Fabric: "The ServiceType was not registered within the configured timeout."

I have deployed a Web API written with .net Core to a local dev Azure Service Fabric cluster on my machine. I have plenty of disk space, memory, etc, and the app gets deployed there. However, success is intermittent. Sometimes it doesn't deploy to all the nodes, and now I have it deployed to all the nodes, but within the Azure Service Fabric Manager page, I see each application in each node has an Error status with the message: "The ServiceType was not registered within the configured timeout." I don't THINK I should have to remove and redeploy everything. Is there some way I can force it to 're-register' the installed service type? Microsoft docs are really really thin on troubleshooting these clusters.
Is there some way I can force it to 're-register' the installed service type?
On your local machine you can set the deployment to always remove the application when you're done debugging. However, if it's not completing in the first place I'm not sure if this workflow would still work.
Since we're on the topic, in the cloud I think you'd just have to use the Powershell scripts to first compare the existing app types and version and remove them before "updating". Since the orchestration of this is complicated I like to use tools to manage it.
In VSTS for instance there is an overwrite SameAppTypeAndVersion option.
And finally, if you're just tired of using the Service Fabric UI to remove the Application over and over while you troubleshoot it might be faster to use the icon in the system tray to reset the cluster to a fresh state.

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

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 / Web Role not reading from ServiceConfig

I have an Azure Worker Role (WR) which is supposed to pick up it's config from the .cscfg files using:
var setting = CloudConfigurationManager.GetSetting("My.Setting.Name");
Running in the emulator this is fine, I get the:
Getting "My.Setting.Name" from ServiceRuntime: PASS.
message. However, when I publish to my remote environment, I get:
Getting "My.Setting.Name" from ServiceRuntime: FAIL.
Getting "My.Setting.Name" from ConfigurationManager: FAIL.
messages. In the 'CloudServices/Configure' section of the Azure Management Portal I can see the setting listed in the configuration, and it's set correctly.
I'm using Azure SDK 2.0
Are you deploying correct Azure SDK .DLL's with your project? Did you by chance upgrade recently to a newer Azure SDK? I would check your .DLL references to make sure that they all match across the solution

Why does WAIISHost lock certain files

I am deploying a web application to azure. The application is built using Nancy, and there is no RoleEntryPoint defined (please note this isn't a problem, the website itself is running just fine). When I deploy to azure, i have enabled the web deploy option.
When I attempt to run a webdeployment, am getting the following error:
Error 7 Web deployment task failed.((6/26/2012 12:28:45 PM) An error
occurred when the request was processed on the remote computer.)
(6/26/2012 12:28:45 PM) An error occurred when the request was
processed on the remote computer. An error was encountered when
processing operation 'Create File' on 'Castle.Windsor.dll'. The error
code was 0x80070020. The process cannot access
'E:\approot\bin\Castle.Windsor.dll' because it is being used by
another process.
I've RDP'd into the role instance and using process explorer I see that WAIISHost has a lock to a number of assemblies that my project references.
I haven't been able to determine what is causing those files to be locked.
thanks,
jason
Web Deploy is not for use in a production environment. (described here)
WaIisHost.exe is the role hose process for full IIS web role so when your web role starts, your role DLL is loaded in this process. During the life of your webrole the role dll is loaded in the host process and can not be changed. As Castle.Windsor.dll is in E:\approot\bin* where role specific DLL are located, the host process has this binary loaded in it.
If you want to update your web role you would need to, you the Windows Azure Upgrade option either from portal or from powershell.

Resources