Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed single file blob upload #7222

Merged
merged 10 commits into from
May 18, 2018

Conversation

rajatagrawal-dev
Copy link
Contributor

No description provided.

@rajatagrawal-dev rajatagrawal-dev requested a review from arjgupta May 16, 2018 14:55

$uploadToBlobCommand = "& `"$azCopyExeLocation`" /Source:$sourcePath /Dest:$containerURL /DestKey:`"$storageKey`" $additionalArguments"
$uploadToBlobCommand = "& `"$azCopyExeLocation`" /Source:$resolvedSourcePath /Dest:$containerURL /DestKey:`"$storageKey`" $additionalArguments"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log the upload to blob command

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already doing that above

{
$fileInfo = Get-Item $sourcePath
$resolvedSourcePath = $fileInfo.Directory.FullName
$additionalArguments += " /Pattern:$($fileInfo.Name)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fileinfo can have white spaces in name here. It should be enclosed in quotes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -275,16 +293,16 @@ function Upload-FilesToAzureContainer
}
finally
{
Handle-AzCopyLogs -isLogsPresent $useDefaultArguments -logsFilePath $azCopyLogFilePath -ErrorAction SilentlyContinue
Handle-AzCopyLogs -isLogsPresent $useDefaultArguments -logsFilePath "$azCopyLogFilePath" -ErrorAction SilentlyContinue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, you do not need to enclose it in double quotes.

$blobPrefix = $blobPrefix.Trim()
$containerURL = [string]::Format("{0}/{1}/{2}", $blobStorageEndpoint.Trim("/"), $containerName, $blobPrefix).Trim("/")
$azCopyExeLocation = Join-Path -Path $azCopyLocation -ChildPath "AzCopy.exe"

Write-Verbose "Executing command: & `"$azCopyExeLocation`" /Source:$sourcePath /Dest:$containerURL /DestKey:`"*****`" $additionalArguments"
Write-Verbose "Executing command: & `"$azCopyExeLocation`" /Source:`"$resolvedSourcePath`" /Dest:`"$containerURL`" /DestKey:`"*****`" $additionalArguments"
Copy link
Member

@arjgupta arjgupta May 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will be better if you write this with ##[command] and write it to output and not the verbose stream. Will be better experience. And no need to repeat the command here and in the next line. create it once, and then use it wherever. Later if this command changes, you will need to update at only place.

@kmkumaran kmkumaran self-assigned this May 17, 2018
@arjgupta arjgupta merged commit e193259 into master May 18, 2018
rajatagrawal-dev added a commit that referenced this pull request May 24, 2018
* fixed single file blob upload

* fixed single file blob upload

* fixed L0

* clean target issue + pr comments

* pr feedback
rajatagrawal-dev added a commit that referenced this pull request May 28, 2018
* fixed single file blob upload (#7222)

* fixed single file blob upload

* fixed single file blob upload

* fixed L0

* clean target issue + pr comments

* pr feedback

* updated patch

* pr feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants