Web Deploy Error with Azure - azure

I'm trying to deploy my web app to Azure using this method, but periodically, i get this error. Any ideas? I rebooted the instance, still happens.
Start Web Deploy Publish the Application/package to https://xxx.cloudapp.net:8172/MsDeploy.axd?site=myapp.Web_IN_0_myapp.Web ...
Updating setAcl (myapp.Web_IN_0_myapp.Web).
Updating setAcl (myapp.Web_IN_0_myapp.Web).
Updating filePath (myapp.Web_IN_0_myapp.Web\bin\myapp.Web.dll).
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5): Warning : An error was encountered when processing operation 'Create File' on 'myapp.Web.dll'.
Retrying operation 'Update' on object filePath (myapp.Web_IN_0_myapp.Web\bin\myapp.Web.dll). Attempt 1 of 2.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5): Warning : An error was encountered when processing operation 'Create File' on 'myapp.Web.dll'.
Retrying operation 'Update' on object filePath (myapp.Web_IN_0_myapp.Web\bin\myapp.Web.dll). Attempt 2 of 2.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5): Error : Web deployment task failed.((9/28/2011 8:00:56 PM) An error occurred when the request was processed on the remote computer.)
(9/28/2011 8:00:56 PM) An error occurred when the request was processed on the remote computer.
An error was encountered when processing operation 'Create File' on 'myapp.Web.dll'.
The error code was 0x80070020.
The process cannot access 'E:\approot\bin\myapp.Web.dll' because it is being used by another process.
Publish failed to deploy.
========== Build: 3 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

The answer is to create a bootstrap csproj for your web role, that does nothing. This will be the DLL that gets locked by WaIISHost.
Then create the real web projects as separate sites using the option in the csdef file. Once you've done this, you can deploy any of your sites using web deploy and they will work, as long as they have no reference to your bootstrap dll (since they won't copy that file)

Related

Publish Failed Error while publishing Azure functions on azure

I am getting error while publishing azure functions on azure portal.I tried lot of things and visited lot of links but didn't find any suitable soltuion.
Below is the output in output window.
Azure Application Settings updated.
1>------ Build started: Project: AwepayReconcile.DAL, Configuration: Release Any CPU ------
1>Models\AwepayContext.cs(26,10,26,214): warning CS1030: #warning: 'To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.'
1>AwepayReconcile.DAL -> D:\AwepayReconcile.AzureFunctionsApp\AwepayReconcile.DAL\bin\Release\netcoreapp2.1\AwepayReconcile.DAL.dll
1>Done building project "AwepayReconcile.DAL.csproj".
2>------ Build started: Project: AwepayReconcile.DL, Configuration: Release Any CPU ------
2>Infrastructure\Extensions.cs(34,42,34,44): warning CS0168: The variable 'ex' is declared but never used
2>Services\ReconcileService.cs(177,36,177,38): warning CS0168: The variable 'ex' is declared but never used
2>Services\ReconcileService.cs(210,36,210,38): warning CS0168: The variable 'ex' is declared but never used
2>Services\ReconcileService.cs(304,30,304,32): warning CS0168: The variable 'ex' is declared but never used
2>Services\ReconcileService.cs(403,30,403,32): warning CS0168: The variable 'ex' is declared but never used
2>Services\ReconcileService.cs(40,36,40,42): warning CS0169: The field 'ReconcileService.hssfwb' is never used
2>Services\ReconcileService.cs(38,33,38,38): warning CS0169: The field 'ReconcileService.sheet' is never used
2>Services\AzureBlobStorageService.cs(29,29,29,41): warning CS0414: The field 'AzureBlobStorageService._appSettings' is assigned but its value is never used
2>AwepayReconcile.DL -> D:\AwepayReconcile.AzureFunctionsApp\AwepayReconcile.DL\bin\Release\netcoreapp2.1\AwepayReconcile.DL.dll
2>Done building project "AwepayReconcile.DL.csproj".
3>------ Build started: Project: AwepayReconcile.AzureFunctionsApp, Configuration: Release Any CPU ------
3>AwepayReconcile.AzureFunctionsApp -> D:\AwepayReconcile.AzureFunctionsApp\AwepayReconcile.AzureFunctionsApp\bin\Release\netcoreapp2.1\bin\AwepayReconcile.AzureFunctionsApp.dll
========== Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Publish Started
AwepayReconcile.DAL -> D:\AwepayReconcile.AzureFunctionsApp\AwepayReconcile.DAL\bin\Release\netcoreapp2.1\AwepayReconcile.DAL.dll
AwepayReconcile.DL -> D:\AwepayReconcile.AzureFunctionsApp\AwepayReconcile.DL\bin\Release\netcoreapp2.1\AwepayReconcile.DL.dll
AwepayReconcile.AzureFunctionsApp -> D:\AwepayReconcile.AzureFunctionsApp\AwepayReconcile.AzureFunctionsApp\bin\Release\netcoreapp2.1\bin\AwepayReconcile.AzureFunctionsApp.dll
AwepayReconcile.AzureFunctionsApp -> D:\AwepayReconcile.AzureFunctionsApp\AwepayReconcile.AzureFunctionsApp\obj\Release\netcoreapp2.1\PubTmp\Out\
Publishing D:\AwepayReconcile.AzureFunctionsApp\AwepayReconcile.AzureFunctionsApp\obj\Release\netcoreapp2.1\PubTmp\AwepayReconcile.AzureFunctionsApp - 20190320182641787.zip to https://awepayreconcileazurefunctionsapp20190320061400.scm.azurewebsites.net/api/zipdeploy...
C:\Users\tejinder.s\.nuget\packages\microsoft.net.sdk.functions\1.0.26\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Publish.ZipDeploy.targets(42,5): error : The attempt to publish the ZIP file through https://awepayreconcileazurefunctionsapp20190320061400.scm.azurewebsites.net/api/zipdeploy failed with HTTP status code RequestTimeout. [D:\AwepayReconcile.AzureFunctionsApp\AwepayReconcile.AzureFunctionsApp\AwepayReconcile.AzureFunctionsApp.csproj]
Please help me to git rid of this.
Thanks
When deploying your function app to Windows, you should set WEBSITE_RUN_FROM_PACKAGE to 1 and publish with zip deployment.
Zip deployment is a feature of Azure App Service that lets you deploy your function app project to the wwwroot directory. The project is packaged as a .zip deployment file. The same APIs can be used to deploy your package to the d:\home\data\SitePackages folder.
With the WEBSITE_RUN_FROM_PACKAGE app setting value of 1, the zip deployment APIs copy your package to the d:\home\data\SitePackages folder instead of extracting the files to d:\home\site\wwwroot. It also creates the packagename.txt file. The function app is then run from the package after a restart, and wwwroot becomes read-only.
For more details, you could refer to this article.

