van toepassing op:
SQL Server 2022 (16.x)
Notitie
Deze functie is beschikbaar in SQL Server 2022 (16.x) of latere versies en wordt alleen ondersteund voor on-premises SQL Server voor Windows- en Linux-hosts en SQL Server 2022 op Windows Azure-VM's.
In dit artikel wordt uitgelegd hoe u de Microsoft Entra-beheerder instelt voor verificatie met Microsoft Entra-id (voorheen Azure Active Directory) voor SQL Server met behulp van Azure Portal en API's zoals:
- PowerShell
- De Azure CLI
- ARM-sjabloon
We gaan ook de bijgewerkte functionaliteit over om een Microsoft Entra-beheerder in te stellen voor SQL Server in Azure Portal waarmee automatisch certificaat kan worden gemaakt en toepassingsregistratie kan worden geregistreerd. Voorheen vereiste het opzetten van Microsoft Entra-verificatie voor SQL Server de handmatige configuratie van de beheerder van Microsoft Entra met een Azure-certificaat en toepassingsregistratie.
Notitie
Hoewel Microsoft Entra ID de nieuwe naam is voor Azure Active Directory (Azure AD), blijft Azure AD om te voorkomen dat bestaande omgevingen worden onderbroken, aanwezig in sommige hardgecodeerde elementen zoals UI-velden, verbindingsproviders, foutcodes en cmdlets. In dit artikel zijn de twee namen uitwisselbaar.
Voorwaarden
Voorbereiding voordat u de Microsoft Entra-beheerder instelt
De volgende machtigingen zijn nodig om de Microsoft Entra-beheerder in te stellen in de SQL Server - Azure Arc en Key Vault resources.
Volg de handleiding om ervoor te zorgen dat uw SQL Server verbonden is met Azure Arc. De gebruiker die de Microsoft Entra-beheerder instelt voor de SQL Server - Azure Arc-resource, moet de rol van Bijdrager voor de server hebben.
- Ga naar de Azure portal
- Selecteer SQL Server – Azure Arcen selecteer het exemplaar voor uw SQL Server-host.
- Selecteer Toegangsbeheer (IAM).
- Selecteer Voeg roltoewijzing toe>Voeg toe om de rol Inzender toe te voegen aan de gebruiker die de Microsoft Entra-beheerder instelt.
Maak, indien u er nog geen hebt, een Azure Key Vault . De gebruiker die Microsoft Entra-beheerder instelt, moet de rol Inzender hebben voor uw Azure Key Vault. Een rol toevoegen aan een gebruiker in Azure Key Vault:
- Ga naar de Azure portal
- Ga naar uw Key Vault bron.
- Selecteer de Toegangsbeheer (IAM).
- Selecteer Voeg roltoewijzing toe>Voeg toe om de rol Inzender toe te voegen aan de gebruiker die de Microsoft Entra-beheerder instelt.
Toegangsbeleid instellen voor de SQL Server-host
Navigeer in Azure Portal naar uw Azure Key Vault-exemplaar en selecteer toegangsbeleid.
Selecteer Toegangsbeleid toevoegen.
Gebruik signvoor sleutelmachtigingen.
Voor geheime machtigingenselecteert u Ophalen en Opvragen.
Voor certificaatmachtigingen selecteert u ophalen en opsommen.
Selecteer Volgende.
Zoek op de pagina Principal naar de naam van uw machine- Azure Arc-exemplaar. Dit is de hostnaam van de SQL Server-host.
Sla de toepassing (optioneel)-pagina over door twee keer op Volgende te klikken of op Beoordelen en makente klikken.
Controleer of de object-id van de Principal- overeenkomt met de Principal-id van de beheerde identiteit die is toegewezen aan het exemplaar.
Als u dit wilt bevestigen, gaat u naar de resourcepagina en selecteert u JSON-weergave in de rechterbovenhoek van het vak Essentials op de pagina Overzicht. Onder identiteit vindt u de principalId.
Selecteer Maken.
U moet Aanmaken selecteren om ervoor te zorgen dat de autorisaties worden toegepast. Als u wilt controleren of machtigingen zijn opgeslagen, vernieuwt u het browservenster en controleert u of de rij voor uw Azure Arc-exemplaar nog steeds aanwezig is.
Toegangsbeleid instellen voor Microsoft Entra-gebruikers
- Navigeer in Azure Portal naar uw Azure Key Vault-exemplaar en selecteer toegangsbeleid.
- Selecteer Toegangsbeleid toevoegen.
- Voor sleutelmachtigingenselecteert u Ophalen, lijsten maken.
- Voor geheime machtigingenselecteert u ophalen, lijsten instellen.
- Voor certificaatmachtigingen selecteert u Ophalen, Lijst, en Maken.
- Voor selecteert u hoofdgebruiker, voeg de Microsoft Entra-gebruiker toe die u wilt gebruiken om verbinding te maken met SQL Server.
- Selecteer toevoegen en selecteer opslaan.
De Microsoft Entra-beheerder instellen voor SQL Server
Met nieuwe API's en portalfunctionaliteit kunnen gebruikers een Microsoft Entra-beheerder instellen voor SQL Server zonder dat ze afzonderlijk een Azure-certificaat en Microsoft Entra-toepassing hoeven te maken. Selecteer een tabblad voor meer informatie over het instellen van een Microsoft Entra-beheerder voor uw SQL Server die is verbonden met Azure Arc met automatisch maken van certificaten en toepassingen.
Gebruik Azure Portal om een Microsoft Entra-beheerder in te stellen, een Azure Key Vault-certificaat en Microsoft Entra-toepassing in hetzelfde proces te maken. Dit is nodig voor het gebruik van Microsoft Entra-verificatie met SQL Server.
Microsoft Entra-beheerder instellen met behulp van Azure Portal
Ga naar de Azure Portalen selecteer SQL Server – Azure Arc. Selecteer het exemplaar voor uw SQL Server-host.
Controleer de status van uw SQL Server - Azure Arc-resource en kijk of deze is verbonden door naar het menu Eigenschappen te gaan. Zie Uw SQL Server-resources met Arc validerenvoor meer informatie.
Selecteer Microsoft Entra-id en Purview- onder Instellingen in het resourcemenu.
Selecteer Instellen beheerder om het deelvenster Microsoft Entra ID te openen en kies een account dat wordt toegevoegd als beheerder login voor SQL Server.
Selecteer servicebeheerde certificaat.
Selecteer Wijzig sleutelkluis en selecteer uw bestaande Azure Key Vault-resource.
Selecteer door de service beheerde app-registratie.
Selecteer opslaan. Hiermee wordt een aanvraag verzonden naar de Arc-serveragent, waarmee Microsoft Entra-verificatie voor dat SQL Server-exemplaar wordt geconfigureerd. Het kan enkele minuten duren voordat de bewerking is voltooid; wacht totdat het opslagproces is bevestigd met Saved successfully
voordat u een Microsoft Entra-aanmelding probeert uit te voeren.
De registratie van door de service beheerde app doet het volgende voor u:
- Hiermee maakt u een certificaat in uw sleutelkluis met een naam in het formulier
<hostname>-<instanceName><uniqueNumber>
.
- Hiermee maakt u een Microsoft Entra-toepassing met een naam zoals
<hostname>-<instanceName><uniqueNumber>
en wijst u de benodigde machtigingen toe aan die toepassing. Zie Aanvraagvergunningen voor meer informatie
- Hiermee wijst u het nieuwe certificaat in Azure Key Vault toe aan de toepassing.
- Slaat deze instellingen op in Azure Arc.
Met het onderstaande Azure CLI-script stelt u een Microsoft Entra-beheerder in, maakt u een Azure Key Vault-certificaat en maakt u een Microsoft Entra-toepassing. Er is een extra sectie met een voorbeeldscript voor het instellen van een Microsoft Entra-beheerder wanneer er al een certificaat en toepassing bestaan.
Notitie
De certificaten die zijn gemaakt voor de Installatie van Microsoft Entra, worden niet automatisch geroteerd.
-
De Azure CLI versie 2.37.0 of hoger is vereist
- Az.ConnectedMachine 0.5.1 of hoger is vereist
Gebruik Az.ConnectedMachine
om de az extension add --name ConnectedMachine
-module te installeren. Gebruik az version
om te controleren welke versie van de Azure CLI is geïnstalleerd.
De volgende invoerparameters worden gebruikt voor het Azure CLI-script:
-
<applicationName>
- Toepassingsnaam die wordt gemaakt
-
<certSubjectName>
- Certificaatnaam dat zal worden aangemaakt
-
<keyVaultName>
: de naam van uw sleutelkluis. Deze sleutelkluis moet worden gemaakt voordat het script wordt uitgevoerd
-
<machineName>
- Machinenaam van uw SQL Server-host
-
<resourceGroupName>
- Naam van resourcegroep die uw SQL Server - Azure Arc-exemplaar bevat
-
<adminAccountName>
- Microsoft Entra-beheerdersaccount dat u wilt instellen voor uw SQL Server
-
<instanceName>
- Optionele parameter voor benoemde SQL Server-exemplaren. Gebruik deze parameter wanneer u een benoemd exemplaar hebt. Als u dit weglaat, wordt de standaardnaam van MSSQLSERVER
gebruikt
-
<tenantId>
- Optionele parameter voor tenant-id. U kunt de tenant-id vinden door naar de Azure-portalte gaan en naar uw Microsoft Entra ID resource te gaan. In het deelvenster Overzicht zou u de Tenant ID moeten zien. Als u dit weglaat, wordt de standaardtenant-id gebruikt als parameter
-
<subscriptionId>
- Optionele parameter voor abonnements-id. Uw abonnements-id vindt u in Azure Portal. Als u dit weglaat, wordt de standaardabonnements-id gebruikt
Als u het onderstaande Azure CLI-script wilt gebruiken, slaat u het script op als een .ps1
bestand en voert u de volgende opdracht uit:
./aadAzCliSetup.ps1 -applicationName "<applicationName>" -certSubjectName "<certSubjectName>" -keyVaultName "<keyVaultName>" -machineName "<machineName>" -resourceGroupName "<resourceGroupName>" -adminAccountName "<adminAccountName>" -instanceName "<instanceName>" -tenantId "<tenantId>" -subscriptionId "<subscriptionId>"
Het Azure CLI-script
Notitie
Voor SQL Server op Linux-hostcomputers vervangt u WindowsAgent.SqlServer
door LinuxAgent.SqlServer
in het script.
# AZ CLI and AZ CLI's connected machine extension must be installed before running this script
param (
[Parameter(mandatory=$true)] $applicationName,
[Parameter(mandatory=$true)] $certSubjectName,
[Parameter(mandatory=$true)] $keyVaultName,
[Parameter(mandatory=$true)] $machineName,
[Parameter(mandatory=$true)] $resourceGroupName,
[Parameter(mandatory=$true)] $adminAccountName,
$instanceName,
$tenantId,
$subscriptionId
)
# Constants
#
$NUMRETRIES = 60
# Helper functions
#
function ConvertFrom-StringArray {
param (
[string[]] $stringArray
)
if (!$stringArray)
{
return $null
}
else
{
return ConvertFrom-JSON ($stringArray -join "`n")
}
}
# Check parameters
#
if ([string]::IsNullOrEmpty($instanceName))
{
Write-Host "Warning: SQL Instance name (-instanceName) not provided. Default of MSSQLSERVER will be used"
$instanceName = "MSSQLSERVER"
}
$tenantIdArgument = ""
if ([string]::IsNullOrEmpty($tenantId))
{
Write-Host "Warning: Tenant ID (-tenantId) not supplied to the script, so default tenant is being used"
}
else
{
$tenantIdArgument = "-TenantId '" + $tenantId + "'"
}
$subscriptionIdArgument = ""
if ([string]::IsNullOrEmpty($subscriptionId))
{
Write-Host "Warning: Subscription ID (-subscriptionId) not supplied to the script, so default subscription is being used"
}
else
{
$subscriptionIdArgument = "-SubscriptionId '" + $subscriptionId + "'"
}
# Login and select subscription
#
$login = az login --tenant $tenantId --use-device-code
if (!$login)
{
Write-Error "Login to Azure AD failed. Exiting."
exit 1
}
if ($subscriptionId)
{
az account set -s $subscriptionId
}
$accountInfo = ConvertFrom-StringArray (az account show)
if (!$accountInfo)
{
Write-Error "Cannot query logged in Azure AD account. Check that 'az login' and 'az account set' succeeded"
exit 1
}
if ($subscriptionId)
{
if ($subscriptionId.ToLower() -ne $accountInfo.id.ToLower())
{
Write-Error "Could not select the desired subscription"
exit 1
}
}
else
{
$subscriptionId = $accountInfo.id
}
# Check AKV path exists
#
$keyVault = ConvertFrom-StringArray (az keyvault show --name $keyVaultName)
if (!$keyVault)
{
Write-Error "Azure key vault '$keyVaultName' does not exist"
exit 1
}
# Check certificate doesn't exist
#
$cert = ConvertFrom-StringArray (az keyvault certificate show --name $certSubjectName --vault-name $keyVaultName 2>$null)
if ($cert)
{
Write-Error "Certificate '$certSubjectName' already exists in key vault '$keyVaultName'"
exit 1
}
# Check app registration doesn't exist
#
$applications = ConvertFrom-StringArray (az ad app list --display-name $applicationName --only-show-errors)
if ($applications.length -gt 0)
{
Write-Error "App registration with name '$applicationName' already exists"
exit 1
}
# Check Arc SQL instance is valid
#
$extension = ConvertFrom-StringArray (az connectedmachine extension show --machine-name $machineName --name "WindowsAgent.SqlServer" --resource-group $resourceGroupName)
if (!$extension)
{
Write-Error "SQL Server Arc Server not found for machine '$machineName' in resource group '$resourceGroupName'"
exit 1
}
$arcServicePrincipals = ConvertFrom-StringArray(az ad sp list --display-name $machineName --only-show-errors)
if (!$arcServicePrincipals -or $arcServicePrincipals.length -eq 0)
{
Write-Error "Could not find a service principal account with the name '$machineName'"
exit 1
}
else
{
$principalFound = $false
for ($i = 0; $i -lt $arcServicePrincipals.length; $i++)
{
if ($arcServicePrincipals[$i].displayName.toLower() -eq $machineName.toLower()) {
if ($principalFound) {
Write-Error "Could not find exactly one service principal account with the name '$machineName'"
exit 1
}
$arcServicePrincipal = $arcServicePrincipals[$i]
$principalFound = $true
}
}
if (!$principalFound) {
Write-Error "Could not find a service principal account with the name '$machineName'"
exit 1
}
}
# Check if admin account exists
#
$adminAccount = ConvertFrom-StringArray (az ad user show --id $adminAccountName --only-show-errors 2>$null)
$adminAccountType = 0
if (!$adminAccount)
{
$adminAccounts = ConvertFrom-StringArray (az ad user list --filter "mail eq '$adminAccountName'" --only-show-errors 2>$null)
if ($adminAccounts -and $adminAccounts.length -gt 0)
{
if ($adminAccounts.length -eq 1)
{
$adminAccount = $adminAccounts[0]
}
else
{
Write-Error "Multiple Azure AD accounts found with identifier '$adminAccountName'"
exit 1
}
}
else
{
$adminAccount = ConvertFrom-StringArray (az ad group show --group $adminAccountName --only-show-errors 2>$null)
if (!$adminAccount)
{
$adminAccounts = ConvertFrom-StringArray (az ad app list --display-name $adminAccountName --only-show-errors 2>$null)
if ($adminAccounts -and $adminAccounts.length -gt 0)
{
if ($adminAccounts.length -eq 1)
{
$adminAccount = $adminAccounts[0]
}
else
{
Write-Error "Multiple Azure AD applications found with identifier '$adminAccountName'"
exit 1
}
}
else
{
Write-Error "Admin account not found"
exit 1
}
}
else
{
$adminAccountType = 1
}
}
}
if ($adminAccount)
{
$adminAccountSid = $adminAccount.id
}
else
{
Write-Error "Admin account not found"
exit 1
}
# Create certificate in AKV
#
$keyVaultPolicy = ConvertFrom-StringArray (az keyvault certificate get-default-policy)
if (!$keyVaultPolicy)
{
Write-Error "Could not get default key vault policy"
exit 1
}
$keyVaultPolicy.x509CertificateProperties.subject = "CN=" + $certSubjectName
$policyString = (ConvertTo-JSON -Depth 8 $keyVaultPolicy).replace("`r`n", "")
$escapedPolicyString = $policyString.replace("`"", "\`"")
$cert = ConvertFrom-StringArray (az keyvault certificate create --vault-name $keyVaultName --name $certSubjectName --policy $escapedPolicyString)
if (!$cert)
{
Write-Error "Failed to create certificate '$certSubjectName'"
exit 1
}
# Wait until cert is created?
#
$cert = ConvertFrom-StringArray (az keyvault certificate show --vault-name $keyVaultName --name $certSubjectName)
for (($i = 0); $i -lt $NUMRETRIES -and (!$cert -or !$cert.attributes.enabled); $i++)
{
$cert = ConvertFrom-StringArray (az keyvault certificate show --vault-name $keyVaultName --name $certSubjectName)
if (!$cert -or !$cert.attributes.enabled)
{
Start-Sleep -Seconds 5
}
}
# Allow Arc to access AKV
#
$newPerms = ConvertFrom-StringArray (az keyvault set-policy --name $keyVaultName --secret-permissions get list --certificate-permissions get list --object-id $arcServicePrincipal.id)
if (!$newPerms)
{
Write-Host "Warning: Unable to add permissions to key vault '$keyVaultName' for Arc's service principal's identity '$($arcServicePrincipal.id)'. Arc may not be able to configure Azure AD authentication"
}
# Create an Azure AD application
#
$application = ConvertFrom-StringArray (az ad app create --display-name $applicationName --only-show-errors)
if (!$application)
{
Write-Error "Unable to create the app registration '$applicationName'"
exit 1
}
# Set perms on app registration
#
az ad app permission add --id $application.id --api 00000003-0000-0000-c000-000000000000 --api-permissions c79f8feb-a9db-4090-85f9-90d820caa0eb=Scope --only-show-errors # Delegated Application.Read.All
az ad app permission add --id $application.id --api 00000003-0000-0000-c000-000000000000 --api-permissions 0e263e50-5827-48a4-b97c-d940288653c7=Scope --only-show-errors # Delegated Directory.AccessAsUser.All
az ad app permission add --id $application.id --api 00000003-0000-0000-c000-000000000000 --api-permissions 7ab1d382-f21e-4acd-a863-ba3e13f7da61=Role --only-show-errors # Application Directory.Read.All
az ad app permission add --id $application.id --api 00000003-0000-0000-c000-000000000000 --api-permissions 5f8c59db-677d-491f-a6b8-5f174b11ec1d=Scope --only-show-errors # Delegated Group.Read.All
az ad app permission add --id $application.id --api 00000003-0000-0000-c000-000000000000 --api-permissions a154be20-db9c-4678-8ab7-66f6cc099a59=Scope --only-show-errors # Delegated User.Read.All
# Upload cert to Azure AD
#
$certUploadRes = ConvertFrom-StringArray (az ad app credential reset --id $application.id --cert $certSubjectName --keyvault $keyVaultName --append --only-show-errors)
if (!$certUploadRes)
{
Write-Error "Failed to set certificate '$certSubjectName' as a credential for app registration '$applicationName'"
exit 1
}
# Remove the version from the secret ID if present
#
$secretId = $cert.sid
if ($secretId -Match "(https:\/\/[^\/]+\/secrets\/[^\/]+)(\/.*){0,1}$") {
if ($Matches[1]) {
$secretId = $Matches[1]
}
}
# Create the settings object to write to the Azure extension for SQL Server
#
$instanceSettings = @{
instanceName = $instanceName
adminLoginName = $adminAccountName
adminLoginSid = $adminAccountSid
azureCertSecretId = $secretId
azureCertUri = $cert.id
azureKeyVaultResourceUID = $keyVault.id
managedCertSetting = "CUSTOMER MANAGED CERT"
managedAppSetting = "CUSTOMER MANAGED APP"
appRegistrationName = $application.displayName
appRegistrationSid = $application.appId
tenantId = $tenantId
aadCertSubjectName = $certSubjectName
adminLoginType = $adminAccountType
}
$extension = ConvertFrom-StringArray (az connectedmachine extension show --machine-name $machineName --name "WindowsAgent.SqlServer" --resource-group $resourceGroupName)
if ($extension.properties.Settings.AzureAD)
{
$aadSettings = $extension.properties.Settings.AzureAD
$instanceFound = $false
$instanceNameLower = $instanceName.ToLower()
$instanceIndex = 0
for (($i = 0); $i -lt $aadSettings.Length; $i++)
{
if ($aadSettings[$i].instanceName.ToLower() -eq $instanceNameLower)
{
$instanceIndex = $i
$instanceFound = $true
break
}
}
if ($instanceFound)
{
$aadSettings[$instanceIndex] = $instanceSettings
}
else
{
$aadSettings += $instanceSettings
}
$extension.properties.Settings.AzureAD = $aadSettings
}
else
{
$aadSettings = , $instanceSettings
$extension.properties.Settings | Add-Member -Name 'AzureAD' -Value $aadSettings -MemberType NoteProperty
}
$settingsString = (ConvertTo-Json $extension.properties.Settings).replace("`"", "\`"").replace("`r`n", "")
# Push settings to Arc
#
Write-Host "Writing Azure AD setting to Azure extension for SQL Server. This may take several minutes..."
$updateRes = az connectedmachine extension update --machine-name $machineName --name "WindowsAgent.SqlServer" --resource-group $resourceGroupName --settings $settingsString
if (!$updateRes)
{
Write-Error "Failed to update Azure extension for SQL Server with Azure AD settings"
exit 1
}
Write-Output "Success"
Het uitvoeren van het script kan enkele minuten duren. Wanneer het proces is voltooid, wordt er een bericht weergegeven dat er ongeveer als volgt uitziet:
Name Location ProvisioningState
---- -------- -----------------
WindowsAgent.SqlServer westus2 Succeeded
Success
Een Microsoft Entra-beheerder instellen met een bestaand certificaat en een bestaande toepassing met behulp van de Azure CLI
Als u al een bestaand Azure Key Vault-certificaat hebt en een Azure-toepassing die u wilt gebruiken om een Microsoft Entra-beheerder in te stellen, kunt u het volgende CLI-script gebruiken:
# Set up Microsoft Entra admin for user's existing key vault, certificate, and application
# Requires input parameters indicated below
# Connect statement
AZ Login
#Input parameters
$subscriptionId="<subscriptionId>"
$tenantId="<tenantId>"
$machineName="<machineName>" # hostname
$instanceName="<instanceName>" # SQL Server is define as `machine_name\instance_name`
$resourceGroupName="<resourceGroupName>"
$keyVaultName="<keyVaultName>"
$certSubjectName="<certSubjectName>" # Your existing certificate name
$applicationName="<applicationName>" # Your existing application name
$adminAccountName="<adminAccountName>"
$adminAccountSid="<adminID>" # Use object ID for the Azure AD user and group, or client ID for the Azure AD application
$adminAccountType= 0 # 0 – for Azure AD user and application, 1 for Azure AD group
# Helper function
#
function ConvertFrom-StringArray {
param (
[string[]] $stringArray
)
if (!$stringArray)
{
return $null
}
else
{
return ConvertFrom-JSON ($stringArray -join "`n")
}
}
$keyVault = ConvertFrom-StringArray (az keyvault show --name $keyVaultName)
if (!$keyVault)
{
Write-Error "Azure key vault '$keyVaultName' does not exist"
exit 1
}
$cert = ConvertFrom-StringArray (az keyvault certificate show --name $certSubjectName --vault-name $keyVaultName 2>$null)
if (!$cert)
{
Write-Error "Supplied certificate $certSubjectName was not found for this key vault. Please specify an existing certificate"
exit 1
}
$secretId = $cert.sid
if ($secretId -Match "(https:\/\/[^\/]+\/secrets\/[^\/]+)(\/.*){0,1}$") {
if ($Matches[1]) {
$secretId = $Matches[1]
}
}
$application = ConvertFrom-StringArray (az ad app list --display-name $applicationName --only-show-errors)
if (!$application)
{
Write-Error "Supplied application was not found in the subscription. Please specify an existing application"
exit 1
}
# Create the settings object to write to the Arc extension
#
$instanceSettings = @{
instanceName = $instanceName
adminLoginName = $adminAccountName
adminLoginSid = $adminAccountSid
azureCertSecretId = $secretId
azureCertUri = $cert.id
azureKeyVaultResourceUID = $keyVault.id
managedCertSetting = "CUSTOMER MANAGED CERT"
managedAppSetting = "CUSTOMER MANAGED APP"
appRegistrationName = $application.displayName
appRegistrationSid = $application.appId
tenantId = $tenantId
aadCertSubjectName = $certSubjectName
adminLoginType = $adminAccountType
}
$extension = ConvertFrom-StringArray (az connectedmachine extension show --machine-name $machineName --name "WindowsAgent.SqlServer" --resource-group $resourceGroupName)
if ($extension.properties.Settings.AzureAD)
{
$aadSettings = $extension.properties.Settings.AzureAD
$instanceFound = $false
$instanceNameLower = $instanceName.ToLower()
$instanceIndex = 0
for (($i = 0); $i -lt $aadSettings.Length; $i++)
{
if ($aadSettings[$i].instanceName.ToLower() -eq $instanceNameLower)
{
$instanceIndex = $i
$instanceFound = $true
break
}
}
if ($instanceFound)
{
$aadSettings[$instanceIndex] = $instanceSettings
}
else
{
$aadSettings += $instanceSettings
}
$extension.properties.Settings.AzureAD = $aadSettings
}
else
{
$aadSettings = , $instanceSettings
$extension.properties.Settings | Add-Member -Name 'AzureAD' -Value $aadSettings -MemberType NoteProperty
}
$settingsString = (ConvertTo-Json $extension.properties.Settings).replace("`"", "\`"").replace("`r`n", "")
# Push settings to Arc
#
Write-Host "Writing Azure AD setting to SQL Server Arc Extension. This may take several minutes..."
$updateRes = az connectedmachine extension update --machine-name $machineName --name "WindowsAgent.SqlServer" --resource-group $resourceGroupName --settings $settingsString
if (!$updateRes)
{
Write-Error "Failed to update SQL Arc Extension with Azure AD settings"
exit 1
}
Write-Output "Success"
Met het onderstaande PowerShell-script stelt u een Microsoft Entra-beheerder in, maakt u een Azure Key Vault-certificaat en maakt u een Microsoft Entra-toepassing. Er is een extra sectie met een voorbeeldscript voor het instellen van een Microsoft Entra-beheerder wanneer er al een certificaat en toepassing bestaan.
Notitie
De certificaten die zijn gemaakt voor de installatie van Microsoft Entra, worden niet automatisch geroteerd.
De volgende modules zijn vereist voor deze zelfstudie. Installeer de nieuwste versies van de modules of hoger dan de genoteerde versie hieronder:
- Az.Accounts 3.37.0
- Az.ConnectedMachine 0.5.0
- Az.KeyVault 4.5.0
- Az.Resources 6.0.0
De volgende invoerparameters worden gebruikt voor het PowerShell-script:
-
<applicationName>
- Toepassingsnaam die wordt gemaakt
-
<certSubjectName>
- Certificaatnaam dat zal worden aangemaakt
-
<keyVaultName>
: de naam van uw sleutelkluis. Deze sleutelkluis moet worden gemaakt voordat het script wordt uitgevoerd
-
<machineName>
- Machinenaam van uw SQL Server-host
-
<resourceGroupName>
- Naam van resourcegroep die uw SQL Server - Azure Arc-exemplaar bevat
-
<adminAccountName>
- Microsoft Entra-beheerdersaccount dat u wilt instellen voor uw SQL Server
-
<instanceName>
- Optionele parameter voor benoemde SQL Server-exemplaren. Gebruik deze parameter wanneer u een benoemde instantie hebt. Als u dit weglaat, wordt de standaardnaam van MSSQLSERVER
gebruikt
-
<tenantId>
- Optionele parameter voor tenant-id. U kunt de tenant-id vinden door naar de Azure-portalte gaan en naar uw Microsoft Entra ID resource te gaan. In het deelvenster Overzicht ziet u de tenant-id. Als u dit weglaat, wordt de standaardtenant-id gebruikt als parameter
-
<subscriptionId>
- Optionele parameter voor abonnements-id. Uw abonnements-id vindt u in Azure Portal. Als u dit weglaat, wordt de standaardabonnements-id gebruikt
Als u het onderstaande PowerShell-script wilt gebruiken, slaat u het script op als een .ps1
-bestand en voert u de volgende opdracht uit:
./aadPowerShellsetup.ps1 -applicationName "<applicationName>" -certSubjectName "<certSubjectName>" -keyVaultName "<keyVaultName>" -machineName "<machineName>" -resourceGroupName "<resourceGroupName>" -adminAccountName "<adminAccountName>" -instanceName "<instanceName>" -tenantId "<tenantId>" -subscriptionId "<subscriptionId>"
Het PowerShell-script
Voor SQL Server op Linux-hostcomputers vervangt u WindowsAgent.SqlServer
door LinuxAgent.SqlServer
in het script.
param (
[Parameter(mandatory=$true)] $applicationName,
[Parameter(mandatory=$true)] $certSubjectName,
[Parameter(mandatory=$true)] $keyVaultName,
[Parameter(mandatory=$true)] $machineName,
[Parameter(mandatory=$true)] $resourceGroupName,
[Parameter(mandatory=$true)] $adminAccountName,
$instanceName,
$tenantId,
$subscriptionId
)
Import-Module Az.Accounts
Import-Module Az.ConnectedMachine
Import-Module Az.KeyVault
Import-Module Az.Resources
# Constants
#
$NUMRETRIES = 60
# Check parameters
#
if ([string]::IsNullOrEmpty($instanceName))
{
Write-Host "Warning: SQL Instance name (-instanceName) not provided. Default of MSSQLSERVER will be used"
$instanceName = "MSSQLSERVER"
}
$tenantIdArgument = ""
if ([string]::IsNullOrEmpty($tenantId))
{
Write-Host "Warning: Tenant ID (-tenantId) not supplied to the script, so default tenant is being used"
}
else
{
$tenantIdArgument = "-TenantId '" + $tenantId + "'"
}
$subscriptionIdArgument = ""
if ([string]::IsNullOrEmpty($subscriptionId))
{
Write-Host "Warning: Subscription ID (-subscriptionId) not supplied to the script, so default subscription is being used"
}
else
{
$subscriptionIdArgument = "-SubscriptionId '" + $subscriptionId + "'"
}
# Login
#
try
{
$loginRes = Invoke-Expression -Command ("Connect-AzAccount " + $tenantIdArgument + " " + $subscriptionIdArgument + " -ErrorAction stop -UseDeviceAuthentication")
}
catch
{
Write-Error $_
Write-Error "Failed to login to Azure. Script can not continue"
exit 1
}
# Get subscription ID
#
if ([string]::IsNullOrEmpty($subscriptionId))
{
$context = Get-AzContext
if ($context)
{
if ($context.Name -Match "[^(]+\(([^)]{36})\)")
{
if ($Matches[1])
{
$subscriptionId = $Matches[1]
}
}
}
}
if ([string]::IsNullOrEmpty($subscriptionId))
{
Write-Error "Failed to find default subscription"
exit 1
}
# Check AKV path exists
#
$keyVault = Get-AzKeyVault -VaultName $keyVaultName
if (!$keyVault)
{
Write-Error "Supplied key vault was not found in the subscription. Please specify an existing key vault"
exit 1
}
# Check certificate doesn't exist
#
$cert = Get-AzKeyVaultCertificate -VaultName $keyVaultName -Name $certSubjectName
if ($cert)
{
Write-Error "Certificate $certSubjectName already exists"
exit 1
}
# Check app registration doesn't exist
#
$application = Get-AzADApplication -DisplayName $applicationName
if ($application)
{
Write-Error "Application $applicationName already exists"
exit 1
}
# Check Arc SQL instance is valid
#
$arcInstance = Get-AzConnectedMachineExtension -SubscriptionId $subscriptionId -MachineName $machineName -ResourceGroupName $resourceGroupName -Name "WindowsAgent.SqlServer"
if (!$arcInstance)
{
Write-Error "Could not find a SQL Server Arc instance in subscription '$subscriptionId' and resource group '$resourceGroupName' with name '$machineName'"
exit 1
}
# Check if admin account exists
#
$adminAccount = Get-AzADUser -UserPrincipalName $adminAccountName
$adminAccountType = 0
if (!$adminAccount)
{
# Check for guest user
#
$adminAccount = Get-AzADUser -Mail $adminAccountName
if (!$adminAccount)
{
$adminAccount = Get-AzADGroup -DisplayName $adminAccountName
if (!$adminAccount)
{
$adminAccount = Get-AzADServicePrincipal -DisplayName $adminAccountName
}
else
{
$adminAccountType = 1
}
}
}
if ($adminAccount)
{
if ($adminAccount.Length -gt 1)
{
Write-Error "Multiple accounts with found with name $adminAccountName"
exit 1
}
$adminAccountSid = $adminAccount.Id
}
else
{
Write-Error "Could not find an account with name $adminAccountName"
exit 1
}
# Create certificate in AKV
#
$Policy = New-AzKeyVaultCertificatePolicy -SecretContentType "application/x-pkcs12" -SubjectName "CN=$certSubjectName" -IssuerName "Self" -ValidityInMonths 12 -ReuseKeyOnRenewal
try
{
$addCertRes = Add-AzKeyVaultCertificate -VaultName $keyVaultName -Name $certSubjectName -CertificatePolicy $Policy -ErrorAction stop
}
catch
{
Write-Error $_
Write-Error "Certificate $certSubjectName could not be created"
exit 1
}
for (($i = 0); $i -lt $NUMRETRIES -and (!$cert -or !$cert.enabled); $i++)
{
$cert = Get-AzKeyVaultCertificate -VaultName $keyVaultName -Name $certSubjectName
if (!$cert -or !$cert.enabled)
{
Start-Sleep -Seconds 5
}
}
if (!$cert)
{
Write-Error "Certificate $certSubjectName could not be created"
exit 1
}
# Allow Arc to access AKV
#
$arcServicePrincipal = Get-AzADServicePrincipal -DisplayName $machineName
if ($arcServicePrincipal -and ![string]::IsNullOrEmpty($arcServicePrincipal.Id))
{
try
{
Set-AzKeyVaultAccessPolicy -VaultName $keyVaultName -ObjectId $arcServicePrincipal.Id -PermissionsToSecrets Get,List -PermissionsToCertificates Get,List
}
catch
{
Write-Error $_
Write-Host "Warning: Could not find the identity of the Azure extension for SQL Server and thus, could not add permissions for the Arc process to read from AKV. Ensure the Arc identity has the required permissions to read from AKV."
}
}
else
{
Write-Host "Warning: Could not find the identity of the Azure extension for SQL Server and thus, could not add permissions for the Arc process to read from AKV. Ensure the Arc identity has the required permissions to read from AKV."
}
# Create an Azure AD application
#
$application = New-AzADApplication -DisplayName $applicationName
if (!$application)
{
Write-Error "Application could not be created"
exit 1
}
# Set perms on app registration
#
Add-AzADAppPermission -ObjectId $application.Id -ApiId 00000003-0000-0000-c000-000000000000 -PermissionId c79f8feb-a9db-4090-85f9-90d820caa0eb # Delegated Application.Read.All
Add-AzADAppPermission -ObjectId $application.Id -ApiId 00000003-0000-0000-c000-000000000000 -PermissionId 0e263e50-5827-48a4-b97c-d940288653c7 # Delegated Directory.AccessAsUser.All
Add-AzADAppPermission -ObjectId $application.Id -ApiId 00000003-0000-0000-c000-000000000000 -PermissionId 7ab1d382-f21e-4acd-a863-ba3e13f7da61 -Type Role # Application Directory.Read.All
Add-AzADAppPermission -ObjectId $application.Id -ApiId 00000003-0000-0000-c000-000000000000 -PermissionId 5f8c59db-677d-491f-a6b8-5f174b11ec1d # Delegated Group.Read.All
Add-AzADAppPermission -ObjectId $application.Id -ApiId 00000003-0000-0000-c000-000000000000 -PermissionId a154be20-db9c-4678-8ab7-66f6cc099a59 # Delegated User.Read.All
# Upload cert to Azure AD
#
try
{
$base64Cert = [System.Convert]::ToBase64String($cert.Certificate.GetRawCertData())
New-AzADAppCredential -ApplicationObject $application -CertValue $base64Cert -EndDate $cert.Certificate.NotAfter -StartDate $cert.Certificate.NotBefore -ErrorAction stop
}
catch
{
Write-Error $_
Write-Error "Failed to add certificate to app registration"
exit 1
}
# Remove the version from the secret ID if present
#
$secretId = $cert.SecretId
if ($secretId -Match "(https:\/\/[^\/]+\/secrets\/[^\/]+)(\/.*){0,1}$") {
if ($Matches[1]) {
$secretId = $Matches[1]
}
}
# Create the settings object to write to the Azure extension for SQL Server
#
$instanceSettings = @{
instanceName = $instanceName
adminLoginName = $adminAccountName
adminLoginSid = $adminAccountSid
azureCertSecretId = $secretId.replace(":443", "")
azureCertUri = $cert.Id.replace(":443", "")
azureKeyVaultResourceUID = $keyVault.ResourceId
managedCertSetting = "CUSTOMER MANAGED CERT"
managedAppSetting = "CUSTOMER MANAGED APP"
appRegistrationName = $application.DisplayName
appRegistrationSid = $application.AppId
tenantId = $tenantId
aadCertSubjectName = $certSubjectName
adminLoginType = $adminAccountType
}
$arcInstance = Get-AzConnectedMachineExtension -SubscriptionId $subscriptionId -MachineName $machineName -ResourceGroupName $resourceGroupName -Name "WindowsAgent.SqlServer"
if ($arcInstance.Setting.AdditionalProperties.AzureAD)
{
$aadSettings = $arcInstance.Setting.AdditionalProperties.AzureAD
$instanceFound = $false
$instanceNameLower = $instanceName.ToLower()
$instanceIndex = 0
for (($i = 0); $i -lt $aadSettings.Length; $i++)
{
if ($aadSettings[$i].instanceName.ToLower() -eq $instanceNameLower)
{
$instanceIndex = $i
$instanceFound = $true
break
}
}
if ($instanceFound)
{
$aadSettings[$instanceIndex] = $instanceSettings
}
else
{
$aadSettings += $instanceSettings
}
}
else
{
$aadSettings = , $instanceSettings
}
Write-Host "Writing Microsoft Entra setting to SQL Server Arc Extension. This may take several minutes..."
# Push settings to Arc
#
try
{
#set the Entra ID / AzureAD setting in the hash table
$SettingsToConfigure = @{
AzureAD = $aadSettings
}
#add any non-AzureAD key value pairs back to the hashtable
$keys = $arcInstance.Setting.Keys | where-object {$_ -notin ("AzureAD")}
foreach ($key in $keys) {
$SettingsToConfigure.$key = $arcInstance.Setting["$key"]
}
#Issue the update of the updated settings
Update-AzConnectedMachineExtension `
-MachineName $machineName `
-Name "WindowsAgent.SqlServer" `
-ResourceGroupName $resourceGroupName `
-Setting $SettingsToConfigure
}
catch
{
Write-Error $_
Write-Error "Failed to write settings to Arc host"
exit 1
}
Write-Output "Success"
Een Microsoft Entra-beheerder instellen met een bestaand certificaat en een bestaande toepassing met behulp van PowerShell
Als u al een bestaand Azure Key Vault-certificaat hebt en een Azure-toepassing die u wilt gebruiken om een Microsoft Entra-beheerder in te stellen, kunt u het volgende PowerShell-script gebruiken:
# Connect statement
Connect-AzAccount
#Input parameters
$subscriptionId="<subscriptionId>"
$tenantId="<tenantId>"
$machineName="<machineName>" # hostname
$instanceName="<instanceName>" # SQL Server is define as `machine_name\instance_name`
$resourceGroupName="<resourceGroupName>"
$keyVaultName="<keyVaultName>"
$certSubjectName="<certSubjectName>" # Your existing certificate name
$applicationName="<applicationName>" # Your existing application name
$adminAccountName="<adminAccountName>"
$adminAccountSid="<adminID>" # Use object ID for the Microsoft Entra user and group, or client ID for the Microsoft Entra application
$adminAccountType= 0 # 0 – for Microsoft Entra user and application, 1 for Microsoft Entra group
$keyVault = Get-AzKeyVault -VaultName $keyVaultName
if (!$keyVault)
{
Write-Error "Supplied key vault was not found in the subscription. Please specify an existing key vault"
exit 1
}
$cert = Get-AzKeyVaultCertificate -VaultName $keyVaultName -Name $certSubjectName
if (!$cert)
{
Write-Error "Supplied certificate $certSubjectName was not found for this key vault. Please specify an existing certificate"
exit 1
}
$secretId = $cert.SecretId
if ($secretId -Match "(https:\/\/[^\/]+\/secrets\/[^\/]+)(\/.*){0,1}$") {
if ($Matches[1]) {
$secretId = $Matches[1]
}
}
$application = Get-AzADApplication -DisplayName $applicationName
if (!$application)
{
Write-Error "Supplied application was not found in the subscription. Please specify an existing application"
exit 1
}
# Create the settings object to write to the Arc extension
#
$instanceSettings = @{
instanceName = $instanceName
adminLoginName = $adminAccountName
adminLoginSid = $adminAccountSid
azureCertSecretId = $secretId.replace(":443", "")
azureCertUri = $cert.Id.replace(":443", "")
azureKeyVaultResourceUID = $keyVault.ResourceId
managedCertSetting = "CUSTOMER MANAGED CERT"
managedAppSetting = "CUSTOMER MANAGED APP"
appRegistrationName = $application.DisplayName
appRegistrationSid = $application.AppId
tenantId = $tenantId
aadCertSubjectName = $certSubjectName
adminLoginType = $adminAccountType
}
$arcInstance = Get-AzConnectedMachineExtension -SubscriptionId $subscriptionId -MachineName $machineName -ResourceGroupName $resourceGroupName -Name "WindowsAgent.SqlServer"
if ($arcInstance.Setting.AdditionalProperties.AzureAD)
{
$aadSettings = $arcInstance.Setting.AdditionalProperties.AzureAD
$instanceFound = $false
$instanceNameLower = $instanceName.ToLower()
$instanceIndex = 0
for (($i = 0); $i -lt $aadSettings.Length; $i++)
{
if ($aadSettings[$i].instanceName.ToLower() -eq $instanceNameLower)
{
$instanceIndex = $i
$instanceFound = $true
break
}
}
if ($instanceFound)
{
$aadSettings[$instanceIndex] = $instanceSettings
}
else
{
$aadSettings += $instanceSettings
}
}
else
{
$aadSettings = , $instanceSettings
}
Write-Host "Writing Microsoft Entra setting to SQL Server Arc Extension. This may take several minutes..."
# Push settings to Arc
#
try
{
#set the Entra ID / AzureAD setting in the hash table
$SettingsToConfigure = @{
AzureAD = $aadSettings
}
#add any non-AzureAD key value pairs back to the hashtable
$keys = $arcInstance.Setting.Keys | where-object {$_ -notin ("AzureAD")}
foreach ($key in $keys) {
$SettingsToConfigure.$key = $arcInstance.Setting["$key"]
}
#Issue the update of the updated settings
Update-AzConnectedMachineExtension `
-MachineName $machineName `
-Name "WindowsAgent.SqlServer" `
-ResourceGroupName $resourceGroupName `
-Setting $SettingsToConfigure
}
catch
{
Write-Error $_
Write-Error "Failed to write settings to Arc host"
exit 1
}
Write-Output "Success"
Met de volgende ARM-sjabloon stelt u een Microsoft Entra-beheerder in met behulp van een bestaand Azure Key Vault-certificaat en de Microsoft Entra-toepassing.
De volgende invoerparameters worden gebruikt voor de ARM-sjabloon:
-
<machineName>
- Machinenaam van uw SQL Server-host
-
<Location>
- Locatie van uw SQL Server - Azure Arc resourcegroep, zoals West US
of Central US
-
<tenantId>
- De tenant-id kan worden gevonden door naar de Azure-portalte gaan en uw Microsoft Entra ID-resource te openen. In het deelvenster Overzicht ziet u de Tenant-ID.
-
<instanceName>
- SQL Server-exemplaarnaam. De naam van het standaardexemplaar van de SQL Server is MSSQLSERVER
-
<certSubjectName>
- Certificaatnaam die u hebt gemaakt
-
<subscriptionId>
- Abonnements-id. Uw abonnements-id vindt u in Azure Portal
-
<resourceGroupName>
: de naam van de resourcegroep die uw sleutelkluis bevat. De volledige azureKeyVaultResourceUID waarde vindt u door naar de Key Vault resource te gaan, Eigenschappen te selecteren en resource-id te kopiëren
-
<keyVaultName>
- de naam van uw sleutelkluis
-
<certIdentifier>
: de certificaat-id voor uw Azure Key Vault-certificaat. Als u de certificaat-idwilt ophalen, gaat u naar de Key Vault resource en selecteert u Certificaten onder Instellingen. Selecteer de actuele versie van het -certificaat dat uhebt gemaakt en kopieer de Certificaat-Id-waarde. Zie Een certificaat toevoegen aan Key Vault- voor meer informatie
-
<certSecret>
: de geheime id van uw certificaat en vindt u in hetzelfde menu als de certificaat-id
-
<applicationName>
- De naam van uw gemaakte Microsoft Entra-toepassing
-
<appID>
- De -toepassings-id (client)-id van uw Microsoft Entra-toepassing vindt u in het menu Overzicht van de toepassing
-
<adminAccountName>
- Microsoft Entra-beheerdersaccount dat u wilt instellen voor uw SQL Server
-
<adminID>
: de Object-ID van de Microsoft Entra-gebruiker of -groep, of de Applicatie-ID (client) van de toepassing als u een andere toepassing gebruikt als Microsoft Entra-beheerdersaccount. Zie voor meer informatie Zelfstudie: Microsoft Entra-gebruikers maken met behulp van Microsoft Entra-toepassingen
-
<adminType>
- Gebruik 0
voor Microsoft Entra-gebruikers en -toepassingen en 1
voor Microsoft Entra-groepen
Gebruik een aangepaste -implementatie in de Azure-portalen maak uw eigen sjabloon in de editor. Vervolgens bevestig de configuratie zodra u het voorbeeld hebt geplakt.
Notitie
Voor SQL Server op Linux-hostcomputers vervangt u WindowsAgent.SqlServer
door LinuxAgent.SqlServer
in het script.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"resources": [
{
"type": "Microsoft.HybridCompute/machines/extensions",
"apiVersion": "2022-03-10",
"name": "<machineName>/WindowsAgent.SqlServer",
"location": "<Location>",
"properties": {
"publisher": "Microsoft.AzureData",
"type": "WindowsAgent.SqlServer",
"settings": {
"AzureAD": [
{
"tenantId": "<tenantId>",
"instanceName": "<instanceName>",
"managedCertSetting": "CUSTOMER MANAGED CERT",
"aadCertSubjectName": "<certSubjectName>",
"azureKeyVaultResourceUID": "/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.KeyVault/vaults/<keyVaultName>",
"azureCertUri": "<certIdentifier>",
"azureCertSecretId": "<certSecret>",
"managedAppSetting": "CUSTOMER MANAGED APP",
"appRegistrationName": "<applicationName>",
"appRegistrationSid": "<appID>",
"adminLoginName": "<adminAccountName>",
"adminLoginSid" : "<adminID>",
"adminLoginType": 0
}
]
}
}
}
]
}
Beheerderstoestemming verlenen voor de toepassing
Zodra de Microsoft Entra-beheerder is ingesteld, kunt u verbinding maken met SQL Server met behulp van de Microsoft Entra-beheerdersreferenties. Verdere databaseactiviteiten met betrekking tot het maken van nieuwe Microsoft Entra-aanmeldingen en gebruikers mislukken echter totdat beheerderstoestemming wordt verleend aan de Microsoft Entra-toepassing.
Notitie
Om beheerderstoestemming te verlenen voor de toepassing, moet het account dat toestemming verleent de rol van Microsoft Entra ID Privileged Role Administrator hebben. Deze rollen zijn nodig om beheerderstoestemming te verlenen voor de toepassing, maar is niet nodig om Microsoft Entra-beheerder in te stellen.
Selecteer in Azure PortalMicrosoft Entra ID>App-registratiesen selecteer de zojuist gemaakte toepassing. De toepassing moet een naam hebben zoals <hostname>-<instanceName><uniqueNumber>
.
Selecteer het menu API-machtigingen.
Selecteer Beheerderstoestemming verlenen.
Zonder beheerderstoestemming voor de toepassing te verlenen, resulteert het maken van een Microsoft Entra-aanmelding of -gebruiker in SQL Server in de volgende fout:
Msg 37455, Level 16, State 1, Line 2
Server identity does not have permissions to access MS Graph.
Microsoft Entra-verificatie gebruiken om verbinding te maken met SQL Server
Microsoft Entra-verificatie is nu ingesteld voor uw SQL Server die is verbonden met Azure Arc. Volg de secties na het instellen van microsoft Entra-beheerder in het artikel zelfstudie: Microsoft Entra-verificatie instellen voor SQL Server om verbinding te maken met SQL Server met behulp van Microsoft Entra-verificatie.
Zie ook