From 2b379aad314a7fc758979b792f1ae9bafb841590 Mon Sep 17 00:00:00 2001 From: "Brian Moore (AZURE RESOURCE MANAGER)" Date: Mon, 6 Aug 2018 13:32:02 -0500 Subject: [PATCH] optimize DCS copy in PS1 --- Deploy-AzureResourceGroup.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Deploy-AzureResourceGroup.ps1 b/Deploy-AzureResourceGroup.ps1 index 6fab654a2016..08c925bf06af 100644 --- a/Deploy-AzureResourceGroup.ps1 +++ b/Deploy-AzureResourceGroup.ps1 @@ -108,7 +108,11 @@ if ($UploadArtifacts -Or $TemplateJSON.parameters._artifactsLocation -ne $null) $ArtifactFilePaths = Get-ChildItem $ArtifactStagingDirectory -Recurse -File | ForEach-Object -Process {$_.FullName} foreach ($SourcePath in $ArtifactFilePaths) { - Set-AzureStorageBlobContent -File $SourcePath -Blob $SourcePath.Substring($ArtifactStagingDirectory.length + 1) -Container $StorageContainerName -Context $StorageAccount.Context -Force + + if ($SourcePath -like "$DSCSourceFolder*" -and $SourcePath -like "*.zip" -or !($SourcePath -like "$DSCSourceFolder*")) { #When using DSC, just copy the DSC archive, not all the modules and source files + Set-AzureStorageBlobContent -File $SourcePath -Blob $SourcePath.Substring($ArtifactStagingDirectory.length + 1) -Container $StorageContainerName -Context $StorageAccount.Context -Force + #Write-host $SourcePath + } } # Generate a 4 hour SAS token for the artifacts location if one was not provided in the parameters file if ($OptionalParameters[$ArtifactsLocationSasTokenName] -eq $null) {