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

use get-azurermstorageaccount instead of get-azurermresource to fetch… #11423

Merged
merged 4 commits into from
Oct 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions Tasks/AzureFileCopyV2/AzureUtilityGTE1.0.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Copy link
Contributor

Choose a reason for hiding this comment

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

@niadak fyi we are using 'Get-AzureRmStorageAccount', replacing logic with Get-AzureRMResource

Write-Verbose "[Azure Call]Retrieved resource details successfully for azure storage account resource: $storageAccountName with resource type: $ARMStorageAccountResourceType"

$azureResourceGroupName = $azureStorageAccountResourceDetails.ResourceGroupName
Expand Down
14 changes: 7 additions & 7 deletions Tasks/AzureFileCopyV2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 2,
"Minor": 154,
"Patch": 9
"Patch": 10
},
"demands": [
"azureps"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 2,
"Minor": 154,
"Patch": 9
"Patch": 10
},
"demands": [
"azureps"
Expand Down
10 changes: 1 addition & 9 deletions Tasks/AzureFileCopyV3/AzureUtilityARM.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions Tasks/AzureFileCopyV3/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 3,
"Minor": 154,
"Patch": 9
"Patch": 10
},
"preview": true,
"demands": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureFileCopyV3/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": 3,
"Minor": 154,
"Patch": 9
"Patch": 10
},
"preview": true,
"demands": [
Expand Down