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

Creating Blob if not there #12826

Merged
merged 7 commits into from
May 13, 2020
Merged

Creating Blob if not there #12826

merged 7 commits into from
May 13, 2020

Conversation

20shivangi
Copy link
Contributor

@20shivangi 20shivangi commented May 5, 2020

Fixes: #12827

Copy link
Contributor

@chshrikh chshrikh left a 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

@20shivangi 20shivangi force-pushed the users/shmittal/CreatingBlob branch from 9224428 to c12dbaf Compare May 8, 2020 07:31
$containerPresent = Get-AzureContainer -containerName $containerName -storageContext $storageContext

#creating container if the containerName provided does not exist
if([string]::IsNullOrEmpty($containerPresent) )
Copy link
Member

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
Copy link
Member

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"
Copy link
Member

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

@20shivangi 20shivangi force-pushed the users/shmittal/CreatingBlob branch from d1e8428 to 1c5e27e Compare May 11, 2020 11:02
@@ -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"
Copy link
Member

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
Copy link
Member

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.

@20shivangi 20shivangi force-pushed the users/shmittal/CreatingBlob branch from 8c7a7b0 to dd20186 Compare May 11, 2020 11:21
@20shivangi 20shivangi merged commit 86d5f52 into master May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error setting up Azcopy on newly created VM
4 participants