Skip to content

Commit

Permalink
optimize DCS copy in PS1
Browse files Browse the repository at this point in the history
  • Loading branch information
bmoore-msft committed Aug 6, 2018
1 parent b16003a commit 2b379aa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Deploy-AzureResourceGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2b379aa

Please sign in to comment.