Azure function failed to deploy with the error ERROR_CONNECTION_TERMINATED

Issue Description
I am trying to deploy the azure function using visual studio and getting the error: Web deployment task failed (Complete error logs are given below).
I have followed all the steps mentioned in the article http://techgenix.com/video-publish-azure-functions-azure-using-visual-studio-tools-azure-functions/ but still facing the issue.
Please help me as I have spent a lot of time on this issue and didn't get any solution.
Fiddler was not running when I deployed the azure function using visual studio.
Error logs
1>------ Build started: Project: TestFunction, Configuration: Release Any CPU ------
1>TestFunction -> C:\Repo\TestFunction\TestFunction\bin\Release\net461\bin\TestFunction.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Publish Started
TestFunction -> C:\Repo\TestFunction\TestFunction\bin\Release\net461\bin\TestFunction.dll
TestFunction -> C:\Repo\TestFunction\TestFunction\obj\Release\net461\PubTmp\Out\
C:\Program Files\dotnet\sdk\2.1.300-preview1-008174\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : Web deployment task failed. (Web Deploy experienced a connection problem with the server and had to terminate the connection. Contact your server administrator if the problem persists. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CONNECTION_TERMINATED.) [C:\Repo\TestFunction\TestFunction\TestFunction.csproj]
C:\Program Files\dotnet\sdk\2.1.300-preview1-008174\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : [C:\Repo\TestFunction\TestFunction\TestFunction.csproj]
C:\Program Files\dotnet\sdk\2.1.300-preview1-008174\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : Web Deploy experienced a connection problem with the server and had to terminate the connection. Contact your server administrator if the problem persists. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CONNECTION_TERMINATED. [C:\Repo\TestFunction\TestFunction\TestFunction.csproj]
C:\Program Files\dotnet\sdk\2.1.300-preview1-008174\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : Root element is missing. [C:\Repo\TestFunction\TestFunction\TestFunction.csproj]
Publish failed to deploy.

Azure Web Publish has stopped working - No Errors

