Deploy new Scifeon Instance to Azure

1. Create database
- Database name:
Scifeon_SQL_[customer]_[Prod|Test]_YYYYMMDD
- Database Server:
scirex-customers1-west-europe.database.windows.net
Create new database here: https://portal.azure.com/#blade/HubsExtension/Resources/resourceType/Microsoft.Sql%2Fservers%2Fdatabases
Database Name: Scifeon_SQL_[customer]_[Prod|Test]_YYYYMMDD
Resource Group: Scifeon-Customers-West-Europe
Server: scirex-customers1-west-europe.database.windows.net
Pricing Tier: Basic
2. Connect to Database Server using SQL Server Management Studio
Database data user
Create a new database data user (save password in deployment_keys.kdbx
- use master password from GoogleDrive/KeePass/Scifeon.kdbx/deployment_keys.kdbx
):
On master database:
CREATE LOGIN Scifeon_SQL_[customer]_[Prod|Test]_YYYYMMDD WITH PASSWORD = '<strong password>'
GO
On database Scifeon_SQL_[customer]_[Prod|Test]_YYYYMMDD
:
CREATE USER Scifeon_SQL_[customer]_[Prod|Test]_YYYYMMDD
FOR LOGIN Scifeon_SQL_[customer]_[Prod|Test]_YYYYMMDD
WITH DEFAULT_SCHEMA = dbo
GO
-- Add user to the database owner role
EXEC sp_addrolemember N'db_datareader', N'Scifeon_SQL_[customer]_[Prod|Test]_YYYYMMDD'
GO
EXEC sp_addrolemember N'db_datawriter', N'Scifeon_SQL_[customer]_[Prod|Test]_YYYYMMDD'
GO
Database DDL user
Create a new user for updating tables, views, etc. (save password in deployment_keys.kdbx
- use master password from GoogleDrive/KeePass/Scifeon.kdbx/deployment_keys.kdbx
) - notice the __DDL_-postfix on the username:
On master database:
CREATE LOGIN Scifeon_SQL_[customer]_[Prod|Test]_YYYYMMDD_DDL WITH PASSWORD = '<strong password>'
GO
On database Scifeon_SQL_[customer]_[Prod|Test]_YYYYMMDD
:
CREATE USER Scifeon_SQL_[customer]_[Prod|Test]_YYYYMMDD_DDL
FOR LOGIN Scifeon_SQL_[customer]_[Prod|Test]_YYYYMMDD_DDL
WITH DEFAULT_SCHEMA = dbo
GO
-- Add user to the database owner role
EXEC sp_addrolemember N'db_datareader', N'Scifeon_SQL_[customer]_[Prod|Test]_YYYYMMDD_DDL'
GO
EXEC sp_addrolemember N'db_datawriter', N'Scifeon_SQL_[customer]_[Prod|Test]_YYYYMMDD_DDL'
GO
EXEC sp_addrolemember N'db_ddladmin', N'Scifeon_SQL_[customer]_[Prod|Test]_YYYYMMDD_DDL'
GO
2. App Service
- [app_service_plan_test1]:
Scifeon-Test-West-Europe
S1 (max 10 instances) - [app_service_plan_prod1]:
Scifeon-Prod-West-Europe
S1 (max 10 instances)
App services are hosted in App Service Plans. The name of the App Service Plan indicates where the App Service Plan is hosted.
Create App Service
Create new App Service here: https://portal.azure.com/#blade/HubsExtension/Resources/resourceType/Microsoft.Web%2Fsites Choose Web App > Create
App name: Scifeon-[customer]-[Prod|Test]-YYYYMMDD
Resource Group: Scifeon-Customers-West-Europe
App Service Plan/Location: Scifeon-[Prod|Test]-West-Europe
After creation, open the App Service > Application Settings > Set "Always On" to "On" > Save
3. DNS and SSL
- Go to One.com DNS administration: https://www.unoeuro.com/controlpanel/dns.php
- Add new DNS CNAME record: [customer]-[test].scirex.cloud > Scifeon-[customer]-[Prod|Test]-YYYYMMDD.azurewebsites.net
- Add the hostname to the App Service (Custom Domains > Add hostname)
SSL: See this guide
4. Deploy using VSTS
- Clone an existing [Customer].[Env] environment:
- Name the environment:
[Customer].[Env]
where[Customer]
should match a root group in thedeployment_keys.kdbx
-file, and[Env]
should match a sub-group of the root group. - Make sure the Trigger is Manual Only
- Change the App Service in the "Deployment process" (where environment name is set)
- Release and Deploy (only the new environment, i.e. deselect automatic deployment of test)