How to install Microsoft SharePoint 2019 in Azure Virtual Machine for demo / labs or personal use?

Before you start reading this I would like to mention that steps mentioned here are to create a Virtual Machine in Azure for demo, development or labs purpose.

I decided to write this blog as I faced some difficulties while installing SharePoint 2019 on Azure Virtual Machine, I never faced these while installing it on Physical machines or company provided Virtual Machines.

We are going to install everything in one box that is SQL Server and SharePoint 2019 both which means “Single Server Farm”, although Microsoft recommends to have a separate server for SQL server but I was able to install both in same. Read more here: https://docs.microsoft.com/en-us/sharepoint/install/planning-for-a-minrole-server-deployment-in-sharepoint-server

Steps are broadly like this:

  • Create a virtual machine in Azure with SQL Server 2016 installed already
  • Add a domain services in Azure Virtual Machine
  • Install SharePoint 2019

Create a Virtual Machine in Azure

You can always create a free Azure Account from here https://azure.microsoft.com/en-us/free/.

Once you have created an account please login to https://portal.azure.com

Follow the steps as shown below:

  1. Click on the menu and select “Virtual Machines” and then click Add from top
Azure Virual machine creation
Azure Virtual Machine List

2. Once you get to the page you will have lots of tabs to filled in, I have highlighted few fields which are required and needs to be filled in, rest of it can be left as is.

Important field which we need to select is “Image” that is we need a Windows Server etc, for easy installation I will be selecting a Windows server with SQL Server 2016 already installed in it so that we don’t have to do that manually.

Creating Azure Virtual machine

3. Select “Browse all public and private images” and search for SQL server 2016 and select Standard SP 2 version, for size I recommend 4 CPU and 16 GB memory else the server runs very slow as SQL and SharePoint both are running on the same server.

4. Next step is to create an Admin account so pick a name and password which you can remember. After that you can click “Review + Create”, although there are lot of other things which can be filled in but sake of simplicity I will just leave them as is.

Review and create Azure Virtual Machine

5. Once on the Review tab, click “Create” to create the Virtual Machine. It will start the deployment process and might take 10 minutes. You can check the progress while it deploys.

6. After creation you can check the Virtual Machine in the list, click on the name to access it.

Azure virtual machine list

7. Click on the name and you will get to a window as show below, to connect to the machine we should RDP it, so click Connect and chose RDP. It will download a file which can be used to connect to machine using the Admin account you have created. This finishes step for creating Virtual Machine.

Azure Virtual machine created

Add domain servcies to Virtual Machine

Initially I had thought that this steps is not needed but it does not work if Virtual Machine is not connected to a domain, you will get an error at the end of SharePoint 2019 installation that is Search Service Application will not be created successfully. You may get errors like below

The SDDL string contains an invalid sid or a sid that cannot be translated.Parameter name: sddlFormSystem.ArgumentException: The SDDL string contains an invalid sid or a sid that cannot be translated.Parameter name: sddlForm at System.Security.AccessControl.RawSecurityDescriptor.BinaryFormFromSddlForm(String sddlForm) at System.Security.AccessControl.RawSecurityDescriptor..ctor(String sddlForm) at

Errors were encountered during the configuration of the Search Service Application. System.ArgumentException: The SDDL string contains an invalid sid or a sid that cannot be translated. Parameter name: sddlForm at System.Security.AccessControl.RawSecurityDescriptor.BinaryFormFromSddlForm(String sddlForm) at Microsoft.SharePoint.Win32.SPNetApi32.CreateFileShareWithSecurity(String name, String description, String path, String sddl) at Microsoft.Office.Server.Search.Admi.nistration.AnalyticsAdministration.CreateAnalyticsUNCShare(String dirParentLocation, String shareName) at Microsoft.Office.Server.Search.Administration.AnalyticsAdministration.ProvisionAnalyticsShare(SearchServiceApplication serviceApplication) at Microsoft.Office.Server.Search.Administration.AnalyticsAdministration.CreateDefaultStoreLocation(SearchServiceApplication serviceApplication) at Microsoft.Office.Server.Search.Administration.AnalyticsAdministration.ProvisionRawEventStore(SearchServiceApplication serviceApplication) at Microsoft.Office.Server.Search.Administration.AnalyticsServiceAdministration.Provision() at Microsoft.Office.Server.Search.Administration.SearchServiceApplication.Provision() at Microsoft.Office.Server.Search.Administration.SearchAdminUtils.UpdateIgnoreSPUpdatedConcurrencyException(String description, SearchAdminUtilsUpdateDelegate updateDelegate, SearchAdminUtilsRefreshObjectDelegate refreshObjectDelegate) at Microsoft.Office.Server.Search.Administration.SearchConfigWizard.CreateSearchApp() at Microsoft.Office.Server.Search.Administration.SearchConfigWizard.ProvisionSearchServiceApplication() at Microsoft.Office.Server.Search.Administration.SearchConfigurationJobDefinition.ExecuteTimerJob()

To add a domain follow steps listed in the article which is very detailed https://social.technet.microsoft.com/wiki/contents/articles/12370.windows-server-2012-set-up-your-first-domain-controller-step-by-step.aspx

Once that is done you have got rid of other error which will come as now you will be using a domain account and not local account to install SharePoint 2019.

The specified user “username” is a local account. Local accounts should only be used in standalone mode.