I am unable to publish my website to either my Azure hosted staging site or my new Azure live site.
I HAVE published to each once but have been unable to do so since the first time.
I have tried...
Regenerating the Publish profile
Manually entering passwords
Editing elements of the Database connection strings
Comparing the *.pubxml files with another site that works
I'm tearing my hair out with this now.
This is all I can see - Any more log info would be nice, or an error message!
2>------ Publish started: Project: Communityweb, Configuration: Release Any CPU ------
2>Transformed Web.config using C:\Development\Clients\Ministry\Pragmatic Agile Community\source\Communityweb\Web.Release.config into obj\Release\TransformWebConfig\transformed\Web.config.
2>Auto ConnectionString Transformed xslt\Web.config into obj\Release\CSAutoParameterize\transformed\xslt\Web.config.
2>Auto ConnectionString Transformed Views\Web.config into obj\Release\CSAutoParameterize\transformed\Views\Web.config.
2>Auto ConnectionString Transformed macroScripts\Web.config into obj\Release\CSAutoParameterize\transformed\macroScripts\Web.config.
2>Auto ConnectionString Transformed obj\Release\TransformWebConfig\transformed\Web.config into obj\Release\CSAutoParameterize\transformed\Web.config.
2>Auto ConnectionString Transformed .\umbraco\Install\Views\Web.config into obj\Release\CSAutoParameterize\transformed\umbraco\Install\Views\Web.config.
2>Auto ConnectionString Transformed .\umbraco\Xslt\Web.config into obj\Release\CSAutoParameterize\transformed\umbraco\Xslt\Web.config.
2>Copying all files to temporary location below for package/publish:
2>obj\Release\Package\PackageTmp.
2>
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
Don't add 'node_modules' to the deployed files if you can possibly avoid it. If not you'll have to be selective. Gulp is a particular menace here for recursive nested node_modules folders that break the windows path limit.

Publish to azure in VS2015 with message: The 'prepublish' script failed with status code 1

I took an existing ASP.NET 4/MVC 5 web site and manually converted to an ASP.NET 5/MVC 6 project.
When I got the application fully functional locally I attempted to publish to the previous web app on Azure. To do this I:
Downloaded the publish profile from the Azure portal.
Right clicked the web project and selected "Publish".
Imported the publish profile and attempted to publish.
Amazingly it worked the first time.
However on subsequent publish attempts I received the error:
Error : The 'prepublish' script failed with status code 1.
Looking at the output of the publish I see the following:
[13:25:07] 'min:ngAppJs' errored after 307 ms
[13:25:07] Error: EPERM, open 'C:\SCM\Holos Portal 1.0 (ASP.Net 5, MVC6)\HolosPortal\src\HolosPortal\wwwroot\ngApp\ngApp.min.js'
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.DNX.Publishing.targets(152,5): Error : The 'prepublish' script failed with status code 1.
2>Publish failed due to build errors. Check the error list for more details.
I eventually discovered that if I delete the output file (ngApp.min.js) the publish would succeed but then fail again on the next publish.
I had created a new min task for my angular app
gulp.task("min:ngAppJs", function () {
return gulp.src([paths.ngAppJs, "!" + paths.ngAppMinJs], { base: "." })
.pipe(concat(paths.concatNgAppJsDest))
.pipe(uglify())
.pipe(gulp.dest("."));
});
but I had neglected to create a cleanup task to remove the output file
gulp.task("clean:ngAppJs", function (cb) {
rimraf(paths.concatNgAppJsDest, cb);
});
gulp.task("clean", ["clean:js", "clean:ngAppJs", "clean:css"]);
Adding the clean task to gulpfile.js solved the problem.

Unable to publish node.js app from VS2015 using VS publish

I’ve got a node.js project which I’m using to publish to Azure. This worked fine the first couple of times I’ve published, but now when I try and publish it just fails with no error message. The output in the Azure Service Activity window in VS2015 is simply:
Auto ConnectionString Transformed Web.config into obj\Release\CSAutoParameterize\transformed\Web.config.
Copying all files to temporary location below for package/publish:
obj\Release\Package\PackageTmp.
And the output from the ouput/build window is:
------ Publish started: Project: node, Configuration: Release Any CPU ------
Auto ConnectionString Transformed Web.config into obj\Release\CSAutoParameterize\transformed\Web.config.
Copying all files to temporary location below for package/publish:
obj\Release\Package\PackageTmp.
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
I don’t really know where to start diagnosing this as there is no error message per se.
Things I’ve tried thus far:
Full Clean and/or rebuild
Deleted all folders from the BIN directory
Deleted all folders from the obj directory
Tried both debug and release configurations
Deleting the publish profile from VS and re-adding it from scratch
None of the above has made any difference
Has anyone seen this issue before or could suggest where to start diagnosing the cause?
Thanks
Do you happen to have GhostDoc installed?
Uninstalling it fixed it for me after seeing this issue.
I had the same issue, and it was due to file paths getting long more than the allowed number of characters. use this module to make your file paths shorter, and it will fix this issue
https://www.npmjs.com/package/flatten-packages

Resources