- Azure automation account
- Windows Hybrid worker (if SAP message server doesn't have a public IP)
- Microsoft PowerApps
- SharePoint List
What’re the features of the SAPSnooze Application?
You can use SAPSnooze PowerApps application to get status of the SAP system and VMs. You can also use it start systems that are stopped in Azure.
Create a SharePoint List "SAP System List" with the following properties IMPORTANT: Please use the same list name and column names as they're referenced in multiple places in the PowerApps application)
SharePoint List properties:
A SharePoint list with the following columns needs to be created for maintain system information for PowerApps application. All columns will be of the type "Single line of text".
- Title – Title of the application. PowerApps application landing page will group the systems according to their application.
- SID – SAP System ID
- ResourceGroupName – Azure resource group that hosts the virtual machines for the SAP system
- Status – Status of the SAP system. Allowed values are (Online, Offline, Unknown, Starting)
- SAPStatus – Status of the SAP system
- VMStatus – Status of virtual machines in Azure
- User – Email address of the user who started the system
- MESSAGESERVERHOST – Message server host name of the SAP system
- MESSAGESERVERHTTPPORT – Message server HTTP port of the SAP system (81XX)
Create the system list by filling in the above properties
SharePoint List permissions:
The system account used in Azure Automation should have edit access on the SharePoint list. All users of the SAPSnooze application should have edit access on the SharePoint list. This can be granted either individually or by an active directory security group.
Setting up Azure runbooks:
Following runbooks need to be imported from \Runbooks in your Azure automation account
- Get-SAPSnoozeSystemStatus.ps1 – Runbook to get status of SAP systems. This should be scheduled to run every 15 mins. You will need to create 4 schedules with 1 hour frequency to start at 15 minutes intervals.
- Start-SAPSnoozeSystem.ps1 – Runbook to start VMs. Once this runbook is created, create a webhook and capture the URL. (The webhook will be of the following format https://"AzureWebHookHost"/webhooks?token="token". Capture the AzureWebHookHost name and the token. Please note if the token has %3d at the end, then replace that with "=")
By default the credential for the user with edit access to the SharePointList is referenced as below in the runbook. If you name it differently, then please update the runbook as well. SharePoint_"UserName" (E.g. SharePoint_user@something.com)
If the message server has a public IP
- You can use public IP as messageserver host in the SharePointlist. If you're using Public IP, please make sure that the message server http port is allowed in NSG.
- Import SharePointSDK module in your Azure Automation Account from "Modules gallery"
- Import SAPSnooze module from \Modules in your Azure Automation Account
- You can schedule the runbook to run as an Azure runbook. The runbook will require two input parameters:1) SharePointURL (SharePoint URL that has the 'SAP System List'. E.g. https://microsoft.sharepoint.com/teams/SomeSite) 2) SharePointUserName (An account with edit access on the SharePointlist. E.g. email@example.com)
If the message server doesn't have a public IP
- Please setup a Windows Hybrid Runbook Worker that can access the messageserver host by following the instructions here. https://docs.microsoft.com/en-us/azure/automation/automation-windows-hrw-install
- Install SharePointSDK module on all your Hybrid worker (Install-Module SharePointSDK -Force)
- Import SAPSnooze module from the repo in your Azure Automation Account
- Copy SAPSnooze module from the repo to the directory C:\SAPSnooze on all hybrid workers
- Please schedule the runbook to run on the hybrid worker. The runbook will require two input parameters:1) SharePointURL (SharePoint URL that has the 'SAP System List'. E.g. https://microsoft.sharepoint.com/teams/SomeSite) 2) SharePointUserName (An account with edit access on the SharePointlist. E.g. firstname.lastname@example.org)
The runbook Start-SAPSnoozerunbook requires an Azure automation Run As account which has start VM access the resource groups in scope. Please find instructions for setting up Azure automation Run As account here. https://docs.microsoft.com/en-us/azure/automation/manage-runas-account
Creating PowerApps application
Create PowerApps Connectors:
- Go to PowerApps Studio:https://preview.create.powerapps.com/studio/#
- Create a new Connection for SharePoint.
- Use the credentials of a user who has read and write permissions on the SharePoint List that you’ve created in the above step.
- Open the file /PowerApps/Start-SAP-Systems.swagger.json and update value AzureWebHookHost with the host name in the webhook URL
- Create a new custom connector “Start SAP Systems” using the file /PowerApps/Start-SAP-Systems.swagger.json
- Create the connection "Start SAP Systems" using the newly created custom connector
- Once the connectors are created, then import the PowerApps package from \PowerApps\SAPSnooze.zip by using the "Import canvas app" button to create the application
- Click on the Action button to select the name of application and connectors and then click on import to finish importing the application.
Once created, edit the application in PowerApps studio
- Go to “Start” button function and update the web hook token that you’ve created in the step to setup Azure runbooks (only the token is required not the whole URL. Also as mentioned in the setup above, if the token has a %3d at the end, then please replace that with "=")
- Go to “View --> Data Sources”. Click on "Add data source", select the SharePoint connection that you created above, enter the SharePoint site URL and choose the SharePoint list "SAP System List"
Permission to PowerApps can be given to individual users or using active directory security groups. Please note people who’ve been access to PowerApps application should also be given edit access to the SharePoint list that’s created in the previous step.