まだ存在しない場合、Azureテーブルストレージ内にテーブルを作成して作成するリリースパイプラインを構築しています。私のPowershellファイルは私のマシン上でローカルに実行されますが、VSTSにチェックインしてリリースパイプラインで 'Azure Powershell'ステップで実行すると失敗します。ここで VSTSリリースAzure PowershellタスクがNew-AzureStorageTableコマンドレットを呼び出すときに失敗する
はPS1ファイルから関連するスクリプトです:ビルドエージェントによって発生$ctx = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey
$table = Get-AzureStorageTable -Name $tableName -Context $ctx -ErrorAction SilentlyContinue
# Create it if it doesn't exist
if ($table -eq $null) {
$table = New-AzureStorageTable –Name $tableName –Context $ctx
}
とエラー
New-AzureStorageTable : Could not load file or assembly 'System.Spatial, Version=5.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
これでVSTSホステッド2017ビルドエージェント(バージョン2.126.0です)。カスタムスクリプトを実行する前に、New-AzureStorageTable
コマンドレットがエージェントによって読み込まれていることがわかります。ビルドエージェントは、基になるすべての資産を使用可能にするコマンドレットをサポートすることを期待しています。