This would seem to be an easy task although I can't find the solution. I've recently started a Laravel 4 project which needs to be hosted on Azure. I've linked Azure to deploy from bitbucket when a change is made. This however pushes the files into "wwwroot" folder in Azure (the public folder). Some of the framework files shouldn't be in the public folder therefore I would like to push to the parent folder "site".
After some research I discovered you can use .deployment file to config deployment options (https://github.com/projectkudu/kudu/wiki/Deployment-hooks)
So I tried .deployment file:
[config]
DEPLOYMENT_TARGET = C:\DWASFiles\Sites\SITENAME\VirtualDirectory0\site
Unfortunately this causes an error:
Source and destination directories cannot be sub-directories of each other
This would be due to the fact the repository folder sits in the site folder aswell. If I change the deployment file to:
[config]
DEPLOYMENT_SOURCE = C:\DWASFiles\Sites\SITENAME\VirtualDirectory0\repo
DEPLOYMENT_TARGET = C:\DWASFiles\Sites\SITENAME\VirtualDirectory0\site
It runs without errors but it pushes nothing as the repo folder is empty, I guess if I could get Azure to put the files into \repo instead \site\repository everything would be fine.
Maybe I'm over complicating things and I'd really appreciate any advice. Worst case I can just push to the "wwwroot" folder and use a web.config to fix things.
In the Azure portal, navigate to your app's management page. From the left menu, select Deployment Center > Settings. Select Local Git in Source, then click Save. In the Local Git section, copy the Git Clone Uri for later.
Navigate to your app in the Azure portal and select Deployment Center under Deployment. Follow the instructions to select your repository and branch. This will configure a DevOps build and release pipeline to automatically build, tag, and deploy your container when new commits are pushed to your selected branch.
This is not very well supported today, but you may be able to make it work by setting a couple things in the app settings:
SCM_REPOSITORY_PATH=..\repository
SCM_TARGET_PATH=..
This basically tells it to put the repo directly in VirtualDirectory0
(as opposed to VirtualDirectory0\site
), and then to deploy to VirtualDirectory0\site
(as opposed to VirtualDirectory0\site\wwwroot
).
This assumes that your repo contains a folder named wwwroot.
Some info on these paths here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With