0
votes

We're using the Visual Studio Team Services Release Feature and I'm in the process of building an fully automated CI / CD Pipeline.

I've created an Azure Resource Manager template using the VS Template that creates the typically SaaS artifacts, namely a Web App + SQL Database.

I've created the three standard VSTS Release environments dev, staging and prod. Each environment now uses the ARM Template to create an isolated product environment in azure.

Release Environnment ( e.g. dev | staging | prod )
 ARM Template 
  - Hosting Plan
  - SqlServer
    - Database
  - Website
  - AppInsights

Because each product environment / ARM template also creates an Azure SqlServer I've hit the Azure SQL Server limit of 6 per Azure Account after 2 VSTS Projects.

After I hit this limit of six Azure SQL Server's by account I felt like going down the wrong road by creating an Azure SQL Server for each VSTS Release Environment.

How should I deploy this kind of simple Azure PaaS / SaaS application by using VSTS and ARM Templates without drawing myself into a corner of limits?

Appreciate

2
For ARM Template, that would be impossible. When deploying an ARM template, you deploy all resources to a certain resource group. However, if you want to deploy a SQL Database with an existing SQL Server, that means the SQL Database already belongs to the resource group of the SQL Server. If the resource group of the SQL Server is the same as the resource group you are deploying, it might be doable. However, you are deploying multiple environments, so there must be some environments which are not good. My suggestion is to separate the SQL deployment from the ARM template.Jack Zeng
Strange, the vanilla Visual Studio ARM Templates works exactly this way. Thanks for letting me know I was trying the impossible. Any Advice what to use instead?Chris Richner
Write an extra ARM template to deploy databases for all your Environments. Then, you can have all your databases in one SQL server.Jack Zeng
azure subscription max limit is 150 sql servers. guess one needs to raise a support ticket to get it increased. never tried though. also I was about to ask why would you need to new servers can't you have one server for dev and test and a separate server for prod ?Aravind

2 Answers

1
votes

If you are using a MSDN Subscription, you should have this kind of limitation.

But in an Enterprise Agreement / Production Subscription you should have no limitations, or simply raise a flag to the support it should fixed in few hours.

1
votes

Following up on what Aravind said, if you just wanted different servers for dev/staging/prod you can deploy databases into those servers in a template deployment without creating the SQL Server. You just reference the server in the db's name property like so:

  "resources": [
{
  "name": "[concat(parameters('sqlSserverName'),'/',parameters('dbName'))]",
  "type": "Microsoft.Sql/servers/databases",
...

Though I'm pretty the servers will need to be in the same resource group as the databases, so if you have more than 3 rgs (e.g. dev/staging/prod) then you probably need to get the quota changed.