mritsurgeon / VB365-as-a-Service

Azure Software as a Solution for Veeam Backup for Microsoft 365 as a Service
MIT License
5 stars 0 forks source link

image

VB365-as-a-Service

Azure Software as a Solution for Veeam Backup for Microsoft 365 as a Service

https://www.youtube.com/watch?v=gkfJVJlOcVo

Project Amafu

Project Amafu, which means "Clouds" in Zulu, is a SaaS offering that provides an easy-to-use backup solution for Office 365 users. The solution deploys a VSPC server and Veeam Cloud Connect in Azure, along with Veeam Backup for Office 365. It also uses the Microsoft SaaS Accelerator to deploy a web app and create an offer for the Microsoft Marketplace, which includes a landing page and webhook from the Saas Accelerator deployment.

When a customer subscribes to the offer, a logic app is triggered to automatically provision the customer to VSPC with the necessary resources to allow them to backup Microsoft 365. The logic app calls the VSPC API to create a new customer tenant and assigns a Veeam Backup for Office 365 server, storage, and user quota to the tenant. Finally, the logic app sends an email to the customer with the necessary details to access the user interface, including the credentials to log in to the VSPC server and the Veeam Backup for Office 365 allocated tenant.

This solution is a starting point for service providers to build a similar SaaS solution that can protect Office 365 data. The source code for the solution is provided, which can be customized and enhanced by service providers to fit their specific needs. This will help service providers compete with other SaaS providers in the market and provide a valuable service to their customers.

Getting Started

  1. Login to your Azure subscription and open Azure CLI.
  2. Clone the repository.
  3. Run Install.sh with the appropriate parameters.
  4. Take note of the final output of the installation, including the landing page, webhook, tenant ID, and AAD application ID.
  5. Login to the Microsoft Partner Center at the provided URL: https://partner.microsoft.com/
  6. Create an offer in the marketplace using the details captured from the installation output, and configure the offer's technical details.
  7. Return to the Azure Logic App and configure its properties. Add the placeholder thumbprint from the VSPC console security settings (optional if SSL certificate used) TLS/SSL certificate: Add the app setting, WEBSITE_LOAD_ROOT_CERTIFICATES, and set the value to the thumbprint for your TLS/SSL certificate.
  8. Configure the logic app parameters and add the correct values.
  9. Login to the VSPC VM and add the vb365 server to the configuration.(Temporrary Workaround: Upgrade VSPC & VB365 to V7 , Currently not available in AZ marketplace )
  10. Login to the vb365 server and configure backup resources.
  11. Login to the Admin portal web app through the provided URL in steps 4.
  12. Configure additional fields in the following order: VCSP-Company, VCSP-Email, and VCSP-User. Alternatively, change the text parser expression (note: currently set to use VCSP- prefix in split).
  13. Change the notification settings in the admin portal to enable notifications on subscription activation.
  14. In the configuration, allow for auto-provisioning.
  15. Configure STMP settings in Admin portal , Configure notifications Too email for the Trigger Inbox. ( to be replaced with API payload & Http trigger V2 )

Update

  1. Additional trigger added , rather than mail trigger DB trigger.
  2. Use SQLtrigger workflow.json for logic app.
  3. Configure DB connection string found in Key vault ( Default key ).
  4. Configure API body to match the correcet variable from array with expresion body('Field data')[0].
  5. Each Interger is the the custom filed data is captured on landing page IE. First Field [1].

Logic App Workflows

Workflow: New Email Arrives (V3)

Triggers when a new email is received and parses the email's body to extract the Company, Email, and Users information.

Workflow: Get Authentication Token

Gets an authentication token from the specified server and extracts the token from the response body.

Workflow: Create Company

Creates a new company on the specified server and extracts the company ID from the response body.

Workflow: Generate Password

Generates a random password using the specified JavaScript function.

Workflow: Get VCC Site UID

Gets the UID of the specified VCC site and extracts it from the response body.

Workflow: Assign VCC Site

Assigns the specified VCC site to the specified company on the specified server.

Workflow: Get VBM Resource UID

Gets the UID of the specified VBM resource and extracts it from the response body.

Workflow: Set VBM Resources

