Error deploying to azure app service - "specified path, file name, or both are too long. The fully qualified file name must be < 260 characters" - azure

I was trying to deploy my web app to a web app service I created in Azure services portal. I was doing it through Visual Studio Code with the help of Azure extensions (idk if that's important to mention or no). I got this error:
"The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters"
Unfortunately, I can not change file names or move the project to a different folder. What can I do to fix this issue? Thanks in advance :)

Please check if the below steps help to fix the issue:
If it is Node JS Web App, delete the folder called node_modules within the project folder. Reload the solution > Rebuild and publish to the Azure. In the Azure Portal > Web App > Console - run the command npm install which adds the dependencies within that project with the folder called node_modules.
If possible, try to move your projects/solutions to the root directory or to the short directory path.
According to this similar issue reported in the GitHub Repo-Azure Web App, you can include a setting in publish profile file like:
<PublishTempFolderName>i2</PublishTempFolderName>
Check that reference when using the above setting, some global settings need to be applied given on the GitHub Repo
(OR) Enable the policy state of Enable NTFS long paths in the Local Group Policy Editor and check once.

Related

Azure App Service keeping old files at /home/site/wwwroot/

I'm deploying nodejs application to Azure App Service with visual studio code extension (Deploy to web app). However when I inspect the files section, I found some old file/ files from previous deployment are still exist at /home/site/wwwroot/ folder.
For example first deployment have A.js, and second deployment I renamed it to B.js, /home/site/wwwroot/ will endup with A.js and B.js.
How can I resolved this issue? Any suggestion will be appreciated, thank you!
on publish page click on show all settings.
Make sure Remove additional files at destination.
Before check Remove additional files at destination. showing old file on wwwroot folder.
After check Remove additional files at destination. showing old file on wwwroot folder.

Could not find required file in package createUiDefinition.json File path - Azure app publish in marketplace

I have developed web app using .NET Core 2.0. Now I want to deploy this app in Azure Marketplace so anyone can use this app. To deploy the app I have created package which will contain below 2 files.
mainTemplate.json
createUIDefinition.json
And I have uploaded the package as shown in below image.
But it shows error:
Package acceptance validation error: AzureAppAssetRequiredFileNotFound Could not find required file in package createUiDefinition.json File path: createUiDefinition.json Code: PAC-AzureAppAssetRequiredFileNotFound
I have tried to fix this issue but I was not able to make it work. Has anyone faced this issue or anyone know the solution please guide me.
Thanks
Usually this happens when your ZIP file contains folders, and in those folders you have the artifacts such as createUiDefinition.json.
To fix, make sure createUiDefinition.json is at the root of the ZIP archive and not in any subfolders.

CSPack encodes directory name with space to %20

I've recently setup a new build configuration in Teamcity to create an Cloud Services package for Azure. After building the project with msbuild, i'm calling cspack.exe (Azure SDK 2.2) to create the package.
This is the command i'm using:
cspack.exe "ServiceDefinition.csdef"
"/out:%Package.RelativePath%package.cspkg"
"/role:MyWebRole;%teamcity.build.checkoutDir%\t\%build.number%;bin\MyProject.Web.dll"
"/sites:MyWebRole;MyWebSite;%teamcity.build.checkoutDir%\t\%build.number%"
This creates a cspkg which seems correct. I've uploaded this package to the Azure storage and executed an update of the webrole. But after a while it shows an error while executing that startup tasks. After that comes an loop of restarting the webrole.
While searching for a possible cause, i've noticed that one of the directories in my approot contains a space in my original project, but in the package encoded to %20. After changing the directory name to the original name and updating the webrole again the issues disappeared.
Is anyone familiar with this issue and can point me in the right direction of solving this?
The %20 only goes into the package, but not when deployed. Did you RDP to the Cloud Service Role to check whether the folder name is with the %20 or not? Because it seems, the %20 is only added to the package, but removed when unzipped. So your issue with restarting might be something else.
And by the way, the same applies for all non-URI characters, including Unicode characters that should go into the package. Which is imposed by the Open Packaging Conventions.

Visual studio continuous deployment of a Webapp does not work

I cannot deploy using the build created by the integration between Azure and VSO.
The build finishes correctly, but it is not deployed on the website! The bin folder is there. But there is no folder for the views!
I have the impression it started when I create an webjob in the solution.
I cannot publish it neither!
Thank you
It's possible you're actually publishing the web job (is the project just a console app?) to the webapp, instead of the web project.
(Side note, this is one way to get a web job deployed and running)
You can control which project in your solution is being deployed by adding a new setting under "app settings" on the "configure" tab for the webapp.
The setting you want is Project and it's a relative path from the solution root to the .csproj file of your web project.
Alternatively, you can specify the setting in a custom .deployment file.
Relevant Kudu documentation here
From the documentation:
You can specify the full path to the project file. Note that this is not a path to the solution file (.sln), but to the project file (.csproj/.vbproj). The reason for this is that Kudu only builds the minimal dependency tree for this project, and avoids building unrelated projects in the solution that are not needed by the web project.
Here is an example:
[config]
project = WebProject/WebProject.csproj

Why doesn't mywebsite.dll.config get included in my cspkg?

I have an azure web role with Azure SDK 2.3.
My web site project website has web.config, which gets copied to bin/debug/website.dll.config properly during build.
But Azure SDK totally fails to include this DLL in the cspkg which causes my role OnStart to fail, since it depends on binding redirects in the web.config to load the correct version of the Azure runtime assemblies. Anyone got any bright idea why cspack isn't including this file and what to do about it?
web.config files are never copied as projectNAme.dll.config!
Only application.config files are copied this way. And yes, for Web Roles nothing beside the regular web.config are automatically copied.
You have to name your configuration file following the name of your main application assembly (i.e. website.dll.config) and then explicitly mark it with Copy Always in the properties panel, section Copy to output folder. Thus the file will be included into the web role package.

Resources