From a3f2f837129f1da4f43db686e7acd186d9811fae Mon Sep 17 00:00:00 2001 From: Arjun Gupta Date: Wed, 25 Sep 2019 15:11:06 +0530 Subject: [PATCH] use get-azurermstorageaccount instead of get-azurermresource to fetch storage account details --- Tasks/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 | 10 +--------- Tasks/AzureFileCopyV2/package-lock.json | 14 +++++++------- Tasks/AzureFileCopyV2/task.json | 2 +- Tasks/AzureFileCopyV2/task.loc.json | 2 +- Tasks/AzureFileCopyV3/AzureUtilityARM.ps1 | 10 +--------- Tasks/AzureFileCopyV3/package-lock.json | 14 +++++++------- Tasks/AzureFileCopyV3/task.json | 2 +- Tasks/AzureFileCopyV3/task.loc.json | 2 +- 8 files changed, 20 insertions(+), 36 deletions(-) diff --git a/Tasks/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 b/Tasks/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 index cfa6f0cca451..29fb96ece158 100644 --- a/Tasks/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 +++ b/Tasks/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 @@ -24,15 +24,7 @@ function Get-AzureStorageAccountResourceGroupName if (-not [string]::IsNullOrEmpty($storageAccountName)) { Write-Verbose "[Azure Call]Getting resource details for azure storage account resource: $storageAccountName with resource type: $ARMStorageAccountResourceType" - if (CmdletHasMember -cmdlet "Get-AzureRMResource" -memberName "Name") - { - $azureStorageAccountResourceDetails = (Get-AzureRMResource -ErrorAction Stop) | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} - } - else - { - $azureStorageAccountResourceDetails = (Get-AzureRMResource -ErrorAction Stop) | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.ResourceName -eq $storageAccountName)} - } - + $azureStorageAccountResourceDetails = Get-AzureRmStorageAccount -ErrorAction Stop | Where-Object { $_.StorageAccountName -eq $storageAccountName } Write-Verbose "[Azure Call]Retrieved resource details successfully for azure storage account resource: $storageAccountName with resource type: $ARMStorageAccountResourceType" $azureResourceGroupName = $azureStorageAccountResourceDetails.ResourceGroupName diff --git a/Tasks/AzureFileCopyV2/package-lock.json b/Tasks/AzureFileCopyV2/package-lock.json index 12353f37eeac..97dbe4d31ae4 100644 --- a/Tasks/AzureFileCopyV2/package-lock.json +++ b/Tasks/AzureFileCopyV2/package-lock.json @@ -36,11 +36,11 @@ "integrity": "sha512-PR8oap9z2j+o455W3PwAfB4SX1p4GdJc9OHQaQV0V+iQS1IBY6dVgcNSQMkHAXb0V1bbuLOFBLanXPe5eSgGTQ==", "requires": { "minimatch": "3.0.4", - "mockery": "1.7.0", - "q": "1.4.1", - "semver": "5.7.0", - "shelljs": "0.3.0", - "uuid": "3.2.1" + "mockery": "^1.7.0", + "q": "^1.1.2", + "semver": "^5.1.0", + "shelljs": "^0.3.0", + "uuid": "^3.0.1" } }, "balanced-match": { @@ -53,7 +53,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -137,7 +137,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "mockery": { diff --git a/Tasks/AzureFileCopyV2/task.json b/Tasks/AzureFileCopyV2/task.json index be94612b6c1c..7ef1e398acad 100644 --- a/Tasks/AzureFileCopyV2/task.json +++ b/Tasks/AzureFileCopyV2/task.json @@ -14,7 +14,7 @@ "version": { "Major": 2, "Minor": 154, - "Patch": 9 + "Patch": 10 }, "demands": [ "azureps" diff --git a/Tasks/AzureFileCopyV2/task.loc.json b/Tasks/AzureFileCopyV2/task.loc.json index 742032854f4e..358b17cc0ea9 100644 --- a/Tasks/AzureFileCopyV2/task.loc.json +++ b/Tasks/AzureFileCopyV2/task.loc.json @@ -14,7 +14,7 @@ "version": { "Major": 2, "Minor": 154, - "Patch": 9 + "Patch": 10 }, "demands": [ "azureps" diff --git a/Tasks/AzureFileCopyV3/AzureUtilityARM.ps1 b/Tasks/AzureFileCopyV3/AzureUtilityARM.ps1 index 001c744a4ee7..d112b0f7d1a3 100644 --- a/Tasks/AzureFileCopyV3/AzureUtilityARM.ps1 +++ b/Tasks/AzureFileCopyV3/AzureUtilityARM.ps1 @@ -10,15 +10,7 @@ function Get-AzureStorageAccountResourceGroupName if (-not [string]::IsNullOrEmpty($storageAccountName)) { Write-Verbose "[Azure Call]Getting resource details for azure storage account resource: $storageAccountName with resource type: $ARMStorageAccountResourceType" - if (CmdletHasMember -cmdlet "Get-AzureRMResource" -memberName "Name") - { - $azureStorageAccountResourceDetails = (Get-AzureRMResource -ErrorAction Stop) | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} - } - else - { - $azureStorageAccountResourceDetails = (Get-AzureRMResource -ErrorAction Stop) | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.ResourceName -eq $storageAccountName)} - } - + $azureStorageAccountResourceDetails = Get-AzureRmStorageAccount -ErrorAction Stop | Where-Object { $_.StorageAccountName -eq $storageAccountName } Write-Verbose "[Azure Call]Retrieved resource details successfully for azure storage account resource: $storageAccountName with resource type: $ARMStorageAccountResourceType" $azureResourceGroupName = $azureStorageAccountResourceDetails.ResourceGroupName diff --git a/Tasks/AzureFileCopyV3/package-lock.json b/Tasks/AzureFileCopyV3/package-lock.json index 12353f37eeac..97dbe4d31ae4 100644 --- a/Tasks/AzureFileCopyV3/package-lock.json +++ b/Tasks/AzureFileCopyV3/package-lock.json @@ -36,11 +36,11 @@ "integrity": "sha512-PR8oap9z2j+o455W3PwAfB4SX1p4GdJc9OHQaQV0V+iQS1IBY6dVgcNSQMkHAXb0V1bbuLOFBLanXPe5eSgGTQ==", "requires": { "minimatch": "3.0.4", - "mockery": "1.7.0", - "q": "1.4.1", - "semver": "5.7.0", - "shelljs": "0.3.0", - "uuid": "3.2.1" + "mockery": "^1.7.0", + "q": "^1.1.2", + "semver": "^5.1.0", + "shelljs": "^0.3.0", + "uuid": "^3.0.1" } }, "balanced-match": { @@ -53,7 +53,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -137,7 +137,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "mockery": { diff --git a/Tasks/AzureFileCopyV3/task.json b/Tasks/AzureFileCopyV3/task.json index 52f2049b1de9..611763b923be 100644 --- a/Tasks/AzureFileCopyV3/task.json +++ b/Tasks/AzureFileCopyV3/task.json @@ -14,7 +14,7 @@ "version": { "Major": 3, "Minor": 154, - "Patch": 9 + "Patch": 10 }, "preview": true, "demands": [ diff --git a/Tasks/AzureFileCopyV3/task.loc.json b/Tasks/AzureFileCopyV3/task.loc.json index cc49e52d6641..722d2617fb82 100644 --- a/Tasks/AzureFileCopyV3/task.loc.json +++ b/Tasks/AzureFileCopyV3/task.loc.json @@ -14,7 +14,7 @@ "version": { "Major": 3, "Minor": 154, - "Patch": 9 + "Patch": 10 }, "preview": true, "demands": [