When installing the Azure Stack Microsoft SQL resource provider, this needs to be done from a computer where Azure Stack and Azure PowerShell has been installed. If you have installed any versions of the AzureRM or Azure Stack PowerShell modules other than 1.2.9 or 1.2.10, you will need to remove them. This includes versions 1.3 or higher.
Now we need to download the resource provider. The download location for the Microsoft SQL resource provider is https://aka.ms/azurestacksqlrp.
After you have downloaded the file, you will need to log on as the AzureStackAdmin account and extract it on the deployment VM.
On multi-node deployments, you need to provide your own certificates and copy to a local directory. You need the following certificates:
- A wildcard certificate for *.dbadapter.<region>.<external fqdn> needs to be created. This certificate must be trusted and the certificate chain must work properly.
- The root certificate used by your Azure Resource Manager instance. If it is not available, it will be extracted.
While preparations are now finished, we can start the deployment by running the following deployment script called DeploySqlProvider.ps1 from an elevated PowerShell prompt.
During the deployment, the following steps are performed:
- Upload the certificates to a storage account on your Azure Stack system
- Publish gallery packages to the gallery
- Deploy a VM using the Windows Server 2016 image and install the resource provider on it
- Register a local DNS entry that maps to the resource provider VM
- Register the resource provider with the Azure Stack Resource Manager (tenant and admin)
With the following PowerShell script, provided by Microsoft, the installation will run through, if you would change the accounts and REST endpoints, if needed before:
# Install the AzureRM.Bootstrapper module Install-Module -Name AzureRm.BootStrapper -Force # Installs and imports the API Version Profile required by Azure Stack into the current PowerShell session. Use-AzureRmProfile -Profile 2017-03-09-profile Install-Module -Name AzureStack -RequiredVersion 1.2.10 -Force # Download the Azure Stack Tools from GitHub and set the environment cd c: Invoke-Webrequest https://github.com/Azure/AzureStack-Tools/archive/master.zip -OutFile master.zip Expand-Archive master.zip -DestinationPath . -Force # This endpoint may be different for your installation Import-Module C:AzureStack-Tools-masterConnectAzureStack.Connect.psm1 Add-AzureRmEnvironment -Name AzureStackAdmin -ArmEndpoint https://adminmanagement.local.azurestack.external # For AAD, use the following $tenantID = Get-AzsDirectoryTenantID -AADTenantName <your directory name> -EnvironmentName AzureStackAdmin # For ADFS, replace the previous line with # $tenantID = Get-AzsDirectoryTenantID -ADFS -EnvironmentName AzureStackAdmin $vmLocalAdminPass = ConvertTo-SecureString P@ssw0rd1 -AsPlainText -Force $vmLocalAdminCreds = New-Object System.Management.Automation.PSCredential (sqlrpadmin, $vmLocalAdminPass) $AdminPass = ConvertTo-SecureString P@ssw0rd1 -AsPlainText -Force $AdminCreds = New-Object System.Management.Automation.PSCredential ([email protected], $AdminPass) # change this as appropriate $PfxPass = ConvertTo-SecureString P@ssw0rd1 -AsPlainText -Force # Change directory to the folder where you extracted the installation files and adjust the endpoints <extracted file directory>DeploySQLProvider.ps1 -DirectoryTenantID $tenantID -AzCredential $AdminCreds -VMLocalCredential $vmLocalAdminCreds -ResourceGroupName SqlRPRG -VmName SqlVM -ArmEndpoint https://adminmanagement.local.azurestack.external -TenantArmEndpoint https://management.local.azurestack.external -DefaultSSLCertificatePassword $PfxPass
As per https://www.microsoft.com, the DeploySQLProvider.ps1 has the following parameters that you can modify for a different installation behavior:
Parameter name |
Description |
Comment or default value |
DirectoryTenantID |
The Azure or ADFS Directory ID (GUID). |
required |
AzCredential |
Provide the credentials for the Azure Stack service admin account. You must use the same credentials as you used for deploying Azure Stack. |
required |
VMLocalCredential |
Define the credentials for the local administrator account of the SQL resource provider VM. This password is also used for the SQL sa account. |
required |
ResourceGroupName |
Define a name for a resource group in which items created by this script will be stored, for example, SqlRPRG. |
required |
VmName |
Define the name of the virtual machine on which to install the resource provider, for example, SqlVM. |
required |
DependencyFilesLocalPath |
Your certificate files must be placed in this directory as well. |
optional |
DefaultSSLCertificatePassword |
The password for the .pfx certificate. |
required |
MaxRetryCount |
Define how many times you want to retry each operation if there is a failure. |
2 |
RetryDuration |
Define the timeout between retries in seconds. |
120 |
Uninstall |
Remove the resource provider and all associated resources (refer to the following notes). |
No |
DebugMode |
Prevents automatic cleanup on failure. |
No |