azure-sdk-for-js/sdk/remoterendering/test-resources-post.ps1

31 строка
1.4 KiB
PowerShell
Исходник Обычный вид История

# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# This script is used to generate the Test Configuration file for Storage live tests.
# It is invoked by the https://github.com/Azure/azure-sdk-for-js/blob/main/eng/New-TestResources.ps1
# script after the Bicep template, defined in https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/remoterendering/test-resources.bicep,
# is finished being deployed. The ARM template is responsible for creating the Storage accounts needed for live tests.
param (
[hashtable] $DeploymentOutputs,
[string] $TenantId,
[string] $TestApplicationId,
[string] $TestApplicationSecret
)
# outputs from the ARM deployment passed in from New-TestResources
$StorageAccountName = $DeploymentOutputs['REMOTERENDERING_ARR_STORAGE_ACCOUNT_NAME']
$StorageAccountKey = $DeploymentOutputs['REMOTERENDERING_ARR_STORAGE_ACCOUNT_KEY']
$BlobContainerName = $DeploymentOutputs['REMOTERENDERING_ARR_BLOB_CONTAINER_NAME']
$LocalFilePath = Join-Path $PSScriptRoot "TestResources\testBox.fbx"
$TargetBlob = "Input/testBox.fbx"
Write-Verbose ( "Copying test asset to blob storage")
$StorageContext = New-AzStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey
$blob = Set-AzStorageBlobContent -File $LocalFilePath -Blob $TargetBlob -Container $BlobContainerName -Context $StorageContext -Force
Write-Verbose ("Test asset successfully copied to blob storage")