4
votes

Is there a way / API to Programmatically deploy Azure App services in particularly Web Apps to Azure ?

or creating multiple instances of the site with different domain names ?

The basic idea is to sell a user configurable / themeable web site to the public as a product and automate the azure deployment after a client purchases the application ?

4
I would suggest to take a look at octopus.com they have some nice support for azureRobbert Draaisma

4 Answers

4
votes

You should have a lookt at Azure Resource Manager templates:

Azure applications typically require a combination of resources (such as a database server, database, or website) to meet the desired goals. Rather than deploying and managing each resource separately, you can create an Azure Resource Manager template that deploys and provisions all of the resources for your application in a single, coordinated operation. In the template, you define the resources that are needed for the application and specify deployment parameters to input values for different environments. The template consists of JSON and expressions which you can use to construct values for your deployment. This topic describes the sections of the template.

You can find good sample to start from the official website:

1
votes

A lot.

A discussion of possible approaches at Deploy your app to Azure App Service. You'll need to provide more details, or try something out and come back with more specific questions. Alos read How to manage DNS records using PowerShell.

1
votes

Apart from already suggested, maybe take a look at the xplat cli you can do everything you need for your scenario if you have your code in git somewhere:

//Create the site
azure site create ...
//Add a custom domain
azure site domain add ...
//Deploy the site from your github repo
azure site deployment github ..
//Add sitespecific settings
azure site appsetting add ..

If you need database the xplat cli can create your databases too however it doesnt currently support to create a copy of an existing database for that so for that you have to turn to the Powershell solution mentioned in another answer.

1
votes

You can use the PowerShell command to clone your preconfigured web app - available starting v1.1.0

Get the object for source web app

$srcapp = Get-AzureRmWebApp -ResourceGroupName SourceAzureResourceGroup -Name source-webapp

Create a new web app using the source web app

$destapp = New-AzureRmWebApp -ResourceGroupName DestinationAzureResourceGroup -Name dest-webapp -Location NewLocation -AppServicePlan DestinationAppServicePlan -SourceWebApp $srcapp

For more details check the following article: https://azure.microsoft.com/en-us/documentation/articles/app-service-web-app-cloning/