Sets up the specified VBM resource for the specified company on the specified server.

Workflow: Send Welcome Email

Sends a welcome email to the specified email address with the specified password.

Additional Workflows

Workflow Definition Update v2: SQL Trigger - Azure Logic App

This is a JSON object that defines a workflow in Azure Logic Apps. The workflow is triggered by a SQL Server database trigger that executes every 15 seconds, which retrieves newly added items from a table called "Subscriptions". The retrieved data is passed to the Logic App, where it is parsed as JSON data.

Workflow Actions

Execute Query

Retrieves data from a SQL Server database based on the specified query.

Parse JSON

Parses JSON data from the SQL Query and converts it into an array of objects.

For Each

Loops through each item in an array of rows and adds then to a Variable array. These are the values from custom landing page fields.

To access each array variable in later API calls you need to use expression body('Field data')[1] you will change interger as per order of fields on landing page.

Initialize Variable

Initializes a specified variable.

Triggers

The Workflow requires the following Parameters to be set in Azure Logic app:

{
  "Password": {
    "type": "String",
    "value": "VSPC PASSWORD"
  },
  "VB365Server": {
    "type": "String",
    "value": "VB365 SERVER NAME"
  },
  "VCCsite": {
    "type": "String",
    "value": "VCC SITE NAME"
  },
  "VSPCURL": {
    "type": "String",
    "value": "VSPC URL"
  },
  "servername": {
    "type": "String",
    "value": "VSPC SERVER NAME"
  },
  "username": {
    "type": "String",
    "value": "VSPC USERNAME"
  }

https://learn.microsoft.com/en-us/azure/logic-apps/create-parameters-workflows

Built With

Authors

Ian Engelbrecht
http://www.mritsurgeon.co.za/
Twitter @mritsurgeon_ian
https://www.linkedin.com/in/ian-veeam/

License

This project is licensed under the MIT License.


This is a set of scripts and workflows that automate the provisioning of a SaaS offer for Office 365 customers.

Prerequisites

Installation

To install this solution, follow these steps:

  1. Clone the repository
  2. Run the Install Script
./install.sh  -r <YourResourceGroupName> \
              -l <YourAzureLocation> \
              -v <YourVMName1> \
              -s <YourVMName2> \
              -u <YourVMUsername> \
              -p <YourVMPassword> \
              -n <YourVNetName> \
              -w <YourSubnetName> \
              -m <YourLogicAppName> \
              -a <YourWebAppNamePrefix> \
              -b <YourSQLserverName> \
              -e <AdminEmailForAccess>

Example

ian [ ~ ]$ gh repo clone mritsurgeon/VB365-as-a-Service
Cloning into 'VB365-as-a-Service'...
remote: Enumerating objects: 862, done.
remote: Counting objects: 100% (315/315), done.
remote: Compressing objects: 100% (219/219), done.
remote: Total 862 (delta 143), reused 198 (delta 86), pack-reused 547
Receiving objects: 100% (862/862), 216.38 KiB | 6.36 MiB/s, done.
Resolving deltas: 100% (371/371), done.
ian [ ~ ]$ chmod -R u+x VB365-as-a-Service/
ian [ ~ ]$ cd VB365-as-a-Service/Deployment/
ian [ ~/VB365-as-a-Service/Deployment ]$ chmod -R u+x *.sh
ian [ ~/VB365-as-a-Service/Deployment ]$ ./install.sh  -r vb365testRSA -l "eastus" -v vm1 -s vm2 -u veeam -p "Veeam@demo123" -n 365 -w logicapp -m mailtrigger -a vbsaas -b vbsaas -e "ian@contoso.com"

Usage

To use this solution, follow these steps:

The script expects some input parameters to be passed in when it is executed. Here is a list of the parameters you need to provide:

Static parameters

(these are maintained with the code)

Global Parameters

(These are set by the user, but used more than once throughout the scripts)

Required Parameters for Deploying

(These are set by the user, but specific to creating 2 VMs)

Required Parameters for Deploying Logic App and Web App

(These are set by the user, but specific to creating Logic App & deploying MS SaaS accelerator)

These parameters allow you to customize the deployment of the solution to fit your specific needs.