-
Notifications
You must be signed in to change notification settings - Fork 655
Manually triggering a deployment
This method works for external git/Mercurial repositories, DropBox and OneDrive.
Here's how to trigger a (fetch) deployment from an external repository.
e.g. You have a git repository at https://example.com/git/RepositoryName.git and you'd like to notify Kudu to trigger a deployment for every new commit.
POST /deploy HTTP/1.1
Host: $SiteLevelUsername:SiteLevelPassword@<SiteName>.scm.azurewebsites.net
Content-Type: application/json
Accept: application/json
X-SITE-DEPLOYMENT-ID: <SiteName>
Transfer-encoding: chunked
{
"format":"basic",
"url":"https://username:password@example.com/git/RepositoryName.git"
}
For Mercurial (hg) add "is_hg": true
to the JSON payload.
$SiteLevelUsername:SiteLevelPassword
are Site-Level credentials. They are a good fit here being distinct for each site and randomly generated.
e.g. Using the "External Repository" deployment method in the Azure Portal.
In addition to the POST above you can accomplish the same thing by calling Invoke-AzureRmResourceAction
:
# Action sync
Invoke-AzureRmResourceAction -ResourceGroupName <ResourceGroupName> `
-ResourceType Microsoft.Web/sites `
-ResourceName <WebAppName> `
-Action sync `
-ApiVersion 2015-08-01 `
-Force -Verbose
For a GitHub specific guide see this page here: Deploying from GitHub