Deploy projects using PowerShell scripts

You can also deploy your project to Azure Web Apps using PowerShell scripts.

You can download the scripts from Sitefinity GitHub repository » Sitefinity Azure PowerShell Deployment Scripts.

The scripts perform the following:

  • Create SQL server in Azure
  • Create SQL database in Azure under the SQL server
  • Create Azure Web App
  • Create resource group for the site
  • Create Redis cache
  • Set Redis key in Sitefinity
  • Prepare and deploy Sitefinity website to Azure Web Apps

Azure resource groups

To deploy Sitefinity to Azure Web Apps, the PowerShell scripts use the predefined JSON templates, located in folder ~/Scripts/Templates.

Before you run the scripts, you can reorganize or create new templates, using Azure Resource Manager. Azure Resource Manager helps you to manage Azure resource groups.

A resource group is a container that holds related resources for an application. The resource group could include all of the resources for an application, or only those resources that are logically grouped together. You can decide how you want to allocate resources to resource groups based on what makes the most sense for your organization. Azure Resource Manager templates enable you to quickly and easily provision your applications in Azure via declarative JSON. In a single JSON template, you can deploy multiple services, such as Virtual Machines, Virtual Networks, Storage, App Services, and databases. To simplify management of your application, you can organize all of the resources that share a common lifecycle into a single resource group.

Default resource group

The resource group that is used by the scripts, contains the following resources:

  • WebApp
  • SQL server
  • SQL database
  • Redis cache

You can modify this group or create a new one.

Create your own resource group

To create a resource group use the CreateSitefinityAzureResourceGroup.ps1, located in ~/Scripts folder. You must specify the following parameters:

  • WebsiteRootDirectory
  • DatabaseName
  • SqlServer
  • ResourceGroupName
  • AzureAccount
  • AzureAccountPassword
  • ResourceGroupLocation
  • TemplateFile
  • TemplateParameterFile

IMPORTANT: AzureResourceManager module requires Add-AzureAccount. A Publish settings file is not sufficient. Microsoft account cannot be used with PowerShell credential object with the Add-AzureAccount command. For this purpose you must use an Azure user. For more information, see How to install Azure PowerShell.

NOTE: There is a resource group template file ~/Scripts/Templates/Default.json that you can use. You must also specify the resource group template parameters, such as site name, SQL, hosting plan parameters, etc., in the Default.params.json template parameter file under the same folder.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?