4

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 ?

1
  • I would suggest to take a look at octopus.com they have some nice support for azure Commented Jan 21, 2016 at 14:52

4 Answers 4

5

EDIT 2023

You can now use Azure Bicep:

Bicep is a domain-specific language (DSL) that uses declarative syntax to deploy Azure resources. In a Bicep file, you define the infrastructure you want to deploy to Azure, and then use that file throughout the development lifecycle to repeatedly deploy your infrastructure. Your resources are deployed in a consistent manner.

Bicep provides concise syntax, reliable type safety, and support for code reuse. Bicep offers a first-class authoring experience for your infrastructure-as-code solutions in Azure.

ORIGINAL POST

You should have a look 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:

Sign up to request clarification or add additional context in comments.

Comments

1

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 Comment

Thank you. will definitely read up on the information you provided.
1

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.

Comments

1

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/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.