private AzureDeploymentTemplate ToTemplate(string resourceGroupName, string location, List <IHaveInfrastructure> elementsWithInfrastructure)
        {
            var template = new AzureDeploymentTemplate(TemplateDeploymentVersion(resourceGroupName));

            elementsWithInfrastructure.Sort(ByConfigurationDependency);

            foreach (var elementWithInfrastructure in elementsWithInfrastructure)
            {
                var renderer = Ioc.GetRendererFor(elementWithInfrastructure);
                renderer?.Render(template, elementWithInfrastructure, _environment, resourceGroupName, location);
            }

            return(template);
        }