Question

Question:

I would like to exclude certain files (by type) from my Azure Websites deployment. Can this be done without creating a custom deployment file?

Given:

  • Deploying an MVC 4 web application from a local Git repository
  • Want to exclude *.coffee (CoffeeScript) files from the site deployment, but not from my Git repo
  • Scoured the Kudu wiki (https://github.com/projectkudu/kudu/wiki), but haven't found an answer
Was it helpful?

Solution

I assume that these CoffeeScript files are listed in your csproj file, such that they show up in Visual Studio?

All you should have to do is make sure the Build Action is set to None and not to Content, and they won't get deployed.

OTHER TIPS

A possible way to do this is through a post deployment action that runs a batch file like this

cd /d %HOME%\site\wwwroot
for /F "tokens=*" %%i in ('dir /s /b *.coffee') do del %%i

You can use an echo though first to make sure it's deleting the correct files

for /F "tokens=*" %%i in ('dir /s /b *.coffee') do echo %%i >> toBeDeleted.txt
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top