Check SQL Server settings :

  1. Open SQL Server Management Studio which should be installed already as we had got server with SQL server already installed.
  2. The account which will install SharePoint 2019 should have required access like below, this account is same as what you had created while creatin Virtual Machine. You can find it under Logins and make sure you have selected “dbcreator” and “securityadmin”. This will make sure the account has correct access to create databases while installing SharePoint 2019.
SQL Server SharePoint 2019

3. Another thing we need to do is to make sure the account which you updated above has name as “domain\username”, initially it will have name as “computername\username”, since we when we created Virtual Machine with SQL server there was no domain it will remain as is. If you miss this step then you will have issues while creating Search Service Application. So remember to change name as suggested by right clicking and rename. Error message while installing SharePoint 2019 will be like below

The service application “Search Service Application” could not be created because of the following error: System.Data.SqlClient.SqlException (0x80131904): Windows NT user or group

If you are installing in SharePoint 2019 for Production usage make sure you plan for accounts properly, read more here https://docs.microsoft.com/en-us/sharepoint/security-for-sharepoint-server/plan-for-administrative-and-service-accounts

Install SharePoint 2019: so finally let’s get started with SharePoint 2019 installation.

  1. Login to Azure Virtual Machine.
  2. Download SharePoint 2019 from here : https://www.microsoft.com/en-us/download/details.aspx?id=57462
  3. Once downloaded first step is to install pre-requisites, make sure you have an internet connection else it will not work. Click on “Pre-Requisites”, you will the installation happening
Shareoint 2019 installation

4. Once that is done successfully double click “setup” to installing SharePoint 2019, it will start the installation, check pictures below to understand the steps, in the step 2 make sure you use the same account you had created before with format as “domain\username”, in step 3 select “Single Farm”.

Once the above steps are done a IE window will open to configure further, you can chose to perform rest of the steps manually or run the wizard, I chose to run wizard.

So this should finish your SharePoint 2019 installation and you are ready to use it.

Connect with me on Twitter or Linked In if you need more information.

How to call Microsoft Graph API from PowerShell to get Microsoft Teams details?

Let’s start with PowerShell script and then we can break it down, so here is a code which can get details of a team using Graph API.

There are bunch of parameters which you need to replace it with your own details and in this blog I will explain how to get those.

$clientId = "<<yourclientid>>"  
$clientSecret = "<<yourclientsecret>>"  
$tenantName = "<<yourteanantname">>  
$resource = "https://graph.microsoft.com/"  
$URL = "https://graph.microsoft.com/v1.0/teams/<<yourteamdid>>"  
  
  
$tokenBody = @{  
    Grant_Type    = "client_credentials"  
    Scope         = "https://graph.microsoft.com/.default"  
    Client_Id     = $clientId  
    Client_Secret = $clientSecret  
}   
  

$tokenResponse = Invoke-RestMethod -Uri "https://login.microsoftonline.com/$TenantName/oauth2/v2.0/token" -Method POST -Body $tokenBody  
Invoke-RestMethod -Headers @{Authorization = "Bearer $($tokenResponse.access_token)"} -Uri $URL

So let’s start with “yourclientid” and “yourclientsecret”, for these we need to login to Azure portal and do an “App Registration”. To call an Graph API you need an App to with correct access to resources.

URL to Azure portal: https://portal.azure.com/

Follow below steps to get the App Registration done:

  • Once you have logged into Azure portal, search for “App Registration” and click “New registration”
Azure App Registration
Azure New Registration
  • Give a name as you would like and click “Register”.
Register App in Azure
  • Important thing to note is Application (client) ID which you need to provide as <<yourclientid>>
App Registration Azure
  • Click on API permissions on left and click “Add a permission” and then select “Application permissions”.
API Permissions Graph
  • We have to give specific permissions so that we can read data, search for “group” and select “Read.All” as shown below and the click “Add Permissions”.
Add Permissions Azure API
  • Don’t forget to click “Grand admin consent for xxxx” else your API will not work
Add Permissions Azure Graph API
  • Next step is to create a secret so click “Certificates & secrets” on left menu. Click on “New Client Secret” and give a name and click Add, If it’s production better to select Expires as Never.
Certificates and Secrets Graph API
  • Once created please copy and keep it which will be our another pramater that is “<<yourclientsecret>>”.
Client Secret Graph API
Install-Module MicrosoftTeams
Import-Module MicrosoftTeams
$credentials=Get-Credential
Connect-MicrosoftTeams -Credential $credentials
Get-Team

So now we have got all the parameters so you can run the PowerShell by applying the values you have found and created and result will be like below

So this is a very basic example of calling Graph API from PowerShell and get details of Teams.

I will be writing another blog very soon to get all Apps used in Teams of a tenant which will be based on above concept.

Connect with me on Twitter or Linked In if you need more information.

References:

What is Azure Machine Learning ? #Azure #MachineLearning

Azure Machine Learning is a cloud based predictive analytics service which is easy to use and give fast and reliable results using its predefined algorithms and models.

Using Machine learning in broad / high level manner needs 4 steps described as below

  1. Data collection or generation
    • Collect data from source
    • Store in Azure Storage, SQL etc
    • Refine data if needed
  2. Create Machine Learning models
    • Use Machine Learning Azure Studio
    • Easy to use drag drop interface
  3. Output data as Web Service
    • Run the model to output data as web service
  4. Use output for intelligence or insights
    • Based on output make sites or Apps intelligent
    • Create insights and make predictions

Diagram for Azure Machine Learning

azuremachinelearning
Azure Machine Learning