Von Bedeutung
Azure Stack Hub ビルド 2108 以降、SQL および MySQL リソース プロバイダーは、アクセス権が付与されているサブスクリプションに提供されます。 この機能の使用を開始する場合、または以前のバージョンからアップグレードする必要がある場合は、サポート ケース を開くと、サポート エンジニアがデプロイまたはアップグレード プロセスを案内します。
Von Bedeutung
リソース プロバイダーを更新する前に、リリース ノートを確認して、デプロイに影響を与える可能性がある新機能、修正、および既知の問題について学習します。 リリース ノートでは、リソース プロバイダーに必要な最小 Azure Stack Hub バージョンも指定されています。
Von Bedeutung
リソース プロバイダーを更新すると、ホスティング SQL Server は更新されません。
Azure Stack Hub が新しいビルドに更新されると、新しい SQL リソース プロバイダーがリリースされる場合があります。 既存のリソース プロバイダーは引き続き機能しますが、できるだけ早く最新のビルドに更新することをお勧めします。
| サポートされている Azure Stack Hub のバージョン | SQL RP バージョン | RP サービスが実行されている Windows Server |
|---|---|---|
| 2206, 2301, 2306, 2311 | SQL RP バージョン 2.0.13.x | Microsoft AzureStack アドオン RP Windows Server 1.2009.0 |
| 2108, 2206 | SQL RP バージョン 2.0.6.x | Microsoft AzureStack アドオン RP Windows Server 1.2009.0 |
SQL Server リソース プロバイダー V2 を更新する
SQL RP V2 を既にデプロイしていて、更新プログラムを確認する場合は、 リソース プロバイダーに更新プログラムを適用する方法を確認してください。
SQL RP V1 から SQL RP V2 に更新する場合は、最初に SQL RP V1.1.93.x に更新した後、メジャー バージョンのアップグレード プロセスを適用して SQL RP V1 から SQL RP V2 にアップグレードします。
SQL RP V1.1.93.x から SQL RP V2.0.6.0 への更新
[前提条件]
SQL RP V1 を最新の 1.1.93.x に更新していることを確認します。 [既定のプロバイダー サブスクリプション] で、RP リソース グループ (名前付け形式: system.
<region> を見つけます。sqladapter)。 リソース グループのバージョン タグと SQL RP VM 名を確認します。 まだ古いバージョンを使用していて、1.1.93.x に更新する必要がある場合は、サポート ケースを開いてヘルプを参照してください。サポート ケースを開 いて MajorVersionUpgrade パッケージを取得し、将来の V2 バージョンの ASH マーケットプレース許可リストにサブスクリプションを追加します。
Microsoft AzureStack Add-On RP Windows Server 1.2009.0 を Marketplace にダウンロードします。
データセンター統合の前提条件が満たされていることを確認します。
| 前提条件 | リファレンス |
|---|---|
| 条件付き DNS 転送が正しく設定されています。 | Azure Stack Hub データセンターの統合 - DNS |
| リソース プロバイダーの受信ポートが開いています。 | Azure Stack Hub データセンターの統合 - 受信ポートとプロトコル |
| PKI 証明書のサブジェクトと SAN が正しく設定されています。 |
Azure Stack Hub デプロイの必須 PKI の前提条件 Azure Stack Hub デプロイ PaaS 証明書の前提条件 |
- (切断された環境の場合)リソース プロバイダーのデプロイに使用する更新プロセスと同様に、必要な PowerShell モジュール をインストールします。
Trigger MajorVersionUpgrade
管理者特権の PowerShell コンソールから次のスクリプトを実行して、メジャー バージョンのアップグレードを実行します。
注
スクリプトを実行するクライアント コンピューターが、Windows 10 または Windows Server 2016 より古い OS バージョンで、クライアント コンピューターに X64 オペレーティング システム アーキテクチャがあることを確認します。
Von Bedeutung
展開または更新スクリプトを実行する前に 、Clear-AzureRmContext -Scope CurrentUser と Clear-AzureRmContext -Scope Process を使用してキャッシュをクリアすることを強くお勧めします。
# Check Operating System version
$osVersion = [environment]::OSVersion.Version
if ($osVersion.Build -lt 10240)
{
Write-Host "OS version is too old: $osVersion."
return
}
$osArch = (Get-WmiObject Win32_OperatingSystem).OSArchitecture
if ($osArch -ne "64-bit")
{
Write-Host "OS Architecture is not 64 bit."
return
}
# Check LongPathsEnabled registry key
$regPath = 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem'
$longPathsEnabled = 'LongPathsEnabled'
$property = Get-ItemProperty -Path $regPath -Name $longPathsEnabled -ErrorAction Stop
if ($property.LongPathsEnabled -eq 0)
{
Write-Host "Detect LongPathsEnabled equals to 0, prepare to set the property."
Set-ItemProperty -Path $regPath -Name $longPathsEnabled -Value 1 -ErrorAction Stop
Write-Host "Set the long paths property, please restart the PowerShell."
return
}
# Use the NetBIOS name for the Azure Stack Hub domain.
$domain = "YouDomain"
# For integrated systems, use the IP address of one of the ERCS VMs
$privilegedEndpoint = "YouDomain-ERCS01"
# Provide the Azure environment used for deploying Azure Stack Hub. Required only for Azure AD deployments. Supported values for the <environment name> parameter are AzureCloud, AzureChinaCloud, or AzureUSGovernment depending which Azure subscription you're using.
$AzureEnvironment = "AzureCloud"
# Point to the directory where the resource provider installation files were extracted.
$tempDir = 'C:\extracted-folder\MajorVersionUpgrade-SQLRP'
# The service admin account can be Azure Active Directory or Active Directory Federation Services.
$serviceAdmin = "admin@mydomain.onmicrosoft.com"
$AdminPass = ConvertTo-SecureString 'xxxxxxxx' -AsPlainText -Force
$AdminCreds = New-Object System.Management.Automation.PSCredential ($serviceAdmin, $AdminPass)
# Add the cloudadmin credential that's required for privileged endpoint access.
$CloudAdminPass = ConvertTo-SecureString 'xxxxxxxx' -AsPlainText -Force
$CloudAdminCreds = New-Object System.Management.Automation.PSCredential ("$domain\cloudadmin", $CloudAdminPass)
# Change the following as appropriate.
$PfxPass = ConvertTo-SecureString 'xxxxxxx' -AsPlainText -Force
# Provide the pfx file path
$PfxFilePath = "C:\tools\sqlcert\SSL.pfx"
# PowerShell modules used by the RP MajorVersionUpgrade are placed in C:\Program Files\SqlMySqlPsh
# The deployment script adds this path to the system $env:PSModulePath to ensure correct modules are used.
$rpModulePath = Join-Path -Path $env:ProgramFiles -ChildPath 'SqlMySqlPsh'
$env:PSModulePath = $env:PSModulePath + ";" + $rpModulePath
. $tempDir\MajorVersionUpgradeSQLProvider.ps1 -AzureEnvironment $AzureEnvironment -AzCredential $AdminCreds -CloudAdminCredential $CloudAdminCreds -Privilegedendpoint $privilegedEndpoint -PfxPassword $PfxPass -PfxCert $PfxFilePath
注
SQL RP V2 の DNS アドレスと対応する IP アドレスは異なります。 新しいパブリック IP を取得するには、サポートに連絡して DRP ブレーク グラスを要求し、SQLRPVM1130-PublicIP リソースを見つけることができます。 "nslookup sqlrp.dbadapter.< を実行することもできます。fqdn>" というエンドポイント テストに既に合格しているクライアント コンピューターからパブリック IP を見つけます。
アップグレードが成功したことを検証する
- エラーなしで実行された MajorVersionUpgrade スクリプト。
- マーケットプレースでリソース プロバイダーを確認し、SQL RP 2.0 が正常にインストールされていることを確認します。
- 古い system.<location>.sqladapter リソース グループと system.<既定のプロバイダー サブスクリプションの location>.dbadapter.dns リソース グループは、スクリプトによって自動的に削除されません。
- ストレージ アカウントと Key Vault は、しばらくの間 sqladapter リソース グループに保持することをお勧めします。 アップグレード後に、テナント ユーザーがデータベースまたはログインのメタデータに一貫性がないことを確認した場合、リソース グループからメタデータを復元するためのサポートを受け取ることができます。
- dbadapter.dns リソース グループ内の DNS ゾーンが DNS レコードなしで空であることを確認した後は、dbadapter.dns リソース グループを削除しても問題ありません。
- [重要]V1 デプロイ スクリプトを使用して V1 バージョンをアンインストールしないでください。 アップグレードが完了し、アップグレードが成功したことを確認したら、プロバイダー サブスクリプションからリソース グループを手動で削除できます。
SQL RP V1 以前のバージョンから SQL RP V1.1.93.x への更新
SQL リソース プロバイダー V1 更新プログラムは累積的です。 1.1.93.x バージョンに直接更新できます。
リソース プロバイダーを 1.1.93.x に更新するには、 UpdateSQLProvider.ps1 スクリプトを使用します。 ローカル管理者権限でサービス アカウントを使用し、サブスクリプションの 所有者 です。 この更新スクリプトは、リソース プロバイダーのダウンロードに含まれています。
更新プロセスは、 リソース プロバイダーのデプロイに使用されるプロセスに似ています。 更新スクリプトでは、DeploySqlProvider.ps1 スクリプトと同じ引数が使用されるため、証明書情報を指定する必要があります。
スクリプト プロセスを更新する
UpdateSQLProvider.ps1 スクリプトは、最新の OS イメージを使用して新しい仮想マシン (VM) を作成し、最新のリソース プロバイダー コードをデプロイし、設定を古いリソース プロバイダーから新しいリソース プロバイダーに移行します。
注
Marketplace Management から Microsoft AzureStack アドオン RP Windows Server 1.2009.0 イメージをダウンロードすることをお勧めします。 更新プログラムをインストールする必要がある場合は、ローカル依存関係パスに 1 つの MSU パッケージを配置できます。 この場所に複数の MSU ファイルがある場合、スクリプトは失敗します。
UpdateSQLProvider.ps1 スクリプトによって新しい VM が作成された後、スクリプトは古いリソース プロバイダー VM から次の設定を移行します。
- データベース情報
- ホスティング サーバー情報
- 必要な DNS レコード
Von Bedeutung
展開または更新スクリプトを実行する前に 、Clear-AzureRmContext -Scope CurrentUser と Clear-AzureRmContext -Scope Process を使用してキャッシュをクリアすることを強くお勧めします。
スクリプト パラメーターを更新する
UpdateSQLProvider.ps1PowerShell スクリプトを実行するときに、コマンド ラインから次のパラメーター を 指定できます。 そうでない場合、またはパラメーターの検証に失敗した場合は、必要なパラメーターを指定するように求められます。
| パラメーター名 | 説明 | コメントまたは既定値 |
|---|---|---|
| CloudAdminCredential | 特権エンドポイントにアクセスするために必要なクラウド管理者の資格情報。 | 必須 |
| AzCredential | Azure Stack Hub サービス管理者アカウントの資格情報。 Azure Stack Hub のデプロイに使用したのと同じ資格情報を使用します。 AzCredential で使用するアカウントに多要素認証 (MFA) が必要な場合、スクリプトは失敗します。 | 必須 |
| VMLocalCredential | SQL リソース プロバイダー VM のローカル管理者アカウントの資格情報。 | 必須 |
| PrivilegedEndpoint | 特権エンドポイントの IP アドレスまたは DNS 名。 | 必須 |
| AzureEnvironment | Azure Stack Hub のデプロイに使用したサービス管理者アカウントの Azure 環境。 Microsoft Entra の展開にのみ必要です。 サポートされている環境名は 、AzureCloud、 AzureUSGovernment、または China Microsoft Entra ID、 AzureChinaCloud を使用している場合です。 | AzureCloud |
| DependencyFilesLocalPath | 証明書の .pfx ファイルもこのディレクトリに配置する必要があります。 | 単一ノードの場合は省略可能ですが、マルチノードの場合は必須です |
| DefaultSSLCertificatePassword | .pfx 証明書のパスワード。 | 必須 |
| MaxRetryCount | エラーが発生した場合に各操作を再試行する回数。 | 2 |
| RetryDuration | 再試行のタイムアウト間隔 (秒単位)。 | 120 |
| アンインストール | リソース プロバイダーと、関連付けられているすべてのリソースを削除します。 | いいえ |
| DebugMode | エラー時の自動クリーンアップを防止します。 | いいえ |
スクリプト PowerShell の更新の例
SQL リソース プロバイダーのバージョンを 1.1.33.0 以前のバージョンに更新する場合は、PowerShell で特定のバージョンの AzureRm.BootStrapper モジュールと Azure Stack Hub モジュールをインストールする必要があります。
SQL リソース プロバイダーをバージョン 1.1.47.0 以降に更新する場合は、この手順をスキップできます。 デプロイ スクリプトは、C:\Program Files\SqlMySqlPsh のパスに必要な PowerShell モジュールを自動的にダウンロードしてインストールします。
注
PowerShell モジュールがダウンロードされたフォルダー C:\Program Files\SqlMySqlPsh が既に存在する場合は、更新スクリプトを実行する前に、このフォルダーをクリーンアップすることをお勧めします。 これは、PowerShell モジュールの適切なバージョンがダウンロードされ、使用されていることを確認するためです。
# Run the following scripts when updating to version 1.1.33.0 only.
# Install the AzureRM.Bootstrapper module, set the profile, and install the AzureStack module.
# Note that this might not be the most currently available version of Azure Stack Hub PowerShell.
Install-Module -Name AzureRm.BootStrapper -Force
Use-AzureRmProfile -Profile 2018-03-01-hybrid -Force
Install-Module -Name AzureStack -RequiredVersion 1.6.0
注
切断されたシナリオでは、必要な PowerShell モジュールをダウンロードし、前提条件としてリポジトリを手動で登録する必要があります。 詳細については、「SQL リソース プロバイダーのデプロイ」を参照してください。
管理者特権の PowerShell コンソールから実行できる UpdateSQLProvider.ps1 スクリプトの使用例を次に示します。 必要に応じて、変数の情報とパスワードを必ず変更してください。
# Use the NetBIOS name for the Azure Stack Hub domain. On the Azure Stack Hub SDK, the default is AzureStack but this might have been changed at installation.
$domain = "AzureStack"
# For integrated systems, use the IP address of one of the ERCS VMs.
$privilegedEndpoint = "AzS-ERCS01"
# Provide the Azure environment used for deploying Azure Stack Hub. Required only for Azure AD deployments. Supported values for the <environment name> parameter are AzureCloud, AzureChinaCloud, or AzureUSGovernment depending which Azure subscription you're using.
$AzureEnvironment = "<EnvironmentName>"
# Point to the directory where the resource provider installation files were extracted.
$tempDir = 'C:\TEMP\SQLRP'
# The service admin account (this can be Azure AD or AD FS).
$serviceAdmin = "admin@mydomain.onmicrosoft.com"
$AdminPass = ConvertTo-SecureString 'P@ssw0rd1' -AsPlainText -Force
$AdminCreds = New-Object System.Management.Automation.PSCredential ($serviceAdmin, $AdminPass)
# Set the credentials for the new resource provider VM.
$vmLocalAdminPass = ConvertTo-SecureString 'P@ssw0rd1' -AsPlainText -Force
$vmLocalAdminCreds = New-Object System.Management.Automation.PSCredential ("sqlrpadmin", $vmLocalAdminPass)
# Add the cloudadmin credential required for privileged endpoint access.
$CloudAdminPass = ConvertTo-SecureString 'P@ssw0rd1' -AsPlainText -Force
$CloudAdminCreds = New-Object System.Management.Automation.PSCredential ("$domain\cloudadmin", $CloudAdminPass)
# Change the following as appropriate.
$PfxPass = ConvertTo-SecureString 'P@ssw0rd1' -AsPlainText -Force
# For version 1.1.47.0 or later, the PowerShell modules used by the RP deployment are placed in C:\Program Files\SqlMySqlPsh
# The deployment script adds this path to the system $env:PSModulePath to ensure correct modules are used.
$rpModulePath = Join-Path -Path $env:ProgramFiles -ChildPath 'SqlMySqlPsh'
$env:PSModulePath = $env:PSModulePath + ";" + $rpModulePath
# Change directory to the folder where you extracted the installation files.
# Then adjust the endpoints.
. $tempDir\UpdateSQLProvider.ps1 -AzCredential $AdminCreds -VMLocalCredential $vmLocalAdminCreds -CloudAdminCredential $cloudAdminCreds -PrivilegedEndpoint $privilegedEndpoint -AzureEnvironment $AzureEnvironment -DefaultSSLCertificatePassword $PfxPass -DependencyFilesLocalPath $tempDir\cert
リソース プロバイダーの更新スクリプトが完了したら、現在の PowerShell セッションを閉じます。