-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Creating Blob if not there #12826
Creating Blob if not there #12826
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arjgupta please check this once
We should plan to port it to releases/M169
9224428
to
c12dbaf
Compare
$containerPresent = Get-AzureContainer -containerName $containerName -storageContext $storageContext | ||
|
||
#creating container if the containerName provided does not exist | ||
if([string]::IsNullOrEmpty($containerPresent) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since container is an object, this shouldn't be a string empty check, rather it should be a null check
#creating container if the containerName provided does not exist | ||
if([string]::IsNullOrEmpty($containerPresent) ) | ||
{ | ||
Create-AzureContainer -containerName $containerName -storageContext $storageContext -isPremiumStorage $isPremiumStorage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a debug log here.
@@ -92,9 +93,10 @@ $AzureFileCopyRemoteJob = { | |||
$additionalArguments = "--recursive --log-level=INFO" | |||
} | |||
|
|||
Write-DetailLogs "##[command] & azcopy copy `"$containerURL*****`" `"$targetPath`" $additionalArguments" | |||
$azCopyExeLocation = Join-Path -Path $azCopyFolderPath -ChildPath "AzCopy\AzCopy.exe" | |||
Write-DetailLogs "##[command] & `"$azCopyExeLocation`" copy `"$containerURL*****`" `"$targetPath`" $additionalArguments" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use get-command to get the azcopy.exe command here. then use push-location and pop-location to execute the command
d1e8428
to
1c5e27e
Compare
@@ -118,8 +118,22 @@ try { | |||
if([string]::IsNullOrEmpty($containerName) -or ($destination -ne "AzureBlob")) | |||
{ | |||
$containerName = [guid]::NewGuid().ToString() | |||
Create-AzureContainer -containerName $containerName -storageContext $storageContext -isPremiumStorage $isPremiumStorage | |||
Write-Verbose "Creating temporary container for uploading files if no input is provided for container name" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be: Container Name input not found. Creating Temporary container for uploading files.
[Environment]::SetEnvironmentVariable("Path", $azCopyFolderEnvPath + ';' + $env:Path, [System.EnvironmentVariableTarget]::Machine) | ||
|
||
#setting $env:Path to include azcopy.exe path as the above command used to set path at machine level takes some time to update the path environment variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no don't say it takes some time. What is happening here is that once the task process initiates, the $env:path variable is set. The path variable here is the user path variable. So after you set the path variable at machine level, the user path variable remains the same. Please update the comment to reflect this idea accurately.
8c7a7b0
to
dd20186
Compare
Fixes: #12827