{"id":1822,"date":"2026-04-15T17:01:20","date_gmt":"2026-04-15T16:01:20","guid":{"rendered":"https:\/\/editjournal.redakt.eu\/faxmodem\/?p=1822"},"modified":"2026-06-29T08:30:07","modified_gmt":"2026-06-29T07:30:07","slug":"deploy-cpanel-git-azure-web-app-service","status":"publish","type":"post","link":"https:\/\/editjournal.redakt.eu\/faxmodem\/blog\/development\/cloud-serverless\/deploy-cpanel-git-azure-web-app-service\/","title":{"rendered":"Deploy cPanel git to Azure Web App Service"},"content":{"rendered":"<p>If you want to host your code in a GIT repository that is not Github, BitBucket or some other large corporation <a href=\"https:\/\/www.helpnetsecurity.com\/2026\/03\/26\/github-copilot-data-privacy-policy-update\/\">whose Privacy Policy and Terms &amp; Conditions you didn't read<\/a>, cPanel can be a reasonable option. You will, however, have to set up the continuous deployment yourself. Using Microsoft Azure Web App Service as deployment destination example, here's how.<\/p>\n<h2>Credentials<\/h2>\n<p>You will need to authorise your requests when publishing code to Azure. We will use the publish profile file that is a one click download. We will also parse the file straight away, so that there's no need to fish out, copy and paste the values we're going to need.<\/p>\n<ul>\n<li>Go to your web app and click <em>Download publish profile<\/em> at the top of the blade. Upload it into your cPanel git repository root folder as <code>.PublishSettings<\/code>.<\/li>\n<li>Add <code>*.PublishSettings<\/code> to your <code>.gitignore<\/code> - cPanel won't trigger the deployment if there are uncommitted files in the repository.<\/li>\n<\/ul>\n<h2>Deployment instructions<\/h2>\n<p>You will need a <code>.cpanel.yml<\/code> file in your repository root. This file will orchestrate the whole deployment process.<\/p>\n<p>Commit <code>.cpanel.yml<\/code> to the repository, else cPanel will not deploy.<\/p>\n<p>Of all the options to deploy to Azure. we will use <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/app-service\/deploy-zip?tabs=api\">Zip Deploy via API<\/a> which packages your code into a zip archive and pushes it to Azure. Azure will then unzip and build your project. That is unlike the similarly named <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/app-service\/deploy-run-package\">Zip Package<\/a> method, which mounts the archive it receives and expects its contents to be an already built application.<\/p>\n<p>(We don't use the <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/app-service\/deploy-continuous-deployment?tabs=others\">External Git<\/a> method because that requires the repository to be available over HTTPs or SSH with username and password.)<\/p>\n<pre><code>---\ndeployment:\n  tasks:\n    - export ZIP=&quot;$HOME\/tmp\/deploy.zip&quot;\n    - rm -f &quot;$ZIP&quot;\n    - zip -r &quot;$ZIP&quot; . -x &quot;.git\/*&quot;\n    - export PS=.PublishSettings\n    - export URL=$(xmllint --xpath &#039;string(\/publishData\/publishProfile[@publishMethod=&quot;ZipDeploy&quot;]\/@publishUrl)&#039; &quot;$PS&quot;)\n    - export USER=$(xmllint --xpath &#039;string(\/publishData\/publishProfile[@publishMethod=&quot;ZipDeploy&quot;]\/@userName)&#039; &quot;$PS&quot;)\n    - export PASS=$(xmllint --xpath &#039;string(\/publishData\/publishProfile[@publishMethod=&quot;ZipDeploy&quot;]\/@userPWD)&#039; &quot;$PS&quot;)\n    - curl -X POST -u &quot;$USER:$PASS&quot; -T &quot;$ZIP&quot; &quot;https:\/\/$URL\/api\/publish?type=zip&quot;\n<\/code><\/pre>\n<p>The file packs up your repository into a ZIP archive, excluding the <code>.git<\/code> folder. It parses the required authentication values from the <code>.PublishSettings<\/code> file we uploaded earlier. Finally, it uploads the archive to an Azure endpoint.<\/p>\n<h2>Azure configuration<\/h2>\n<p>Instruct Azure to build your project - create the following environment variable:<\/p>\n<pre><code>SCM_DO_BUILD_DURING_DEPLOYMENT=true<\/code><\/pre>\n<p>This ensures Azure pulls the dependencies your projects may have listed.<\/p>\n<p>More info: <a href=\"https:\/\/azureossd.github.io\/2025\/09\/03\/ENABLE_ORYX_BUILD-vs-SCM_DO_BUILD_DURING_DEPLOYMENT\/\">https:\/\/azureossd.github.io\/2025\/09\/03\/ENABLE_ORYX_BUILD-vs-SCM_DO_BUILD_DURING_DEPLOYMENT\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>cPanel has built-in GIT hosting that you can use in automated deployment with e.g. Azure Web App service. To make it happen, you create a text file with deployment instructions and credentials in your code repo, and you add an environment variable to Azure.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[778],"tags":[1275,824],"class_list":["post-1822","post","type-post","status-publish","format-standard","hentry","category-cloud-serverless","tag-cpanel","tag-microsoft-azure","entry"],"_links":{"self":[{"href":"https:\/\/editjournal.redakt.eu\/faxmodem\/wp-json\/wp\/v2\/posts\/1822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/editjournal.redakt.eu\/faxmodem\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/editjournal.redakt.eu\/faxmodem\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/editjournal.redakt.eu\/faxmodem\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/editjournal.redakt.eu\/faxmodem\/wp-json\/wp\/v2\/comments?post=1822"}],"version-history":[{"count":5,"href":"https:\/\/editjournal.redakt.eu\/faxmodem\/wp-json\/wp\/v2\/posts\/1822\/revisions"}],"predecessor-version":[{"id":1827,"href":"https:\/\/editjournal.redakt.eu\/faxmodem\/wp-json\/wp\/v2\/posts\/1822\/revisions\/1827"}],"wp:attachment":[{"href":"https:\/\/editjournal.redakt.eu\/faxmodem\/wp-json\/wp\/v2\/media?parent=1822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/editjournal.redakt.eu\/faxmodem\/wp-json\/wp\/v2\/categories?post=1822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/editjournal.redakt.eu\/faxmodem\/wp-json\/wp\/v2\/tags?post=1822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}