From 7099cfde3fa94eed9aa251f581f4a2c16bc19be9 Mon Sep 17 00:00:00 2001 From: Nikita Shkarupa Date: Fri, 5 Jan 2024 16:39:22 +0100 Subject: [PATCH 1/9] Migrate tasks using Az.Tools.Migration --- .../Utility.ps1 | 6 +- Tasks/AzureFileCopyV1/AzureFileCopy.ps1 | 4 +- Tasks/AzureFileCopyV1/AzureUtilityGTE1.0.ps1 | 57 ++++++++++--------- .../AzureFileCopyV1/AzureUtilityGTE1.1.0.ps1 | 5 +- Tasks/AzureFileCopyV1/AzureUtilityLTE9.8.ps1 | 11 ++-- Tasks/AzureFileCopyV2/AzureFileCopy.ps1 | 4 +- Tasks/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 | 55 +++++++++--------- .../AzureFileCopyV2/AzureUtilityGTE1.1.0.ps1 | 5 +- Tasks/AzureFileCopyV2/AzureUtilityLTE9.8.ps1 | 11 ++-- Tasks/AzureFileCopyV3/AzureUtilityARM.ps1 | 43 +++++++------- Tasks/AzureFileCopyV4/AzureUtilityARM.ps1 | 43 +++++++------- Tasks/AzureFileCopyV5/AzureUtilityARM.ps1 | 43 +++++++------- .../InitializeAzureRMFunctions.ps1 | 21 +++---- .../VstsAzureHelpers_/InitializeFunctions.ps1 | 27 ++++----- Tasks/Common/VstsAzureHelpers_/Utility.ps1 | 21 +++---- 15 files changed, 184 insertions(+), 172 deletions(-) diff --git a/Tasks/AzureCloudPowerShellDeploymentV1/Utility.ps1 b/Tasks/AzureCloudPowerShellDeploymentV1/Utility.ps1 index de6800dd4d51..2e2ae674db91 100644 --- a/Tasks/AzureCloudPowerShellDeploymentV1/Utility.ps1 +++ b/Tasks/AzureCloudPowerShellDeploymentV1/Utility.ps1 @@ -57,12 +57,12 @@ function Get-AzureStoragePrimaryKey($storageAccount, [bool]$isArm) { if ($isArm) { - $storageAccountResource = Get-AzureRmResource | where-object { $_.Name -eq $storageAccount -and $_.ResourceType -eq "Microsoft.Storage/storageAccounts" } + $storageAccountResource = Get-AzResource | where-object { $_.Name -eq $storageAccount -and $_.ResourceType -eq "Microsoft.Storage/storageAccounts" } if (!$storageAccountResource) { Write-Error -Message "Could not find resource $storageAccount that has a type of Microsoft.Storage/storageAccounts" } - $storageAccountKeys = Get-AzureRmStorageAccountKey -ResourceGroupName $storageAccountResource.ResourceGroupName -Name $storageAccount + $storageAccountKeys = Get-AzStorageAccountKey -ResourceGroupName $storageAccountResource.ResourceGroupName -Name $storageAccount if(!$storageAccountKeys) { Write-Error -Message "Could not retrieve storage account keys from storage account resource $Storage" @@ -185,7 +185,7 @@ function Get-DiagnosticsExtensions($storageAccount, $extensionsPath, $storageAcc { try { - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey Write-Host "New-AzureServiceDiagnosticsExtensionConfig -Role $role -StorageContext $StorageContext -DiagnosticsConfigurationPath $fullExtPath" $wadconfig = New-AzureServiceDiagnosticsExtensionConfig -Role $role -StorageContext $StorageContext -DiagnosticsConfigurationPath $fullExtPath } diff --git a/Tasks/AzureFileCopyV1/AzureFileCopy.ps1 b/Tasks/AzureFileCopyV1/AzureFileCopy.ps1 index a8aef3f5d0fd..4617fb8528ee 100644 --- a/Tasks/AzureFileCopyV1/AzureFileCopy.ps1 +++ b/Tasks/AzureFileCopyV1/AzureFileCopy.ps1 @@ -168,7 +168,7 @@ try { } if(-not [string]::IsNullOrEmpty($outputStorageContainerSASToken)) { - $storageContainerSaSToken = New-AzureStorageContainerSASToken -Container $containerName -Context $storageContext -Permission r -ExpiryTime (Get-Date).AddHours($defaultSasTokenTimeOutInHours) + $storageContainerSaSToken = New-AzStorageContainerSASToken -Name $containerName -Context $storageContext -Permission r -ExpiryTime (Get-Date).AddHours($defaultSasTokenTimeOutInHours) Write-Host "##vso[task.setvariable variable=$outputStorageContainerSASToken;]$storageContainerSasToken" } @@ -221,4 +221,4 @@ try { } finally { Disconnect-AzureAndClearContext -authScheme $connectionType -ErrorAction SilentlyContinue -} \ No newline at end of file +} diff --git a/Tasks/AzureFileCopyV1/AzureUtilityGTE1.0.ps1 b/Tasks/AzureFileCopyV1/AzureUtilityGTE1.0.ps1 index e161e00a6373..6f92c3a0c360 100644 --- a/Tasks/AzureFileCopyV1/AzureUtilityGTE1.0.ps1 +++ b/Tasks/AzureFileCopyV1/AzureUtilityGTE1.0.ps1 @@ -26,11 +26,11 @@ function Get-AzureStorageAccountResourceGroupName 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)} + $azureStorageAccountResourceDetails = (Get-AzResource -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-AzResource -ErrorAction Stop) | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.ResourceName -eq $storageAccountName)} } Write-Verbose "[Azure Call]Retrieved resource details successfully for azure storage account resource: $storageAccountName with resource type: $ARMStorageAccountResourceType" @@ -58,7 +58,7 @@ function Get-AzureStorageKeyFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage key for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageKeyDetails = Get-AzureRMStorageAccountKey -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + $storageKeyDetails = Get-AzStorageAccountKey -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop $storageKey = $storageKeyDetails.Key1 Write-Verbose "[Azure Call]Retrieved storage key successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -74,7 +74,7 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -110,7 +110,7 @@ function Get-AzureBlobStorageEndpointFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage account endpoint for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageAccountInfo = Get-AzureRMStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + $storageAccountInfo = Get-AzStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop $storageAccountEnpoint = $storageAccountInfo.PrimaryEndpoints[0].blob Write-Verbose "[Azure Call]Retrieved storage account endpoint successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -147,7 +147,7 @@ function Get-AzureStorageAccountTypeFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage account type for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageAccountInfo = Get-AzureRMStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + $storageAccountInfo = Get-AzStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop $storageAccountType = $storageAccountInfo.AccountType Write-Verbose "[Azure Call]Retrieved storage account type successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -168,9 +168,9 @@ function Create-AzureContainer Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" if ($isPremiumStorage) { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop } else { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } @@ -186,7 +186,7 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -273,7 +273,7 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -356,17 +356,17 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -375,15 +375,15 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -409,7 +409,7 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInHours hours" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -424,7 +424,7 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -443,7 +443,7 @@ function Get-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName)) { Write-Host (Get-VstsLocString -Key "AFC_GetCustomScriptExtension" -ArgumentList $name, $vmName) - $customScriptExtension = Get-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -ErrorAction Stop -Verbose + $customScriptExtension = Get-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_GetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -463,7 +463,7 @@ function Set-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -482,7 +482,7 @@ function Remove-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_RemoveCustomScriptExtension" -ArgumentList $name, $vmName) - $response = Remove-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -Force -ErrorAction SilentlyContinue -Verbose + $response = Remove-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -Force -ErrorAction SilentlyContinue -Verbose Write-Host (Get-VstsLocString -Key "AFC_RemoveCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -499,7 +499,7 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -521,7 +521,7 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -559,7 +559,7 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -576,11 +576,11 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -591,7 +591,7 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" @@ -620,7 +620,8 @@ function Remove-NetworkSecurityRuleConfig foreach($securityGroup in $securityGroups) { Write-Verbose "[Azure Call]Removing the Rule $ruleName" - $result = Remove-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName | Set-AzureRmNetworkSecurityGroup + $result = Remove-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName | Set-AzNetworkSecurityGroup Write-Verbose "[Azure Call]Removed the Rule $ruleName" } } + diff --git a/Tasks/AzureFileCopyV1/AzureUtilityGTE1.1.0.ps1 b/Tasks/AzureFileCopyV1/AzureUtilityGTE1.1.0.ps1 index acf2f971551e..efce751dbaa7 100644 --- a/Tasks/AzureFileCopyV1/AzureUtilityGTE1.1.0.ps1 +++ b/Tasks/AzureFileCopyV1/AzureUtilityGTE1.1.0.ps1 @@ -11,7 +11,7 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -41,7 +41,7 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { @@ -55,3 +55,4 @@ function Set-AzureMachineCustomScriptExtension return $result } + diff --git a/Tasks/AzureFileCopyV1/AzureUtilityLTE9.8.ps1 b/Tasks/AzureFileCopyV1/AzureUtilityLTE9.8.ps1 index a8ba50244ae5..ca7d36df7ff1 100644 --- a/Tasks/AzureFileCopyV1/AzureUtilityLTE9.8.ps1 +++ b/Tasks/AzureFileCopyV1/AzureUtilityLTE9.8.ps1 @@ -78,7 +78,7 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -180,11 +180,11 @@ function Create-AzureContainer Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" if ($isPremiumStorage) { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop } else { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } @@ -200,7 +200,7 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -376,7 +376,7 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInHours hours" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -598,3 +598,4 @@ function Remove-NetworkSecurityRuleConfig Write-Verbose "[Azure Call]Removed the Rule $ruleName" } } + diff --git a/Tasks/AzureFileCopyV2/AzureFileCopy.ps1 b/Tasks/AzureFileCopyV2/AzureFileCopy.ps1 index 6b64ce4a6c72..401f34528473 100644 --- a/Tasks/AzureFileCopyV2/AzureFileCopy.ps1 +++ b/Tasks/AzureFileCopyV2/AzureFileCopy.ps1 @@ -211,7 +211,7 @@ try { } if(-not [string]::IsNullOrEmpty($outputStorageContainerSASToken)) { - $storageContainerSaSToken = New-AzureStorageContainerSASToken -Container $containerName -Context $storageContext -Permission rl -ExpiryTime (Get-Date).AddHours($defaultSasTokenTimeOutInHours) + $storageContainerSaSToken = New-AzStorageContainerSASToken -Name $containerName -Context $storageContext -Permission rl -ExpiryTime (Get-Date).AddHours($defaultSasTokenTimeOutInHours) Write-Host "##vso[task.setvariable variable=$outputStorageContainerSASToken;]$storageContainerSasToken" } @@ -280,4 +280,4 @@ try { } finally { Disconnect-AzureAndClearContext -authScheme $connectionType -ErrorAction SilentlyContinue -} \ No newline at end of file +} diff --git a/Tasks/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 b/Tasks/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 index 3b9642fcf36c..4564ce2b43b2 100644 --- a/Tasks/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 +++ b/Tasks/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 @@ -24,7 +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" - $azureStorageAccountResourceDetails = Get-AzureRmResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + $azureStorageAccountResourceDetails = Get-AzResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} Write-Verbose "[Azure Call]Retrieved resource details successfully for azure storage account resource: $storageAccountName with resource type: $ARMStorageAccountResourceType" $azureResourceGroupName = $azureStorageAccountResourceDetails.ResourceGroupName @@ -50,7 +50,7 @@ function Get-AzureStorageKeyFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage key for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageKeyDetails = Get-AzureRMStorageAccountKey -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + $storageKeyDetails = Get-AzStorageAccountKey -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop $storageKey = $storageKeyDetails.Key1 Write-Verbose "[Azure Call]Retrieved storage key successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -66,7 +66,7 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -102,7 +102,7 @@ function Get-AzureBlobStorageEndpointFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage account endpoint for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageAccountInfo = Get-AzureRMStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + $storageAccountInfo = Get-AzStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop $storageAccountEnpoint = $storageAccountInfo.PrimaryEndpoints[0].blob Write-Verbose "[Azure Call]Retrieved storage account endpoint successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -139,7 +139,7 @@ function Get-AzureStorageAccountTypeFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage account type for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageAccountInfo = Get-AzureRMStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + $storageAccountInfo = Get-AzStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop $storageAccountType = $storageAccountInfo.AccountType Write-Verbose "[Azure Call]Retrieved storage account type successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -160,9 +160,9 @@ function Create-AzureContainer Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" if ($isPremiumStorage) { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop } else { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } @@ -178,7 +178,7 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -265,7 +265,7 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -348,17 +348,17 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -367,15 +367,15 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -401,7 +401,7 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInHours hours" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -416,7 +416,7 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -435,7 +435,7 @@ function Get-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName)) { Write-Host (Get-VstsLocString -Key "AFC_GetCustomScriptExtension" -ArgumentList $name, $vmName) - $customScriptExtension = Get-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -ErrorAction Stop -Verbose + $customScriptExtension = Get-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_GetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -455,7 +455,7 @@ function Set-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -474,7 +474,7 @@ function Remove-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_RemoveCustomScriptExtension" -ArgumentList $name, $vmName) - $response = Remove-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -Force -ErrorAction SilentlyContinue -Verbose + $response = Remove-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -Force -ErrorAction SilentlyContinue -Verbose Write-Host (Get-VstsLocString -Key "AFC_RemoveCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -491,7 +491,7 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -513,7 +513,7 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -551,7 +551,7 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -568,11 +568,11 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -583,7 +583,7 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" @@ -612,7 +612,8 @@ function Remove-NetworkSecurityRuleConfig foreach($securityGroup in $securityGroups) { Write-Verbose "[Azure Call]Removing the Rule $ruleName" - $result = Remove-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName | Set-AzureRmNetworkSecurityGroup + $result = Remove-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName | Set-AzNetworkSecurityGroup Write-Verbose "[Azure Call]Removed the Rule $ruleName" } } + diff --git a/Tasks/AzureFileCopyV2/AzureUtilityGTE1.1.0.ps1 b/Tasks/AzureFileCopyV2/AzureUtilityGTE1.1.0.ps1 index acf2f971551e..efce751dbaa7 100644 --- a/Tasks/AzureFileCopyV2/AzureUtilityGTE1.1.0.ps1 +++ b/Tasks/AzureFileCopyV2/AzureUtilityGTE1.1.0.ps1 @@ -11,7 +11,7 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -41,7 +41,7 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { @@ -55,3 +55,4 @@ function Set-AzureMachineCustomScriptExtension return $result } + diff --git a/Tasks/AzureFileCopyV2/AzureUtilityLTE9.8.ps1 b/Tasks/AzureFileCopyV2/AzureUtilityLTE9.8.ps1 index dcdd33a0c368..f297872b7500 100644 --- a/Tasks/AzureFileCopyV2/AzureUtilityLTE9.8.ps1 +++ b/Tasks/AzureFileCopyV2/AzureUtilityLTE9.8.ps1 @@ -80,7 +80,7 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -182,11 +182,11 @@ function Create-AzureContainer Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" if ($isPremiumStorage) { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop } else { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } @@ -202,7 +202,7 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -378,7 +378,7 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInHours hours" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -600,3 +600,4 @@ function Remove-NetworkSecurityRuleConfig Write-Verbose "[Azure Call]Removed the Rule $ruleName" } } + diff --git a/Tasks/AzureFileCopyV3/AzureUtilityARM.ps1 b/Tasks/AzureFileCopyV3/AzureUtilityARM.ps1 index 9ed07921a74d..ea86e3c0d156 100644 --- a/Tasks/AzureFileCopyV3/AzureUtilityARM.ps1 +++ b/Tasks/AzureFileCopyV3/AzureUtilityARM.ps1 @@ -10,7 +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" - $azureStorageAccountResourceDetails = Get-AzureRmResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + $azureStorageAccountResourceDetails = Get-AzResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} Write-Verbose "[Azure Call]Retrieved resource details successfully for azure storage account resource: $storageAccountName with resource type: $ARMStorageAccountResourceType" $azureResourceGroupName = $azureStorageAccountResourceDetails.ResourceGroupName @@ -33,7 +33,7 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -53,9 +53,9 @@ function Create-AzureContainer Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" if ($isPremiumStorage) { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop } else { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } @@ -71,7 +71,7 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -85,7 +85,7 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -112,17 +112,17 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -131,15 +131,15 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -165,7 +165,7 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInMinutes minutes" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -180,7 +180,7 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -201,7 +201,7 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { @@ -224,7 +224,7 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -246,7 +246,7 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -284,7 +284,7 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -301,11 +301,11 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -316,7 +316,7 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" @@ -335,3 +335,4 @@ function Add-NetworkSecurityRuleConfig } } } + diff --git a/Tasks/AzureFileCopyV4/AzureUtilityARM.ps1 b/Tasks/AzureFileCopyV4/AzureUtilityARM.ps1 index e31f5c2bfd6d..bcabca2f9c9e 100644 --- a/Tasks/AzureFileCopyV4/AzureUtilityARM.ps1 +++ b/Tasks/AzureFileCopyV4/AzureUtilityARM.ps1 @@ -10,7 +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" - $azureStorageAccountResourceDetails = Get-AzureRmStorageAccount -ErrorAction Stop | Where-Object { $_.StorageAccountName -eq $storageAccountName } + $azureStorageAccountResourceDetails = Get-AzStorageAccount -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 @@ -33,7 +33,7 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -50,7 +50,7 @@ function Create-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } } @@ -69,7 +69,7 @@ function Get-AzureContainer Write-Verbose "[Azure Call]Getting container: $containerName in storage account: $storageAccountName" try { - $container = Get-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + $container = Get-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop } catch { @@ -90,7 +90,7 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -104,7 +104,7 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -131,17 +131,17 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -150,15 +150,15 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -184,7 +184,7 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInMinutes minutes" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -199,7 +199,7 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -220,7 +220,7 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { @@ -243,7 +243,7 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -265,7 +265,7 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -303,7 +303,7 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -320,11 +320,11 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -335,7 +335,7 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" @@ -354,3 +354,4 @@ function Add-NetworkSecurityRuleConfig } } } + diff --git a/Tasks/AzureFileCopyV5/AzureUtilityARM.ps1 b/Tasks/AzureFileCopyV5/AzureUtilityARM.ps1 index e31f5c2bfd6d..bcabca2f9c9e 100644 --- a/Tasks/AzureFileCopyV5/AzureUtilityARM.ps1 +++ b/Tasks/AzureFileCopyV5/AzureUtilityARM.ps1 @@ -10,7 +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" - $azureStorageAccountResourceDetails = Get-AzureRmStorageAccount -ErrorAction Stop | Where-Object { $_.StorageAccountName -eq $storageAccountName } + $azureStorageAccountResourceDetails = Get-AzStorageAccount -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 @@ -33,7 +33,7 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -50,7 +50,7 @@ function Create-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } } @@ -69,7 +69,7 @@ function Get-AzureContainer Write-Verbose "[Azure Call]Getting container: $containerName in storage account: $storageAccountName" try { - $container = Get-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + $container = Get-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop } catch { @@ -90,7 +90,7 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -104,7 +104,7 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -131,17 +131,17 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -150,15 +150,15 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -184,7 +184,7 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInMinutes minutes" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -199,7 +199,7 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -220,7 +220,7 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { @@ -243,7 +243,7 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -265,7 +265,7 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -303,7 +303,7 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -320,11 +320,11 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -335,7 +335,7 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" @@ -354,3 +354,4 @@ function Add-NetworkSecurityRuleConfig } } } + diff --git a/Tasks/Common/VstsAzureHelpers_/InitializeAzureRMFunctions.ps1 b/Tasks/Common/VstsAzureHelpers_/InitializeAzureRMFunctions.ps1 index 1f2dafb8f638..fb4a1d7df452 100644 --- a/Tasks/Common/VstsAzureHelpers_/InitializeAzureRMFunctions.ps1 +++ b/Tasks/Common/VstsAzureHelpers_/InitializeAzureRMFunctions.ps1 @@ -80,9 +80,9 @@ function Initialize-AzureRMSubscription { # Clear context if ($Endpoint.Auth.Scheme -eq 'ServicePrincipal' -and (Get-Command -Name "Clear-AzureRmContext" -ErrorAction "SilentlyContinue")) { Write-Host "##[command]Clear-AzureRmContext -Scope Process" - $null = Clear-AzureRmContext -Scope Process + $null = Clear-AzContext -Scope Process Write-Host "##[command]Clear-AzureRmContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue" - $null = Clear-AzureRmContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue + $null = Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue } $environmentName = "AzureCloud" @@ -121,32 +121,32 @@ function Initialize-AzureRMSubscription { if ($Endpoint.Auth.Parameters.AuthenticationType -eq "SPNCertificate") { Write-Host "##[command]Add-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -CertificateThumbprint ****** -ApplicationId $($Endpoint.Auth.Parameters.ServicePrincipalId) -EnvironmentName $environmentName" - $null = Add-AzureRmAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -EnvironmentName $environmentName + $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName } else { Write-Host "##[command]Add-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -Credential $psCredential -EnvironmentName $environmentName" - $null = Add-AzureRMAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -EnvironmentName $environmentName + $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName } } else { if ($Endpoint.Auth.Parameters.AuthenticationType -eq "SPNCertificate") { Write-Host "##[command]Add-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -CertificateThumbprint ****** -ApplicationId $($Endpoint.Auth.Parameters.ServicePrincipalId) -Environment $environmentName" - $null = Add-AzureRmAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName + $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName } else { Write-Host "##[command]Add-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -Credential $psCredential -Environment $environmentName" - $null = Add-AzureRMAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName + $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName } } } else { if ($Endpoint.Auth.Parameters.AuthenticationType -eq "SPNCertificate") { Write-Host "##[command]Connect-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -CertificateThumbprint ****** -ApplicationId $($Endpoint.Auth.Parameters.ServicePrincipalId) -Environment $environmentName" - $null = Connect-AzureRmAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName + $null = Connect-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName } else { Write-Host "##[command]Connect-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -Credential $psCredential -Environment $environmentName" - $null = Connect-AzureRMAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName + $null = Connect-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName } } } @@ -172,7 +172,7 @@ function Initialize-AzureRMSubscription { $access_token = Get-MsiAccessToken $Endpoint try { Write-Host "##[command]Add-AzureRmAccount -AccessToken ****** -AccountId $accountId " - $null = Add-AzureRmAccount -AccessToken $access_token -AccountId $accountId + $null = Add-AzAccount -AccessToken $access_token -AccountId $accountId } catch { # Provide an additional, custom, credentials-related error message. Write-VstsTaskError -Message $_.Exception.Message @@ -196,6 +196,7 @@ function Set-CurrentAzureRMSubscriptionV2 { if ($TenantId) { $additional['TenantId'] = $TenantId } Write-Host "##[command] Set-AzureRmContext -SubscriptionId $SubscriptionId $(Format-Splat $additional)" - $null = Set-AzureRmContext -SubscriptionId $SubscriptionId @additional + $null = Set-AzContext -Subscription $SubscriptionId @additional } + diff --git a/Tasks/Common/VstsAzureHelpers_/InitializeFunctions.ps1 b/Tasks/Common/VstsAzureHelpers_/InitializeFunctions.ps1 index 0fb7cafedc21..f67b968cb960 100644 --- a/Tasks/Common/VstsAzureHelpers_/InitializeFunctions.ps1 +++ b/Tasks/Common/VstsAzureHelpers_/InitializeFunctions.ps1 @@ -13,14 +13,14 @@ function Initialize-AzureSubscription { # Clear context only for Azure RM if ($Endpoint.Auth.Scheme -eq 'ServicePrincipal' -and !$script:azureModule -and (Get-Command -Name "Clear-AzureRmContext" -ErrorAction "SilentlyContinue")) { Write-Host "##[command]Clear-AzureRmContext -Scope Process" - $null = Clear-AzureRmContext -Scope Process + $null = Clear-AzContext -Scope Process } if (Get-Command -Name "Disable-AzureRmContextAutosave" -ErrorAction "SilentlyContinue") { try { Write-Host "##[command]Disable-AzureRmContextAutosave -ErrorAction Stop" - $null = Disable-AzureRmContextAutosave -ErrorAction Stop + $null = Disable-AzContextAutosave -ErrorAction Stop } catch { $message = $_.Exception.Message @@ -108,10 +108,10 @@ function Initialize-AzureSubscription { try { if (Get-Command -Name "Add-AzureRmAccount" -ErrorAction "SilentlyContinue") { Write-Host "##[command] Add-AzureRMAccount -Credential $psCredential" - $null = Add-AzureRMAccount -Credential $psCredential + $null = Add-AzAccount -Credential $psCredential } else { Write-Host "##[command] Connect-AzureRMAccount -Credential $psCredential" - $null = Connect-AzureRMAccount -Credential $psCredential + $null = Connect-AzAccount -Credential $psCredential } } catch { # Provide an additional, custom, credentials-related error message. @@ -198,21 +198,21 @@ function Initialize-AzureSubscription { if ($Endpoint.Auth.Parameters.AuthenticationType -eq "SPNCertificate") { Write-Host "##[command]Add-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -CertificateThumbprint ****** -ApplicationId $($Endpoint.Auth.Parameters.ServicePrincipalId) -EnvironmentName $environmentName @processScope" - $null = Add-AzureRmAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -EnvironmentName $environmentName @processScope + $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName @processScope } else { Write-Host "##[command]Add-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -Credential $psCredential -EnvironmentName $environmentName @processScope" - $null = Add-AzureRMAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -EnvironmentName $environmentName @processScope + $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName @processScope } } else { if ($Endpoint.Auth.Parameters.AuthenticationType -eq "SPNCertificate") { Write-Host "##[command]Add-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -CertificateThumbprint ****** -ApplicationId $($Endpoint.Auth.Parameters.ServicePrincipalId) -Environment $environmentName @processScope" - $null = Add-AzureRmAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName @processScope + $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName @processScope } else { Write-Host "##[command]Add-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -Credential $psCredential -Environment $environmentName @processScope" - $null = Add-AzureRMAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName @processScope + $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName @processScope } } } @@ -228,11 +228,11 @@ function Initialize-AzureSubscription { if ($Endpoint.Auth.Parameters.AuthenticationType -eq "SPNCertificate") { Write-Host "##[command]Connect-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -CertificateThumbprint ****** -ApplicationId $($Endpoint.Auth.Parameters.ServicePrincipalId) -Environment $environmentName @processScope" - $null = Connect-AzureRmAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName @processScope + $null = Connect-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName @processScope } else { Write-Host "##[command]Connect-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -Credential $psCredential -Environment $environmentName @processScope" - $null = Connect-AzureRMAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName @processScope + $null = Connect-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName @processScope } } } @@ -324,7 +324,7 @@ function Initialize-AzureSubscription { $access_token = Get-MsiAccessToken $Endpoint try { Write-Host "##[command]Add-AzureRmAccount -AccessToken ****** -AccountId $accountId " - $null = Add-AzureRmAccount -AccessToken $access_token -AccountId $accountId + $null = Add-AzAccount -AccessToken $access_token -AccountId $accountId } catch { # Provide an additional, custom, credentials-related error message. Write-VstsTaskError -Message $_.Exception.Message @@ -369,10 +369,11 @@ function Set-CurrentAzureRMSubscription { if (Get-Command -Name "Select-AzureRmSubscription" -ErrorAction "SilentlyContinue") { Write-Host "##[command] Select-AzureRMSubscription -SubscriptionId $SubscriptionId $(Format-Splat $additional)" - $null = Select-AzureRMSubscription -SubscriptionId $SubscriptionId @additional + $null = Select-AzSubscription -Subscription $SubscriptionId @additional } else { Write-Host "##[command] Set-AzureRmContext -SubscriptionId $SubscriptionId $(Format-Splat $additional)" - $null = Set-AzureRmContext -SubscriptionId $SubscriptionId @additional + $null = Set-AzContext -Subscription $SubscriptionId @additional } } + diff --git a/Tasks/Common/VstsAzureHelpers_/Utility.ps1 b/Tasks/Common/VstsAzureHelpers_/Utility.ps1 index 3b49b5c2c923..3ef97d6da74d 100644 --- a/Tasks/Common/VstsAzureHelpers_/Utility.ps1 +++ b/Tasks/Common/VstsAzureHelpers_/Utility.ps1 @@ -585,21 +585,21 @@ function Add-AzureStackAzureRmEnvironment { GalleryEndpoint = $galleryEndpoint GraphEndpoint = $graphEndpoint GraphAudience = $graphAudience - StorageEndpointSuffix = $StorageEndpointSuffix + StorageEndpoint = $StorageEndpointSuffix AzureKeyVaultDnsSuffix = $AzureKeyVaultDnsSuffix AzureKeyVaultServiceEndpointResourceId = $AzureKeyVaultServiceEndpointResourceId EnableAdfsAuthentication = $aadAuthorityEndpoint.TrimEnd("/").EndsWith("/adfs", [System.StringComparison]::OrdinalIgnoreCase) } - $armEnv = Get-AzureRmEnvironment -Name $name + $armEnv = Get-AzEnvironment -Name $name if($armEnv -ne $null) { Write-Verbose "Updating AzureRm environment $name" -Verbose if (CmdletHasMember -cmdlet Remove-AzureRmEnvironment -memberName Force) { - Remove-AzureRmEnvironment -Name $name -Force | Out-Null + Remove-AzEnvironment -Name $name -Force | Out-Null } else { - Remove-AzureRmEnvironment -Name $name | Out-Null + Remove-AzEnvironment -Name $name | Out-Null } } else { @@ -607,7 +607,7 @@ function Add-AzureStackAzureRmEnvironment { } try { - return Add-AzureRmEnvironment @azureEnvironmentParams + return Add-AzEnvironment @azureEnvironmentParams } catch { Assert-TlsError -exception $_.Exception @@ -667,19 +667,20 @@ function Disconnect-UsingARMModule { if ((Get-Command -Name "Disconnect-AzureRmAccount" -ErrorAction "SilentlyContinue") -and (CmdletHasMember -cmdlet Disconnect-AzureRmAccount -memberName Scope)) { Write-Host "##[command]Disconnect-AzureRmAccount -Scope Process -ErrorAction Stop" - $null = Disconnect-AzureRmAccount -Scope Process -ErrorAction Stop + $null = Disconnect-AzAccount -Scope Process -ErrorAction Stop } elseif ((Get-Command -Name "Remove-AzureRmAccount" -ErrorAction "SilentlyContinue") -and (CmdletHasMember -cmdlet Remove-AzureRmAccount -memberName Scope)) { Write-Host "##[command]Remove-AzureRmAccount -Scope Process -ErrorAction Stop" - $null = Remove-AzureRmAccount -Scope Process -ErrorAction Stop + $null = Remove-AzAccount -Scope Process -ErrorAction Stop } elseif ((Get-Command -Name "Logout-AzureRmAccount" -ErrorAction "SilentlyContinue") -and (CmdletHasMember -cmdlet Logout-AzureRmAccount -memberName Scope)) { Write-Host "##[command]Logout-AzureRmAccount -Scope Process -ErrorAction Stop" - $null = Logout-AzureRmAccount -Scope Process -ErrorAction Stop + $null = Disconnect-AzAccount -Scope Process -ErrorAction Stop } if (Get-Command -Name "Clear-AzureRmContext" -ErrorAction "SilentlyContinue") { Write-Host "##[command]Clear-AzureRmContext -Scope Process -ErrorAction Stop" - $null = Clear-AzureRmContext -Scope Process -ErrorAction Stop + $null = Clear-AzContext -Scope Process -ErrorAction Stop } -} \ No newline at end of file +} + From e2d4aecf3f3bb06ee0f6c8d7bba0b1271aef13c1 Mon Sep 17 00:00:00 2001 From: Nikita Shkarupa Date: Fri, 5 Jan 2024 17:02:45 +0100 Subject: [PATCH 2/9] Fix padding after migration --- Tasks/Common/VstsAzureHelpers_/Utility.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/Common/VstsAzureHelpers_/Utility.ps1 b/Tasks/Common/VstsAzureHelpers_/Utility.ps1 index 3ef97d6da74d..dae9a0e2805b 100644 --- a/Tasks/Common/VstsAzureHelpers_/Utility.ps1 +++ b/Tasks/Common/VstsAzureHelpers_/Utility.ps1 @@ -585,7 +585,7 @@ function Add-AzureStackAzureRmEnvironment { GalleryEndpoint = $galleryEndpoint GraphEndpoint = $graphEndpoint GraphAudience = $graphAudience - StorageEndpoint = $StorageEndpointSuffix + StorageEndpoint = $StorageEndpointSuffix AzureKeyVaultDnsSuffix = $AzureKeyVaultDnsSuffix AzureKeyVaultServiceEndpointResourceId = $AzureKeyVaultServiceEndpointResourceId EnableAdfsAuthentication = $aadAuthorityEndpoint.TrimEnd("/").EndsWith("/adfs", [System.StringComparison]::OrdinalIgnoreCase) From 0935b9858afdeb785b13e15966788902dfaea38c Mon Sep 17 00:00:00 2001 From: Nikita Shkarupa Date: Fri, 5 Jan 2024 17:36:08 +0100 Subject: [PATCH 3/9] Bump tasks versions --- Tasks/AzureCloudPowerShellDeploymentV1/task.json | 2 +- Tasks/AzureCloudPowerShellDeploymentV1/task.loc.json | 2 +- Tasks/AzureFileCopyV1/task.json | 4 ++-- Tasks/AzureFileCopyV1/task.loc.json | 4 ++-- Tasks/AzureFileCopyV2/task.json | 4 ++-- Tasks/AzureFileCopyV2/task.loc.json | 4 ++-- Tasks/AzureFileCopyV3/task.json | 4 ++-- Tasks/AzureFileCopyV3/task.loc.json | 4 ++-- Tasks/AzureFileCopyV4/task.json | 4 ++-- Tasks/AzureFileCopyV4/task.loc.json | 4 ++-- Tasks/AzureFileCopyV5/task.json | 4 ++-- Tasks/AzureFileCopyV5/task.loc.json | 4 ++-- 12 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Tasks/AzureCloudPowerShellDeploymentV1/task.json b/Tasks/AzureCloudPowerShellDeploymentV1/task.json index 08ccbe6f0722..a143fd615400 100644 --- a/Tasks/AzureCloudPowerShellDeploymentV1/task.json +++ b/Tasks/AzureCloudPowerShellDeploymentV1/task.json @@ -16,7 +16,7 @@ "author": "Microsoft Corporation", "version": { "Major": 1, - "Minor": 226, + "Minor": 234, "Patch": 0 }, "demands": [ diff --git a/Tasks/AzureCloudPowerShellDeploymentV1/task.loc.json b/Tasks/AzureCloudPowerShellDeploymentV1/task.loc.json index 164b59b88705..ab56978980a6 100644 --- a/Tasks/AzureCloudPowerShellDeploymentV1/task.loc.json +++ b/Tasks/AzureCloudPowerShellDeploymentV1/task.loc.json @@ -16,7 +16,7 @@ "author": "Microsoft Corporation", "version": { "Major": 1, - "Minor": 226, + "Minor": 234, "Patch": 0 }, "demands": [ diff --git a/Tasks/AzureFileCopyV1/task.json b/Tasks/AzureFileCopyV1/task.json index 81b2cc315bc1..10265e188e55 100644 --- a/Tasks/AzureFileCopyV1/task.json +++ b/Tasks/AzureFileCopyV1/task.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 1, - "Minor": 231, - "Patch": 1 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" diff --git a/Tasks/AzureFileCopyV1/task.loc.json b/Tasks/AzureFileCopyV1/task.loc.json index 16f1427f1fb2..95cd57487120 100644 --- a/Tasks/AzureFileCopyV1/task.loc.json +++ b/Tasks/AzureFileCopyV1/task.loc.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 1, - "Minor": 231, - "Patch": 1 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" diff --git a/Tasks/AzureFileCopyV2/task.json b/Tasks/AzureFileCopyV2/task.json index 7b53f6fa3d3f..40c9ec9050b9 100644 --- a/Tasks/AzureFileCopyV2/task.json +++ b/Tasks/AzureFileCopyV2/task.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" diff --git a/Tasks/AzureFileCopyV2/task.loc.json b/Tasks/AzureFileCopyV2/task.loc.json index c70207ecb3bd..915b442cf554 100644 --- a/Tasks/AzureFileCopyV2/task.loc.json +++ b/Tasks/AzureFileCopyV2/task.loc.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" diff --git a/Tasks/AzureFileCopyV3/task.json b/Tasks/AzureFileCopyV3/task.json index a52d78534923..29b5ffea6340 100644 --- a/Tasks/AzureFileCopyV3/task.json +++ b/Tasks/AzureFileCopyV3/task.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 3, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" diff --git a/Tasks/AzureFileCopyV3/task.loc.json b/Tasks/AzureFileCopyV3/task.loc.json index dcd2330c9965..a6f97d416aca 100644 --- a/Tasks/AzureFileCopyV3/task.loc.json +++ b/Tasks/AzureFileCopyV3/task.loc.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 3, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" diff --git a/Tasks/AzureFileCopyV4/task.json b/Tasks/AzureFileCopyV4/task.json index a19ea319a245..9c73db35de9e 100644 --- a/Tasks/AzureFileCopyV4/task.json +++ b/Tasks/AzureFileCopyV4/task.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 4, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" diff --git a/Tasks/AzureFileCopyV4/task.loc.json b/Tasks/AzureFileCopyV4/task.loc.json index e9c72e811a3c..e4a424f032ae 100644 --- a/Tasks/AzureFileCopyV4/task.loc.json +++ b/Tasks/AzureFileCopyV4/task.loc.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 4, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" diff --git a/Tasks/AzureFileCopyV5/task.json b/Tasks/AzureFileCopyV5/task.json index 06794562cc86..cd47b6404b1f 100644 --- a/Tasks/AzureFileCopyV5/task.json +++ b/Tasks/AzureFileCopyV5/task.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 5, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" diff --git a/Tasks/AzureFileCopyV5/task.loc.json b/Tasks/AzureFileCopyV5/task.loc.json index d7816a031b08..2309f0aff8be 100644 --- a/Tasks/AzureFileCopyV5/task.loc.json +++ b/Tasks/AzureFileCopyV5/task.loc.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 5, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" From b5512f4a0f78e6ea8e22844f74d6ed5f0d295a3f Mon Sep 17 00:00:00 2001 From: Nikita Shkarupa Date: Fri, 12 Jan 2024 08:35:18 +0100 Subject: [PATCH 4/9] Add FF switch --- .../Utility.ps1 | 36 ++- Tasks/AzureFileCopyV1/AzureFileCopy.ps1 | 14 +- Tasks/AzureFileCopyV1/AzureUtilityGTE1.0.ps1 | 259 ++++++++++++++++-- .../AzureFileCopyV1/AzureUtilityGTE1.1.0.ps1 | 22 +- Tasks/AzureFileCopyV1/AzureUtilityLTE9.8.ps1 | 49 +++- Tasks/AzureFileCopyV2/AzureFileCopy.ps1 | 13 +- Tasks/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 | 247 +++++++++++++++-- .../AzureFileCopyV2/AzureUtilityGTE1.1.0.ps1 | 21 +- Tasks/AzureFileCopyV2/AzureUtilityLTE9.8.ps1 | 49 +++- Tasks/AzureFileCopyV3/AzureUtilityARM.ps1 | 197 +++++++++++-- Tasks/AzureFileCopyV5/AzureUtilityARM.ps1 | 193 +++++++++++-- .../InitializeAzureRMFunctions.ps1 | 95 ++++++- .../VstsAzureHelpers_/InitializeFunctions.ps1 | 138 +++++++++- Tasks/Common/VstsAzureHelpers_/Utility.ps1 | 121 ++++++-- 14 files changed, 1290 insertions(+), 164 deletions(-) diff --git a/Tasks/AzureCloudPowerShellDeploymentV1/Utility.ps1 b/Tasks/AzureCloudPowerShellDeploymentV1/Utility.ps1 index 2e2ae674db91..38a3c793b961 100644 --- a/Tasks/AzureCloudPowerShellDeploymentV1/Utility.ps1 +++ b/Tasks/AzureCloudPowerShellDeploymentV1/Utility.ps1 @@ -1,4 +1,8 @@ -function Get-SingleFile($files, $pattern) +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + +function Get-SingleFile($files, $pattern) { if ($files -is [system.array]) { @@ -57,12 +61,29 @@ function Get-AzureStoragePrimaryKey($storageAccount, [bool]$isArm) { if ($isArm) { - $storageAccountResource = Get-AzResource | where-object { $_.Name -eq $storageAccount -and $_.ResourceType -eq "Microsoft.Storage/storageAccounts" } + if ($featureFlags.retireAzureRM) + { + $storageAccountResource = Get-AzResource | where-object { $_.Name -eq $storageAccount -and $_.ResourceType -eq "Microsoft.Storage/storageAccounts" } + } + else + { + $storageAccountResource = Get-AzureRmResource | where-object { $_.Name -eq $storageAccount -and $_.ResourceType -eq "Microsoft.Storage/storageAccounts" } + } + if (!$storageAccountResource) { Write-Error -Message "Could not find resource $storageAccount that has a type of Microsoft.Storage/storageAccounts" } - $storageAccountKeys = Get-AzStorageAccountKey -ResourceGroupName $storageAccountResource.ResourceGroupName -Name $storageAccount + + if ($featureFlags.retireAzureRM) + { + $storageAccountKeys = Get-AzStorageAccountKey -ResourceGroupName $storageAccountResource.ResourceGroupName -Name $storageAccount + } + else + { + $storageAccountKeys = Get-AzureRmStorageAccountKey -ResourceGroupName $storageAccountResource.ResourceGroupName -Name $storageAccount + } + if(!$storageAccountKeys) { Write-Error -Message "Could not retrieve storage account keys from storage account resource $Storage" @@ -185,7 +206,14 @@ function Get-DiagnosticsExtensions($storageAccount, $extensionsPath, $storageAcc { try { - $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey + } Write-Host "New-AzureServiceDiagnosticsExtensionConfig -Role $role -StorageContext $StorageContext -DiagnosticsConfigurationPath $fullExtPath" $wadconfig = New-AzureServiceDiagnosticsExtensionConfig -Role $role -StorageContext $StorageContext -DiagnosticsConfigurationPath $fullExtPath } diff --git a/Tasks/AzureFileCopyV1/AzureFileCopy.ps1 b/Tasks/AzureFileCopyV1/AzureFileCopy.ps1 index 4617fb8528ee..0dc104988072 100644 --- a/Tasks/AzureFileCopyV1/AzureFileCopy.ps1 +++ b/Tasks/AzureFileCopyV1/AzureFileCopy.ps1 @@ -3,6 +3,10 @@ param() Trace-VstsEnteringInvocation $MyInvocation +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + # Get inputs for the task $connectedServiceNameSelector = Get-VstsInput -Name ConnectedServiceNameSelector -Require $sourcePath = Get-VstsInput -Name SourcePath -Require @@ -168,7 +172,15 @@ try { } if(-not [string]::IsNullOrEmpty($outputStorageContainerSASToken)) { - $storageContainerSaSToken = New-AzStorageContainerSASToken -Name $containerName -Context $storageContext -Permission r -ExpiryTime (Get-Date).AddHours($defaultSasTokenTimeOutInHours) + if ($featureFlags.retireAzureRM) + { + $storageContainerSaSToken = New-AzStorageContainerSASToken -Name $containerName -Context $storageContext -Permission r -ExpiryTime (Get-Date).AddHours($defaultSasTokenTimeOutInHours) + } + else + { + $storageContainerSaSToken = New-AzureStorageContainerSASToken -Container $containerName -Context $storageContext -Permission r -ExpiryTime (Get-Date).AddHours($defaultSasTokenTimeOutInHours) + } + Write-Host "##vso[task.setvariable variable=$outputStorageContainerSASToken;]$storageContainerSasToken" } diff --git a/Tasks/AzureFileCopyV1/AzureUtilityGTE1.0.ps1 b/Tasks/AzureFileCopyV1/AzureUtilityGTE1.0.ps1 index 6f92c3a0c360..66ad08cd5171 100644 --- a/Tasks/AzureFileCopyV1/AzureUtilityGTE1.0.ps1 +++ b/Tasks/AzureFileCopyV1/AzureUtilityGTE1.0.ps1 @@ -1,5 +1,9 @@ # This file implements IAzureUtility for Azure PowerShell version >= 1.0.0 +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureStorageKeyFromRDFE { param([string]$storageAccountName, @@ -26,11 +30,26 @@ function Get-AzureStorageAccountResourceGroupName 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-AzResource -ErrorAction Stop) | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + if ($featureFlags.retireAzureRM) + { + $azureStorageAccountResourceDetails = (Get-AzResource -ErrorAction Stop) | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + } + else + { + $azureStorageAccountResourceDetails = (Get-AzureRMResource -ErrorAction Stop) | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + } + } else { - $azureStorageAccountResourceDetails = (Get-AzResource -ErrorAction Stop) | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.ResourceName -eq $storageAccountName)} + if ($featureFlags.retireAzureRM) + { + $azureStorageAccountResourceDetails = (Get-AzResource -ErrorAction Stop) | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.ResourceName -eq $storageAccountName)} + } + else + { + $azureStorageAccountResourceDetails = (Get-AzureRMResource -ErrorAction Stop) | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.ResourceName -eq $storageAccountName)} + } } Write-Verbose "[Azure Call]Retrieved resource details successfully for azure storage account resource: $storageAccountName with resource type: $ARMStorageAccountResourceType" @@ -58,7 +77,14 @@ function Get-AzureStorageKeyFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage key for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageKeyDetails = Get-AzStorageAccountKey -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageKeyDetails = Get-AzStorageAccountKey -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } + else + { + $storageKeyDetails = Get-AzureRMStorageAccountKey -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } $storageKey = $storageKeyDetails.Key1 Write-Verbose "[Azure Call]Retrieved storage key successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -74,7 +100,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -110,7 +143,14 @@ function Get-AzureBlobStorageEndpointFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage account endpoint for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageAccountInfo = Get-AzStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageAccountInfo = Get-AzStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } + else + { + $storageAccountInfo = Get-AzureRMStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } $storageAccountEnpoint = $storageAccountInfo.PrimaryEndpoints[0].blob Write-Verbose "[Azure Call]Retrieved storage account endpoint successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -147,7 +187,14 @@ function Get-AzureStorageAccountTypeFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage account type for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageAccountInfo = Get-AzStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageAccountInfo = Get-AzStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } + else + { + $storageAccountInfo = Get-AzureRMStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } $storageAccountType = $storageAccountInfo.AccountType Write-Verbose "[Azure Call]Retrieved storage account type successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -168,9 +215,23 @@ function Create-AzureContainer Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" if ($isPremiumStorage) { - $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } } else { - $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } @@ -186,7 +247,14 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -273,7 +341,14 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -356,17 +431,39 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -375,15 +472,36 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -409,7 +527,14 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInHours hours" - $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + } Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -424,7 +549,14 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } + else + { + $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -443,7 +575,14 @@ function Get-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName)) { Write-Host (Get-VstsLocString -Key "AFC_GetCustomScriptExtension" -ArgumentList $name, $vmName) - $customScriptExtension = Get-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $customScriptExtension = Get-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -ErrorAction Stop -Verbose + } + else + { + $customScriptExtension = Get-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -463,7 +602,14 @@ function Set-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) - $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -482,7 +628,14 @@ function Remove-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_RemoveCustomScriptExtension" -ArgumentList $name, $vmName) - $response = Remove-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -Force -ErrorAction SilentlyContinue -Verbose + if ($featureFlags.retireAzureRM) + { + $response = Remove-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -Force -ErrorAction SilentlyContinue -Verbose + } + else + { + $response = Remove-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -Force -ErrorAction SilentlyContinue -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_RemoveCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -499,7 +652,14 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + if ($featureFlags.retireAzureRM) + { + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } + else + { + $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -521,7 +681,14 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -559,7 +726,14 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + if ($featureFlags.retireAzureRM) + { + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } + else + { + $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -576,11 +750,25 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + if ($featureFlags.retireAzureRM) + { + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } + else + { + $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + if ($featureFlags.retireAzureRM) + { + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } + else + { + $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -591,7 +779,14 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" @@ -620,8 +815,14 @@ function Remove-NetworkSecurityRuleConfig foreach($securityGroup in $securityGroups) { Write-Verbose "[Azure Call]Removing the Rule $ruleName" - $result = Remove-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName | Set-AzNetworkSecurityGroup + if ($featureFlags.retireAzureRM) + { + $result = Remove-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName | Set-AzNetworkSecurityGroup + } + else + { + $result = Remove-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName | Set-AzureRmNetworkSecurityGroup + } Write-Verbose "[Azure Call]Removed the Rule $ruleName" } } - diff --git a/Tasks/AzureFileCopyV1/AzureUtilityGTE1.1.0.ps1 b/Tasks/AzureFileCopyV1/AzureUtilityGTE1.1.0.ps1 index efce751dbaa7..a4d4ece4473f 100644 --- a/Tasks/AzureFileCopyV1/AzureUtilityGTE1.1.0.ps1 +++ b/Tasks/AzureFileCopyV1/AzureUtilityGTE1.1.0.ps1 @@ -2,6 +2,10 @@ . "$PSScriptRoot/AzureUtilityGTE1.0.ps1" +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureRMVMsInResourceGroup { param([string]$resourceGroupName) @@ -11,7 +15,14 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -41,7 +52,14 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { diff --git a/Tasks/AzureFileCopyV1/AzureUtilityLTE9.8.ps1 b/Tasks/AzureFileCopyV1/AzureUtilityLTE9.8.ps1 index ca7d36df7ff1..6d44eb076d6b 100644 --- a/Tasks/AzureFileCopyV1/AzureUtilityLTE9.8.ps1 +++ b/Tasks/AzureFileCopyV1/AzureUtilityLTE9.8.ps1 @@ -1,5 +1,9 @@ # This file implements IAzureUtility for Azure PowerShell version <= 0.9.8 +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureStorageKeyFromRDFE { param([string]$storageAccountName, @@ -78,7 +82,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -180,11 +191,25 @@ function Create-AzureContainer Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" if ($isPremiumStorage) { - $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } } else { - $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } @@ -200,7 +225,14 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -376,7 +408,14 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInHours hours" - $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + } Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken diff --git a/Tasks/AzureFileCopyV2/AzureFileCopy.ps1 b/Tasks/AzureFileCopyV2/AzureFileCopy.ps1 index 401f34528473..b69f23805337 100644 --- a/Tasks/AzureFileCopyV2/AzureFileCopy.ps1 +++ b/Tasks/AzureFileCopyV2/AzureFileCopy.ps1 @@ -3,6 +3,10 @@ param() Trace-VstsEnteringInvocation $MyInvocation +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + # Get inputs for the task $connectedServiceNameSelector = Get-VstsInput -Name ConnectedServiceNameSelector -Require $sourcePath = Get-VstsInput -Name SourcePath -Require @@ -211,7 +215,14 @@ try { } if(-not [string]::IsNullOrEmpty($outputStorageContainerSASToken)) { - $storageContainerSaSToken = New-AzStorageContainerSASToken -Name $containerName -Context $storageContext -Permission rl -ExpiryTime (Get-Date).AddHours($defaultSasTokenTimeOutInHours) + if ($featureFlags.retireAzureRM) + { + $storageContainerSaSToken = New-AzStorageContainerSASToken -Name $containerName -Context $storageContext -Permission rl -ExpiryTime (Get-Date).AddHours($defaultSasTokenTimeOutInHours) + } + else + { + $storageContainerSaSToken = New-AzureStorageContainerSASToken -Container $containerName -Context $storageContext -Permission rl -ExpiryTime (Get-Date).AddHours($defaultSasTokenTimeOutInHours) + } Write-Host "##vso[task.setvariable variable=$outputStorageContainerSASToken;]$storageContainerSasToken" } diff --git a/Tasks/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 b/Tasks/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 index 4564ce2b43b2..67408989a140 100644 --- a/Tasks/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 +++ b/Tasks/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 @@ -1,5 +1,9 @@ # This file implements IAzureUtility for Azure PowerShell version >= 1.0.0 +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureStorageKeyFromRDFE { param([string]$storageAccountName, @@ -24,7 +28,14 @@ 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" - $azureStorageAccountResourceDetails = Get-AzResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + if ($featureFlags.retireAzureRM) + { + $azureStorageAccountResourceDetails = Get-AzResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + } + else + { + $azureStorageAccountResourceDetails = Get-AzureRmResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + } Write-Verbose "[Azure Call]Retrieved resource details successfully for azure storage account resource: $storageAccountName with resource type: $ARMStorageAccountResourceType" $azureResourceGroupName = $azureStorageAccountResourceDetails.ResourceGroupName @@ -50,7 +61,14 @@ function Get-AzureStorageKeyFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage key for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageKeyDetails = Get-AzStorageAccountKey -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageKeyDetails = Get-AzStorageAccountKey -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } + else + { + $storageKeyDetails = Get-AzureRMStorageAccountKey -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } $storageKey = $storageKeyDetails.Key1 Write-Verbose "[Azure Call]Retrieved storage key successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -66,7 +84,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -102,7 +127,14 @@ function Get-AzureBlobStorageEndpointFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage account endpoint for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageAccountInfo = Get-AzStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageAccountInfo = Get-AzStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } + else + { + $storageAccountInfo = Get-AzureRMStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } $storageAccountEnpoint = $storageAccountInfo.PrimaryEndpoints[0].blob Write-Verbose "[Azure Call]Retrieved storage account endpoint successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -139,7 +171,14 @@ function Get-AzureStorageAccountTypeFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage account type for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageAccountInfo = Get-AzStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageAccountInfo = Get-AzStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } + else + { + $storageAccountInfo = Get-AzureRMStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } $storageAccountType = $storageAccountInfo.AccountType Write-Verbose "[Azure Call]Retrieved storage account type successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -160,9 +199,23 @@ function Create-AzureContainer Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" if ($isPremiumStorage) { - $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } } else { - $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } @@ -178,7 +231,14 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -265,7 +325,14 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -348,17 +415,38 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -367,15 +455,36 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -401,7 +510,14 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInHours hours" - $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + } Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -416,7 +532,14 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } + else + { + $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -435,7 +558,14 @@ function Get-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName)) { Write-Host (Get-VstsLocString -Key "AFC_GetCustomScriptExtension" -ArgumentList $name, $vmName) - $customScriptExtension = Get-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $customScriptExtension = Get-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -ErrorAction Stop -Verbose + } + else + { + $customScriptExtension = Get-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -455,7 +585,14 @@ function Set-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) - $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -474,7 +611,14 @@ function Remove-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_RemoveCustomScriptExtension" -ArgumentList $name, $vmName) - $response = Remove-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -Force -ErrorAction SilentlyContinue -Verbose + if ($featureFlags.retireAzureRM) + { + $response = Remove-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -Force -ErrorAction SilentlyContinue -Verbose + } + else + { + $response = Remove-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -Force -ErrorAction SilentlyContinue -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_RemoveCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -491,7 +635,14 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + if ($featureFlags.retireAzureRM) + { + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } + else + { + $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -513,7 +664,14 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -551,7 +709,14 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + if ($featureFlags.retireAzureRM) + { + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } + else + { + $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -568,11 +733,25 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + if ($featureFlags.retireAzureRM) + { + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } + else + { + $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + if ($featureFlags.retireAzureRM) + { + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } + else + { + $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -583,7 +762,14 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" @@ -612,7 +798,14 @@ function Remove-NetworkSecurityRuleConfig foreach($securityGroup in $securityGroups) { Write-Verbose "[Azure Call]Removing the Rule $ruleName" - $result = Remove-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName | Set-AzNetworkSecurityGroup + if ($featureFlags.retireAzureRM) + { + $result = Remove-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName | Set-AzNetworkSecurityGroup + } + else + { + $result = Remove-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName | Set-AzureRmNetworkSecurityGroup + } Write-Verbose "[Azure Call]Removed the Rule $ruleName" } } diff --git a/Tasks/AzureFileCopyV2/AzureUtilityGTE1.1.0.ps1 b/Tasks/AzureFileCopyV2/AzureUtilityGTE1.1.0.ps1 index efce751dbaa7..b00250086d92 100644 --- a/Tasks/AzureFileCopyV2/AzureUtilityGTE1.1.0.ps1 +++ b/Tasks/AzureFileCopyV2/AzureUtilityGTE1.1.0.ps1 @@ -2,6 +2,10 @@ . "$PSScriptRoot/AzureUtilityGTE1.0.ps1" +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureRMVMsInResourceGroup { param([string]$resourceGroupName) @@ -11,7 +15,13 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -41,7 +51,14 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { diff --git a/Tasks/AzureFileCopyV2/AzureUtilityLTE9.8.ps1 b/Tasks/AzureFileCopyV2/AzureUtilityLTE9.8.ps1 index f297872b7500..a8f7f9e869a7 100644 --- a/Tasks/AzureFileCopyV2/AzureUtilityLTE9.8.ps1 +++ b/Tasks/AzureFileCopyV2/AzureUtilityLTE9.8.ps1 @@ -1,5 +1,9 @@ # This file implements IAzureUtility for Azure PowerShell version <= 0.9.8 +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureStorageKeyFromRDFE { param([string]$storageAccountName, @@ -80,7 +84,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -182,11 +193,25 @@ function Create-AzureContainer Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" if ($isPremiumStorage) { - $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } } else { - $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } @@ -202,7 +227,14 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -378,7 +410,14 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInHours hours" - $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + } Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken diff --git a/Tasks/AzureFileCopyV3/AzureUtilityARM.ps1 b/Tasks/AzureFileCopyV3/AzureUtilityARM.ps1 index ea86e3c0d156..f89fefb0776d 100644 --- a/Tasks/AzureFileCopyV3/AzureUtilityARM.ps1 +++ b/Tasks/AzureFileCopyV3/AzureUtilityARM.ps1 @@ -2,6 +2,10 @@ . "$PSScriptRoot/AzureUtilityRest.ps1" +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureStorageAccountResourceGroupName { param([string]$storageAccountName) @@ -10,7 +14,14 @@ 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" - $azureStorageAccountResourceDetails = Get-AzResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + if ($featureFlags.retireAzureRM) + { + $azureStorageAccountResourceDetails = Get-AzResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + } + else + { + $azureStorageAccountResourceDetails = Get-AzureRmResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + } Write-Verbose "[Azure Call]Retrieved resource details successfully for azure storage account resource: $storageAccountName with resource type: $ARMStorageAccountResourceType" $azureResourceGroupName = $azureStorageAccountResourceDetails.ResourceGroupName @@ -33,7 +44,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -53,9 +71,25 @@ function Create-AzureContainer Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" if ($isPremiumStorage) { - $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop - } else { - $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + } + else + { + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } @@ -71,7 +105,14 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -85,7 +126,14 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -112,17 +160,38 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -131,15 +200,36 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -165,7 +255,14 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInMinutes minutes" - $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -180,7 +277,14 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } + else + { + $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -201,7 +305,14 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { @@ -224,7 +335,14 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + if ($featureFlags.retireAzureRM) + { + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } + else + { + $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -246,7 +364,14 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -284,7 +409,14 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + if ($featureFlags.retireAzureRM) + { + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } + else + { + $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -301,11 +433,25 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + if ($featureFlags.retireAzureRM) + { + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } + else + { + $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + if ($featureFlags.retireAzureRM) + { + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } + else + { + $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -316,7 +462,14 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" diff --git a/Tasks/AzureFileCopyV5/AzureUtilityARM.ps1 b/Tasks/AzureFileCopyV5/AzureUtilityARM.ps1 index bcabca2f9c9e..bc0b524ddd79 100644 --- a/Tasks/AzureFileCopyV5/AzureUtilityARM.ps1 +++ b/Tasks/AzureFileCopyV5/AzureUtilityARM.ps1 @@ -2,6 +2,10 @@ . "$PSScriptRoot/AzureUtilityRest.ps1" +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureStorageAccountResourceGroupName { param([string]$storageAccountName) @@ -10,7 +14,14 @@ 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" - $azureStorageAccountResourceDetails = Get-AzStorageAccount -ErrorAction Stop | Where-Object { $_.StorageAccountName -eq $storageAccountName } + if ($featureFlags.retireAzureRM) + { + $azureStorageAccountResourceDetails = Get-AzStorageAccount -ErrorAction Stop | Where-Object { $_.StorageAccountName -eq $storageAccountName } + } + else + { + $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 @@ -33,7 +44,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -50,7 +68,14 @@ function Create-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" - $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } } @@ -69,7 +94,14 @@ function Get-AzureContainer Write-Verbose "[Azure Call]Getting container: $containerName in storage account: $storageAccountName" try { - $container = Get-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = Get-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = Get-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } } catch { @@ -90,7 +122,15 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -104,7 +144,14 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -131,17 +178,38 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -150,15 +218,36 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -184,6 +273,14 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInMinutes minutes" + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" @@ -199,7 +296,14 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } + else + { + $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -220,7 +324,14 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { @@ -243,7 +354,14 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + if ($featureFlags.retireAzureRM) + { + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } + else + { + $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -265,7 +383,14 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -303,7 +428,14 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + if ($featureFlags.retireAzureRM) + { + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } + else + { + $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -320,11 +452,25 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + if ($featureFlags.retireAzureRM) + { + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } + else + { + $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + if ($featureFlags.retireAzureRM) + { + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } + else + { + $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -335,7 +481,14 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" diff --git a/Tasks/Common/VstsAzureHelpers_/InitializeAzureRMFunctions.ps1 b/Tasks/Common/VstsAzureHelpers_/InitializeAzureRMFunctions.ps1 index fb4a1d7df452..90f75b003b56 100644 --- a/Tasks/Common/VstsAzureHelpers_/InitializeAzureRMFunctions.ps1 +++ b/Tasks/Common/VstsAzureHelpers_/InitializeAzureRMFunctions.ps1 @@ -1,6 +1,10 @@ # Dot source Utility functions. . $PSScriptRoot/Utility.ps1 +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Initialize-AzureRMModule { [CmdletBinding()] param( @@ -80,9 +84,23 @@ function Initialize-AzureRMSubscription { # Clear context if ($Endpoint.Auth.Scheme -eq 'ServicePrincipal' -and (Get-Command -Name "Clear-AzureRmContext" -ErrorAction "SilentlyContinue")) { Write-Host "##[command]Clear-AzureRmContext -Scope Process" - $null = Clear-AzContext -Scope Process + if ($featureFlags.retireAzureRM) + { + $null = Clear-AzContext -Scope Process + } + else + { + $null = Clear-AzureRmContext -Scope Process + } Write-Host "##[command]Clear-AzureRmContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue" - $null = Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + $null = Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue + } + else + { + $null = Clear-AzureRmContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue + } } $environmentName = "AzureCloud" @@ -121,32 +139,75 @@ function Initialize-AzureRMSubscription { if ($Endpoint.Auth.Parameters.AuthenticationType -eq "SPNCertificate") { Write-Host "##[command]Add-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -CertificateThumbprint ****** -ApplicationId $($Endpoint.Auth.Parameters.ServicePrincipalId) -EnvironmentName $environmentName" - $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName + if ($featureFlags.retireAzureRM) + { + $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName + } + else + { + $null = Add-AzureRmAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -EnvironmentName $environmentName + } } else { Write-Host "##[command]Add-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -Credential $psCredential -EnvironmentName $environmentName" - $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName + + if ($featureFlags.retireAzureRM) + { + $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName + } + else + { + $null = Add-AzureRMAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -EnvironmentName $environmentName + } } } else { if ($Endpoint.Auth.Parameters.AuthenticationType -eq "SPNCertificate") { Write-Host "##[command]Add-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -CertificateThumbprint ****** -ApplicationId $($Endpoint.Auth.Parameters.ServicePrincipalId) -Environment $environmentName" - $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName + if ($featureFlags.retireAzureRM) + { + $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName + } + else + { + $null = Add-AzureRmAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName + } } else { Write-Host "##[command]Add-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -Credential $psCredential -Environment $environmentName" - $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName + if ($featureFlags.retireAzureRM) + { + $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName + } + else + { + $null = Add-AzureRMAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName + } } } } else { if ($Endpoint.Auth.Parameters.AuthenticationType -eq "SPNCertificate") { Write-Host "##[command]Connect-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -CertificateThumbprint ****** -ApplicationId $($Endpoint.Auth.Parameters.ServicePrincipalId) -Environment $environmentName" - $null = Connect-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName + if ($featureFlags.retireAzureRM) + { + $null = Connect-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName + } + else + { + $null = Connect-AzureRmAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName + } } else { Write-Host "##[command]Connect-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -Credential $psCredential -Environment $environmentName" - $null = Connect-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName + if ($featureFlags.retireAzureRM) + { + $null = Connect-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName + } + else + { + $null = Connect-AzureRMAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName + } } } } @@ -172,7 +233,14 @@ function Initialize-AzureRMSubscription { $access_token = Get-MsiAccessToken $Endpoint try { Write-Host "##[command]Add-AzureRmAccount -AccessToken ****** -AccountId $accountId " - $null = Add-AzAccount -AccessToken $access_token -AccountId $accountId + if ($featureFlags.retireAzureRM) + { + $null = Add-AzAccount -AccessToken $access_token -AccountId $accountId + } + else + { + $null = Add-AzureRmAccount -AccessToken $access_token -AccountId $accountId + } } catch { # Provide an additional, custom, credentials-related error message. Write-VstsTaskError -Message $_.Exception.Message @@ -196,7 +264,14 @@ function Set-CurrentAzureRMSubscriptionV2 { if ($TenantId) { $additional['TenantId'] = $TenantId } Write-Host "##[command] Set-AzureRmContext -SubscriptionId $SubscriptionId $(Format-Splat $additional)" - $null = Set-AzContext -Subscription $SubscriptionId @additional + if ($featureFlags.retireAzureRM) + { + $null = Set-AzContext -Subscription $SubscriptionId @additional + } + else + { + $null = Set-AzureRmContext -SubscriptionId $SubscriptionId @additional + } } diff --git a/Tasks/Common/VstsAzureHelpers_/InitializeFunctions.ps1 b/Tasks/Common/VstsAzureHelpers_/InitializeFunctions.ps1 index f67b968cb960..f7733c2c5173 100644 --- a/Tasks/Common/VstsAzureHelpers_/InitializeFunctions.ps1 +++ b/Tasks/Common/VstsAzureHelpers_/InitializeFunctions.ps1 @@ -1,3 +1,6 @@ +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} function Initialize-AzureSubscription { [CmdletBinding()] @@ -13,14 +16,28 @@ function Initialize-AzureSubscription { # Clear context only for Azure RM if ($Endpoint.Auth.Scheme -eq 'ServicePrincipal' -and !$script:azureModule -and (Get-Command -Name "Clear-AzureRmContext" -ErrorAction "SilentlyContinue")) { Write-Host "##[command]Clear-AzureRmContext -Scope Process" - $null = Clear-AzContext -Scope Process + if ($featureFlags.retireAzureRM) + { + $null = Clear-AzContext -Scope Process + } + else + { + $null = Clear-AzureRmContext -Scope Process + } } if (Get-Command -Name "Disable-AzureRmContextAutosave" -ErrorAction "SilentlyContinue") { try { Write-Host "##[command]Disable-AzureRmContextAutosave -ErrorAction Stop" - $null = Disable-AzContextAutosave -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $null = Disable-AzContextAutosave -ErrorAction Stop + } + else + { + $null = Disable-AzureRmContextAutosave -ErrorAction Stop + } } catch { $message = $_.Exception.Message @@ -108,10 +125,24 @@ function Initialize-AzureSubscription { try { if (Get-Command -Name "Add-AzureRmAccount" -ErrorAction "SilentlyContinue") { Write-Host "##[command] Add-AzureRMAccount -Credential $psCredential" - $null = Add-AzAccount -Credential $psCredential + if ($featureFlags.retireAzureRM) + { + $null = Add-AzAccount -Credential $psCredential + } + else + { + $null = Add-AzureRMAccount -Credential $psCredential + } } else { Write-Host "##[command] Connect-AzureRMAccount -Credential $psCredential" - $null = Connect-AzAccount -Credential $psCredential + if ($featureFlags.retireAzureRM) + { + $null = Connect-AzAccount -Credential $psCredential + } + else + { + $null = Connect-AzureRMAccount -Credential $psCredential + } } } catch { # Provide an additional, custom, credentials-related error message. @@ -198,21 +229,49 @@ function Initialize-AzureSubscription { if ($Endpoint.Auth.Parameters.AuthenticationType -eq "SPNCertificate") { Write-Host "##[command]Add-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -CertificateThumbprint ****** -ApplicationId $($Endpoint.Auth.Parameters.ServicePrincipalId) -EnvironmentName $environmentName @processScope" - $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName @processScope + if ($featureFlags.retireAzureRM) + { + $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName @processScope + } + else + { + $null = Add-AzureRmAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -EnvironmentName $environmentName @processScope + } } else { Write-Host "##[command]Add-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -Credential $psCredential -EnvironmentName $environmentName @processScope" - $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName @processScope + if ($featureFlags.retireAzureRM) + { + $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName @processScope + } + else + { + $null = Add-AzureRMAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -EnvironmentName $environmentName @processScope + } } } else { if ($Endpoint.Auth.Parameters.AuthenticationType -eq "SPNCertificate") { Write-Host "##[command]Add-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -CertificateThumbprint ****** -ApplicationId $($Endpoint.Auth.Parameters.ServicePrincipalId) -Environment $environmentName @processScope" - $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName @processScope + if ($featureFlags.retireAzureRM) + { + $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName @processScope + } + else + { + $null = Add-AzureRmAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName @processScope + } } else { Write-Host "##[command]Add-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -Credential $psCredential -Environment $environmentName @processScope" - $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName @processScope + if ($featureFlags.retireAzureRM) + { + $null = Add-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName @processScope + } + else + { + $null = Add-AzureRMAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName @processScope + } } } } @@ -228,11 +287,25 @@ function Initialize-AzureSubscription { if ($Endpoint.Auth.Parameters.AuthenticationType -eq "SPNCertificate") { Write-Host "##[command]Connect-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -CertificateThumbprint ****** -ApplicationId $($Endpoint.Auth.Parameters.ServicePrincipalId) -Environment $environmentName @processScope" - $null = Connect-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName @processScope + if ($featureFlags.retireAzureRM) + { + $null = Connect-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName @processScope + } + else + { + $null = Connect-AzureRmAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName @processScope + } } else { Write-Host "##[command]Connect-AzureRMAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -Credential $psCredential -Environment $environmentName @processScope" - $null = Connect-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName @processScope + if ($featureFlags.retireAzureRM) + { + $null = Connect-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName @processScope + } + else + { + $null = Connect-AzureRMAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName @processScope + } } } } @@ -294,11 +367,25 @@ function Initialize-AzureSubscription { if ($Endpoint.Auth.Parameters.AuthenticationType -eq "SPNCertificate") { Write-Host "##[command]Connect-AzAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -CertificateThumbprint ****** -ApplicationId $($Endpoint.Auth.Parameters.ServicePrincipalId) -Environment $environmentName @processScope" - $null = Connect-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName @processScope + if ($featureFlags.retireAzureRM) + { + $null = Connect-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName @processScope + } + else + { + $null = Connect-AzureRmAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -CertificateThumbprint $servicePrincipalCertificate.Thumbprint -ApplicationId $Endpoint.Auth.Parameters.ServicePrincipalId -Environment $environmentName @processScope + } } else { Write-Host "##[command]Connect-AzAccount -ServicePrincipal -Tenant $($Endpoint.Auth.Parameters.TenantId) -Credential $psCredential -Environment $environmentName @processScope" - $null = Connect-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName @processScope + if ($featureFlags.retireAzureRM) + { + $null = Connect-AzAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName @processScope + } + else + { + $null = Connect-AzureRMAccount -ServicePrincipal -Tenant $Endpoint.Auth.Parameters.TenantId -Credential $psCredential -Environment $environmentName @processScope + } } } } @@ -324,7 +411,14 @@ function Initialize-AzureSubscription { $access_token = Get-MsiAccessToken $Endpoint try { Write-Host "##[command]Add-AzureRmAccount -AccessToken ****** -AccountId $accountId " - $null = Add-AzAccount -AccessToken $access_token -AccountId $accountId + if ($featureFlags.retireAzureRM) + { + $null = Add-AzAccount -AccessToken $access_token -AccountId $accountId + } + else + { + $null = Add-AzureRmAccount -AccessToken $access_token -AccountId $accountId + } } catch { # Provide an additional, custom, credentials-related error message. Write-VstsTaskError -Message $_.Exception.Message @@ -369,11 +463,25 @@ function Set-CurrentAzureRMSubscription { if (Get-Command -Name "Select-AzureRmSubscription" -ErrorAction "SilentlyContinue") { Write-Host "##[command] Select-AzureRMSubscription -SubscriptionId $SubscriptionId $(Format-Splat $additional)" - $null = Select-AzSubscription -Subscription $SubscriptionId @additional + if ($featureFlags.retireAzureRM) + { + $null = Select-AzSubscription -Subscription $SubscriptionId @additional + } + else + { + $null = Select-AzureRMSubscription -SubscriptionId $SubscriptionId @additional + } } else { Write-Host "##[command] Set-AzureRmContext -SubscriptionId $SubscriptionId $(Format-Splat $additional)" - $null = Set-AzContext -Subscription $SubscriptionId @additional + if ($featureFlags.retireAzureRM) + { + $null = Set-AzContext -Subscription $SubscriptionId @additional + } + else + { + $null = Set-AzureRmContext -SubscriptionId $SubscriptionId @additional + } } } diff --git a/Tasks/Common/VstsAzureHelpers_/Utility.ps1 b/Tasks/Common/VstsAzureHelpers_/Utility.ps1 index dae9a0e2805b..546fee8562d1 100644 --- a/Tasks/Common/VstsAzureHelpers_/Utility.ps1 +++ b/Tasks/Common/VstsAzureHelpers_/Utility.ps1 @@ -1,4 +1,8 @@ -function Add-Certificate { +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + +function Add-Certificate { [CmdletBinding()] param( [Parameter(Mandatory=$true)] $Endpoint, @@ -577,29 +581,69 @@ function Add-AzureStackAzureRmEnvironment { $galleryEndpoint = $Endpoint.data.galleryUrl } - $azureEnvironmentParams = @{ - Name = $Name - ActiveDirectoryEndpoint = $activeDirectoryEndpoint - ActiveDirectoryServiceEndpointResourceId = $activeDirectoryServiceEndpointResourceId - ResourceManagerEndpoint = $ResourceManagerEndpoint - GalleryEndpoint = $galleryEndpoint - GraphEndpoint = $graphEndpoint - GraphAudience = $graphAudience - StorageEndpoint = $StorageEndpointSuffix - AzureKeyVaultDnsSuffix = $AzureKeyVaultDnsSuffix - AzureKeyVaultServiceEndpointResourceId = $AzureKeyVaultServiceEndpointResourceId - EnableAdfsAuthentication = $aadAuthorityEndpoint.TrimEnd("/").EndsWith("/adfs", [System.StringComparison]::OrdinalIgnoreCase) + if ($featureFlags.retireAzureRM) + { + $azureEnvironmentParams = @{ + Name = $Name + ActiveDirectoryEndpoint = $activeDirectoryEndpoint + ActiveDirectoryServiceEndpointResourceId = $activeDirectoryServiceEndpointResourceId + ResourceManagerEndpoint = $ResourceManagerEndpoint + GalleryEndpoint = $galleryEndpoint + GraphEndpoint = $graphEndpoint + GraphAudience = $graphAudience + StorageEndpoint = $StorageEndpointSuffix + AzureKeyVaultDnsSuffix = $AzureKeyVaultDnsSuffix + AzureKeyVaultServiceEndpointResourceId = $AzureKeyVaultServiceEndpointResourceId + EnableAdfsAuthentication = $aadAuthorityEndpoint.TrimEnd("/").EndsWith("/adfs", [System.StringComparison]::OrdinalIgnoreCase) + } + } + else + { + $azureEnvironmentParams = @{ + Name = $Name + ActiveDirectoryEndpoint = $activeDirectoryEndpoint + ActiveDirectoryServiceEndpointResourceId = $activeDirectoryServiceEndpointResourceId + ResourceManagerEndpoint = $ResourceManagerEndpoint + GalleryEndpoint = $galleryEndpoint + GraphEndpoint = $graphEndpoint + GraphAudience = $graphAudience + StorageEndpointSuffix = $StorageEndpointSuffix + AzureKeyVaultDnsSuffix = $AzureKeyVaultDnsSuffix + AzureKeyVaultServiceEndpointResourceId = $AzureKeyVaultServiceEndpointResourceId + EnableAdfsAuthentication = $aadAuthorityEndpoint.TrimEnd("/").EndsWith("/adfs", [System.StringComparison]::OrdinalIgnoreCase) + } } - $armEnv = Get-AzEnvironment -Name $name + if ($featureFlags.retireAzureRM) + { + $armEnv = Get-AzEnvironment -Name $name + } + else + { + $armEnv = Get-AzureRmEnvironment -Name $name + } if($armEnv -ne $null) { Write-Verbose "Updating AzureRm environment $name" -Verbose if (CmdletHasMember -cmdlet Remove-AzureRmEnvironment -memberName Force) { - Remove-AzEnvironment -Name $name -Force | Out-Null + if ($featureFlags.retireAzureRM) + { + Remove-AzEnvironment -Name $name -Force | Out-Null + } + else + { + Remove-AzureRmEnvironment -Name $name -Force | Out-Null + } } else { - Remove-AzEnvironment -Name $name | Out-Null + if ($featureFlags.retireAzureRM) + { + Remove-AzEnvironment -Name $name | Out-Null + } + else + { + Remove-AzureRmEnvironment -Name $name | Out-Null + } } } else { @@ -607,7 +651,14 @@ function Add-AzureStackAzureRmEnvironment { } try { - return Add-AzEnvironment @azureEnvironmentParams + if ($featureFlags.retireAzureRM) + { + return Add-AzEnvironment @azureEnvironmentParams + } + else + { + return Add-AzureRmEnvironment @azureEnvironmentParams + } } catch { Assert-TlsError -exception $_.Exception @@ -667,20 +718,48 @@ function Disconnect-UsingARMModule { if ((Get-Command -Name "Disconnect-AzureRmAccount" -ErrorAction "SilentlyContinue") -and (CmdletHasMember -cmdlet Disconnect-AzureRmAccount -memberName Scope)) { Write-Host "##[command]Disconnect-AzureRmAccount -Scope Process -ErrorAction Stop" - $null = Disconnect-AzAccount -Scope Process -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $null = Disconnect-AzAccount -Scope Process -ErrorAction Stop + } + else + { + $null = Disconnect-AzureRmAccount -Scope Process -ErrorAction Stop + } } elseif ((Get-Command -Name "Remove-AzureRmAccount" -ErrorAction "SilentlyContinue") -and (CmdletHasMember -cmdlet Remove-AzureRmAccount -memberName Scope)) { Write-Host "##[command]Remove-AzureRmAccount -Scope Process -ErrorAction Stop" - $null = Remove-AzAccount -Scope Process -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $null = Remove-AzAccount -Scope Process -ErrorAction Stop + } + else + { + $null = Remove-AzureRmAccount -Scope Process -ErrorAction Stop + } } elseif ((Get-Command -Name "Logout-AzureRmAccount" -ErrorAction "SilentlyContinue") -and (CmdletHasMember -cmdlet Logout-AzureRmAccount -memberName Scope)) { Write-Host "##[command]Logout-AzureRmAccount -Scope Process -ErrorAction Stop" - $null = Disconnect-AzAccount -Scope Process -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $null = Disconnect-AzAccount -Scope Process -ErrorAction Stop + } + else + { + $null = Logout-AzureRmAccount -Scope Process -ErrorAction Stop + } } if (Get-Command -Name "Clear-AzureRmContext" -ErrorAction "SilentlyContinue") { Write-Host "##[command]Clear-AzureRmContext -Scope Process -ErrorAction Stop" - $null = Clear-AzContext -Scope Process -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $null = Clear-AzContext -Scope Process -ErrorAction Stop + } + else + { + $null = Clear-AzureRmContext -Scope Process -ErrorAction Stop + } } } From 97d81ec60d266b8e57683039515338f7915eaa50 Mon Sep 17 00:00:00 2001 From: Nikita Shkarupa Date: Wed, 17 Jan 2024 13:36:59 +0100 Subject: [PATCH 5/9] Add missing FF switch --- Tasks/AzureFileCopyV4/AzureUtilityARM.ps1 | 190 +++++++++++++++++++--- 1 file changed, 169 insertions(+), 21 deletions(-) diff --git a/Tasks/AzureFileCopyV4/AzureUtilityARM.ps1 b/Tasks/AzureFileCopyV4/AzureUtilityARM.ps1 index bcabca2f9c9e..cfb062ca9815 100644 --- a/Tasks/AzureFileCopyV4/AzureUtilityARM.ps1 +++ b/Tasks/AzureFileCopyV4/AzureUtilityARM.ps1 @@ -10,7 +10,14 @@ 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" - $azureStorageAccountResourceDetails = Get-AzStorageAccount -ErrorAction Stop | Where-Object { $_.StorageAccountName -eq $storageAccountName } + if ($featureFlags.retireAzureRM) + { + $azureStorageAccountResourceDetails = Get-AzStorageAccount -ErrorAction Stop | Where-Object { $_.StorageAccountName -eq $storageAccountName } + } + else + { + $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 @@ -33,7 +40,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -50,7 +64,14 @@ function Create-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" - $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } } @@ -69,7 +90,14 @@ function Get-AzureContainer Write-Verbose "[Azure Call]Getting container: $containerName in storage account: $storageAccountName" try { - $container = Get-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = Get-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = Get-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } } catch { @@ -90,7 +118,14 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -104,7 +139,14 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -131,17 +173,38 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -150,15 +213,36 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -184,7 +268,14 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInMinutes minutes" - $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -199,7 +290,14 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } + else + { + $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -220,7 +318,15 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + $location -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { @@ -243,7 +349,14 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + if ($featureFlags.retireAzureRM) + { + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } + else + { + $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -265,7 +378,14 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -303,7 +423,14 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + if ($featureFlags.retireAzureRM) + { + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } + else + { + $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -320,11 +447,25 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + if ($featureFlags.retireAzureRM) + { + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } + else + { + $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + if ($featureFlags.retireAzureRM) + { + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } + else + { + $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -335,7 +476,14 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" From b2758d33b990a6123aceb1080d2e947b7b88bc53 Mon Sep 17 00:00:00 2001 From: Nikita Shkarupa Date: Wed, 17 Jan 2024 13:51:09 +0100 Subject: [PATCH 6/9] Bump tasks versions (due to changes in Common) --- Tasks/AzureCloudPowerShellDeploymentV2/task.json | 2 +- Tasks/AzureCloudPowerShellDeploymentV2/task.loc.json | 2 +- Tasks/AzurePowerShellV2/task.json | 2 +- Tasks/AzurePowerShellV2/task.loc.json | 2 +- Tasks/AzurePowerShellV3/task.json | 2 +- Tasks/AzurePowerShellV3/task.loc.json | 2 +- Tasks/AzurePowerShellV4/task.json | 2 +- Tasks/AzurePowerShellV4/task.loc.json | 2 +- Tasks/AzurePowerShellV5/task.json | 2 +- Tasks/AzurePowerShellV5/task.loc.json | 2 +- Tasks/SqlAzureDacpacDeploymentV1/task.json | 2 +- Tasks/SqlAzureDacpacDeploymentV1/task.loc.json | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Tasks/AzureCloudPowerShellDeploymentV2/task.json b/Tasks/AzureCloudPowerShellDeploymentV2/task.json index 665ffc5f3624..84fb5706b5f4 100644 --- a/Tasks/AzureCloudPowerShellDeploymentV2/task.json +++ b/Tasks/AzureCloudPowerShellDeploymentV2/task.json @@ -16,7 +16,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 226, + "Minor": 234, "Patch": 0 }, "demands": [ diff --git a/Tasks/AzureCloudPowerShellDeploymentV2/task.loc.json b/Tasks/AzureCloudPowerShellDeploymentV2/task.loc.json index 44dd596fafab..3b824cd662e4 100644 --- a/Tasks/AzureCloudPowerShellDeploymentV2/task.loc.json +++ b/Tasks/AzureCloudPowerShellDeploymentV2/task.loc.json @@ -16,7 +16,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 226, + "Minor": 234, "Patch": 0 }, "demands": [ diff --git a/Tasks/AzurePowerShellV2/task.json b/Tasks/AzurePowerShellV2/task.json index d0901e6044bd..889001ec42e4 100644 --- a/Tasks/AzurePowerShellV2/task.json +++ b/Tasks/AzurePowerShellV2/task.json @@ -17,7 +17,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 230, + "Minor": 234, "Patch": 0 }, "demands": [ diff --git a/Tasks/AzurePowerShellV2/task.loc.json b/Tasks/AzurePowerShellV2/task.loc.json index 908450ded4a6..ebd5d3cdd397 100644 --- a/Tasks/AzurePowerShellV2/task.loc.json +++ b/Tasks/AzurePowerShellV2/task.loc.json @@ -17,7 +17,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 230, + "Minor": 234, "Patch": 0 }, "demands": [ diff --git a/Tasks/AzurePowerShellV3/task.json b/Tasks/AzurePowerShellV3/task.json index 49f434610548..b7bedfd12a43 100644 --- a/Tasks/AzurePowerShellV3/task.json +++ b/Tasks/AzurePowerShellV3/task.json @@ -17,7 +17,7 @@ "author": "Microsoft Corporation", "version": { "Major": 3, - "Minor": 230, + "Minor": 234, "Patch": 0 }, "releaseNotes": "Added support for Fail on standard error and ErrorActionPreference", diff --git a/Tasks/AzurePowerShellV3/task.loc.json b/Tasks/AzurePowerShellV3/task.loc.json index 564890333d0a..137f2f1e1dd2 100644 --- a/Tasks/AzurePowerShellV3/task.loc.json +++ b/Tasks/AzurePowerShellV3/task.loc.json @@ -17,7 +17,7 @@ "author": "Microsoft Corporation", "version": { "Major": 3, - "Minor": 230, + "Minor": 234, "Patch": 0 }, "releaseNotes": "ms-resource:loc.releaseNotes", diff --git a/Tasks/AzurePowerShellV4/task.json b/Tasks/AzurePowerShellV4/task.json index d969e0fc869f..054f5cf29402 100644 --- a/Tasks/AzurePowerShellV4/task.json +++ b/Tasks/AzurePowerShellV4/task.json @@ -17,7 +17,7 @@ "author": "Microsoft Corporation", "version": { "Major": 4, - "Minor": 231, + "Minor": 234, "Patch": 0 }, "releaseNotes": "Added support for Az Module and cross platform agents.", diff --git a/Tasks/AzurePowerShellV4/task.loc.json b/Tasks/AzurePowerShellV4/task.loc.json index 2760af563388..85c401f1a388 100644 --- a/Tasks/AzurePowerShellV4/task.loc.json +++ b/Tasks/AzurePowerShellV4/task.loc.json @@ -17,7 +17,7 @@ "author": "Microsoft Corporation", "version": { "Major": 4, - "Minor": 231, + "Minor": 234, "Patch": 0 }, "releaseNotes": "ms-resource:loc.releaseNotes", diff --git a/Tasks/AzurePowerShellV5/task.json b/Tasks/AzurePowerShellV5/task.json index 5ecd922d52b8..b455caf9c233 100644 --- a/Tasks/AzurePowerShellV5/task.json +++ b/Tasks/AzurePowerShellV5/task.json @@ -17,7 +17,7 @@ "author": "Microsoft Corporation", "version": { "Major": 5, - "Minor": 231, + "Minor": 234, "Patch": 0 }, "releaseNotes": "Added support for Az Module and cross platform agents.", diff --git a/Tasks/AzurePowerShellV5/task.loc.json b/Tasks/AzurePowerShellV5/task.loc.json index 99e49202c27e..923af84c1915 100644 --- a/Tasks/AzurePowerShellV5/task.loc.json +++ b/Tasks/AzurePowerShellV5/task.loc.json @@ -17,7 +17,7 @@ "author": "Microsoft Corporation", "version": { "Major": 5, - "Minor": 231, + "Minor": 234, "Patch": 0 }, "releaseNotes": "ms-resource:loc.releaseNotes", diff --git a/Tasks/SqlAzureDacpacDeploymentV1/task.json b/Tasks/SqlAzureDacpacDeploymentV1/task.json index 33b166c2ab27..053cdb1e16f7 100644 --- a/Tasks/SqlAzureDacpacDeploymentV1/task.json +++ b/Tasks/SqlAzureDacpacDeploymentV1/task.json @@ -16,7 +16,7 @@ "author": "Microsoft Corporation", "version": { "Major": 1, - "Minor": 232, + "Minor": 234, "Patch": 0 }, "demands": [ diff --git a/Tasks/SqlAzureDacpacDeploymentV1/task.loc.json b/Tasks/SqlAzureDacpacDeploymentV1/task.loc.json index 7a449e0c9529..c6e26f1c7cdb 100644 --- a/Tasks/SqlAzureDacpacDeploymentV1/task.loc.json +++ b/Tasks/SqlAzureDacpacDeploymentV1/task.loc.json @@ -16,7 +16,7 @@ "author": "Microsoft Corporation", "version": { "Major": 1, - "Minor": 232, + "Minor": 234, "Patch": 0 }, "demands": [ From 10d5fb0cc0838c667bf58b61f5bffd59b2a56a5a Mon Sep 17 00:00:00 2001 From: v-kivlev Date: Thu, 18 Jan 2024 17:10:57 +0400 Subject: [PATCH 7/9] update generated tasks --- _generated/AzureFileCopyV2.versionmap.txt | 4 +- _generated/AzureFileCopyV2/AzureFileCopy.ps1 | 15 +- .../AzureFileCopyV2/AzureUtilityGTE1.0.ps1 | 248 ++++- .../AzureFileCopyV2/AzureUtilityGTE1.1.0.ps1 | 22 +- .../AzureFileCopyV2/AzureUtilityLTE9.8.ps1 | 50 +- _generated/AzureFileCopyV2/task.json | 8 +- _generated/AzureFileCopyV2/task.loc.json | 8 +- .../AzureFileCopyV2_Node20/AzureFileCopy.ps1 | 15 +- .../AzureUtilityGTE1.0.ps1 | 248 ++++- .../AzureUtilityGTE1.1.0.ps1 | 22 +- .../AzureUtilityLTE9.8.ps1 | 50 +- _generated/AzureFileCopyV2_Node20/task.json | 8 +- .../AzureFileCopyV2_Node20/task.loc.json | 8 +- _generated/AzureFileCopyV3.versionmap.txt | 4 +- .../AzureFileCopyV3/AzureUtilityARM.ps1 | 198 +++- _generated/AzureFileCopyV3/task.json | 8 +- _generated/AzureFileCopyV3/task.loc.json | 8 +- .../AzureUtilityARM.ps1 | 198 +++- _generated/AzureFileCopyV3_Node20/task.json | 8 +- .../AzureFileCopyV3_Node20/task.loc.json | 8 +- _generated/AzureFileCopyV4.versionmap.txt | 4 +- .../AzureFileCopyV4/AzureUtilityARM.ps1 | 191 +++- _generated/AzureFileCopyV4/task.json | 8 +- _generated/AzureFileCopyV4/task.loc.json | 8 +- .../AzureUtilityARM.ps1 | 191 +++- _generated/AzureFileCopyV4_Node20/task.json | 8 +- .../AzureFileCopyV4_Node20/task.loc.json | 8 +- _generated/AzureFileCopyV5.versionmap.txt | 4 +- .../AzureFileCopyV5/AzureUtilityARM.ps1 | 196 +++- _generated/AzureFileCopyV5/task.json | 8 +- _generated/AzureFileCopyV5/task.loc.json | 8 +- .../AzureUtilityARM.ps1 | 196 +++- _generated/AzureFileCopyV5_Node20/task.json | 8 +- .../AzureFileCopyV5_Node20/task.loc.json | 8 +- _generated/AzurePowerShellV4.versionmap.txt | 4 +- .../AzurePowerShellV4/AzurePowerShell.ps1 | 298 ++++++ _generated/AzurePowerShellV4/InitializeAz.ps1 | 107 +++ .../resources.resjson/de-DE/resources.resjson | 43 + .../resources.resjson/en-US/resources.resjson | 43 + .../resources.resjson/es-ES/resources.resjson | 43 + .../resources.resjson/fr-FR/resources.resjson | 43 + .../resources.resjson/it-IT/resources.resjson | 43 + .../resources.resjson/ja-JP/resources.resjson | 43 + .../resources.resjson/ko-KR/resources.resjson | 43 + .../resources.resjson/ru-RU/resources.resjson | 43 + .../resources.resjson/zh-CN/resources.resjson | 43 + .../resources.resjson/zh-TW/resources.resjson | 43 + .../Tests/ChecksForPowerShell.ps1 | 30 + .../Tests/ChecksForPowerShellCore.ps1 | 31 + .../Tests/ChecksForWorkingDirectory.ps1 | 33 + _generated/AzurePowerShellV4/Tests/L0.ts | 58 ++ .../Tests/PerformsBasicFlow.ps1 | 35 + .../Tests/PerformsBasicFlow_TargetScript.ps1 | 4 + .../Tests/ThrowsForInvalidVersion.ps1 | 15 + .../ThrowsWhenInvalidScriptArguments.ps1 | 14 + .../Tests/ThrowsWhenInvalidScriptPath.ps1 | 16 + .../Tests/Utility.Get-LatestModule.ps1 | 30 + ...ModulePathForHostedAgentWorksCorrectly.ps1 | 47 + .../AzurePowerShellV4/ThirdPartyNotices.txt | 136 +++ .../TryMakingModuleAvailable.ps1 | 85 ++ .../AzurePowerShellV4/UpdatePSModulePath.ps1 | 11 + _generated/AzurePowerShellV4/Utility.ps1 | 203 +++++ .../AzurePowerShellV4/azurepowershell.ts | 169 ++++ _generated/AzurePowerShellV4/icon.png | Bin 0 -> 15348 bytes _generated/AzurePowerShellV4/icon.svg | 20 + _generated/AzurePowerShellV4/make.json | 52 ++ .../AzurePowerShellV4/package-lock.json | 859 ++++++++++++++++++ _generated/AzurePowerShellV4/package.json | 18 + _generated/AzurePowerShellV4/task.json | 217 +++++ _generated/AzurePowerShellV4/task.loc.json | 217 +++++ _generated/AzurePowerShellV4/tsconfig.json | 7 + _generated/AzurePowerShellV4_Node20/task.json | 8 +- .../AzurePowerShellV4_Node20/task.loc.json | 8 +- _generated/AzurePowerShellV5.versionmap.txt | 4 +- .../AzurePowerShellV5/AzurePowerShell.ps1 | 199 ++++ _generated/AzurePowerShellV5/CoreAz.ps1 | 32 + _generated/AzurePowerShellV5/InitializeAz.ps1 | 122 +++ .../resources.resjson/de-DE/resources.resjson | 42 + .../resources.resjson/en-US/resources.resjson | 42 + .../resources.resjson/es-ES/resources.resjson | 42 + .../resources.resjson/fr-FR/resources.resjson | 42 + .../resources.resjson/it-IT/resources.resjson | 42 + .../resources.resjson/ja-JP/resources.resjson | 42 + .../resources.resjson/ko-KR/resources.resjson | 42 + .../resources.resjson/ru-RU/resources.resjson | 42 + .../resources.resjson/zh-CN/resources.resjson | 42 + .../resources.resjson/zh-TW/resources.resjson | 42 + .../Tests/ChecksForPowerShell.ps1 | 32 + .../Tests/ChecksForPowerShellCore.ps1 | 32 + .../Tests/ChecksForWorkingDirectory.ps1 | 34 + _generated/AzurePowerShellV5/Tests/L0.ts | 58 ++ .../Tests/PerformsBasicFlow.ps1 | 35 + .../Tests/PerformsBasicFlow_TargetScript.ps1 | 4 + .../Tests/ThrowsForInvalidVersion.ps1 | 15 + .../ThrowsWhenInvalidScriptArguments.ps1 | 14 + .../Tests/ThrowsWhenInvalidScriptPath.ps1 | 16 + .../Tests/Utility.Get-LatestModule.ps1 | 30 + ...ModulePathForHostedAgentWorksCorrectly.ps1 | 47 + .../AzurePowerShellV5/ThirdPartyNotices.txt | 136 +++ .../TryMakingModuleAvailable.ps1 | 85 ++ _generated/AzurePowerShellV5/Utility.ps1 | 203 +++++ .../AzurePowerShellV5/azurepowershell.ts | 165 ++++ _generated/AzurePowerShellV5/icon.png | Bin 0 -> 15348 bytes _generated/AzurePowerShellV5/icon.svg | 20 + _generated/AzurePowerShellV5/make.json | 50 + .../AzurePowerShellV5/package-lock.json | 859 ++++++++++++++++++ _generated/AzurePowerShellV5/package.json | 18 + _generated/AzurePowerShellV5/task.json | 210 +++++ _generated/AzurePowerShellV5/task.loc.json | 210 +++++ _generated/AzurePowerShellV5/tsconfig.json | 7 + _generated/AzurePowerShellV5_Node20/task.json | 8 +- .../AzurePowerShellV5_Node20/task.loc.json | 8 +- 112 files changed, 7927 insertions(+), 292 deletions(-) create mode 100644 _generated/AzurePowerShellV4/AzurePowerShell.ps1 create mode 100644 _generated/AzurePowerShellV4/InitializeAz.ps1 create mode 100644 _generated/AzurePowerShellV4/Strings/resources.resjson/de-DE/resources.resjson create mode 100644 _generated/AzurePowerShellV4/Strings/resources.resjson/en-US/resources.resjson create mode 100644 _generated/AzurePowerShellV4/Strings/resources.resjson/es-ES/resources.resjson create mode 100644 _generated/AzurePowerShellV4/Strings/resources.resjson/fr-FR/resources.resjson create mode 100644 _generated/AzurePowerShellV4/Strings/resources.resjson/it-IT/resources.resjson create mode 100644 _generated/AzurePowerShellV4/Strings/resources.resjson/ja-JP/resources.resjson create mode 100644 _generated/AzurePowerShellV4/Strings/resources.resjson/ko-KR/resources.resjson create mode 100644 _generated/AzurePowerShellV4/Strings/resources.resjson/ru-RU/resources.resjson create mode 100644 _generated/AzurePowerShellV4/Strings/resources.resjson/zh-CN/resources.resjson create mode 100644 _generated/AzurePowerShellV4/Strings/resources.resjson/zh-TW/resources.resjson create mode 100644 _generated/AzurePowerShellV4/Tests/ChecksForPowerShell.ps1 create mode 100644 _generated/AzurePowerShellV4/Tests/ChecksForPowerShellCore.ps1 create mode 100644 _generated/AzurePowerShellV4/Tests/ChecksForWorkingDirectory.ps1 create mode 100644 _generated/AzurePowerShellV4/Tests/L0.ts create mode 100644 _generated/AzurePowerShellV4/Tests/PerformsBasicFlow.ps1 create mode 100644 _generated/AzurePowerShellV4/Tests/PerformsBasicFlow_TargetScript.ps1 create mode 100644 _generated/AzurePowerShellV4/Tests/ThrowsForInvalidVersion.ps1 create mode 100644 _generated/AzurePowerShellV4/Tests/ThrowsWhenInvalidScriptArguments.ps1 create mode 100644 _generated/AzurePowerShellV4/Tests/ThrowsWhenInvalidScriptPath.ps1 create mode 100644 _generated/AzurePowerShellV4/Tests/Utility.Get-LatestModule.ps1 create mode 100644 _generated/AzurePowerShellV4/Tests/Utility.UpdatePSModulePathForHostedAgentWorksCorrectly.ps1 create mode 100644 _generated/AzurePowerShellV4/ThirdPartyNotices.txt create mode 100644 _generated/AzurePowerShellV4/TryMakingModuleAvailable.ps1 create mode 100644 _generated/AzurePowerShellV4/UpdatePSModulePath.ps1 create mode 100644 _generated/AzurePowerShellV4/Utility.ps1 create mode 100644 _generated/AzurePowerShellV4/azurepowershell.ts create mode 100644 _generated/AzurePowerShellV4/icon.png create mode 100644 _generated/AzurePowerShellV4/icon.svg create mode 100644 _generated/AzurePowerShellV4/make.json create mode 100644 _generated/AzurePowerShellV4/package-lock.json create mode 100644 _generated/AzurePowerShellV4/package.json create mode 100644 _generated/AzurePowerShellV4/task.json create mode 100644 _generated/AzurePowerShellV4/task.loc.json create mode 100644 _generated/AzurePowerShellV4/tsconfig.json create mode 100644 _generated/AzurePowerShellV5/AzurePowerShell.ps1 create mode 100644 _generated/AzurePowerShellV5/CoreAz.ps1 create mode 100644 _generated/AzurePowerShellV5/InitializeAz.ps1 create mode 100644 _generated/AzurePowerShellV5/Strings/resources.resjson/de-DE/resources.resjson create mode 100644 _generated/AzurePowerShellV5/Strings/resources.resjson/en-US/resources.resjson create mode 100644 _generated/AzurePowerShellV5/Strings/resources.resjson/es-ES/resources.resjson create mode 100644 _generated/AzurePowerShellV5/Strings/resources.resjson/fr-FR/resources.resjson create mode 100644 _generated/AzurePowerShellV5/Strings/resources.resjson/it-IT/resources.resjson create mode 100644 _generated/AzurePowerShellV5/Strings/resources.resjson/ja-JP/resources.resjson create mode 100644 _generated/AzurePowerShellV5/Strings/resources.resjson/ko-KR/resources.resjson create mode 100644 _generated/AzurePowerShellV5/Strings/resources.resjson/ru-RU/resources.resjson create mode 100644 _generated/AzurePowerShellV5/Strings/resources.resjson/zh-CN/resources.resjson create mode 100644 _generated/AzurePowerShellV5/Strings/resources.resjson/zh-TW/resources.resjson create mode 100644 _generated/AzurePowerShellV5/Tests/ChecksForPowerShell.ps1 create mode 100644 _generated/AzurePowerShellV5/Tests/ChecksForPowerShellCore.ps1 create mode 100644 _generated/AzurePowerShellV5/Tests/ChecksForWorkingDirectory.ps1 create mode 100644 _generated/AzurePowerShellV5/Tests/L0.ts create mode 100644 _generated/AzurePowerShellV5/Tests/PerformsBasicFlow.ps1 create mode 100644 _generated/AzurePowerShellV5/Tests/PerformsBasicFlow_TargetScript.ps1 create mode 100644 _generated/AzurePowerShellV5/Tests/ThrowsForInvalidVersion.ps1 create mode 100644 _generated/AzurePowerShellV5/Tests/ThrowsWhenInvalidScriptArguments.ps1 create mode 100644 _generated/AzurePowerShellV5/Tests/ThrowsWhenInvalidScriptPath.ps1 create mode 100644 _generated/AzurePowerShellV5/Tests/Utility.Get-LatestModule.ps1 create mode 100644 _generated/AzurePowerShellV5/Tests/Utility.UpdatePSModulePathForHostedAgentWorksCorrectly.ps1 create mode 100644 _generated/AzurePowerShellV5/ThirdPartyNotices.txt create mode 100644 _generated/AzurePowerShellV5/TryMakingModuleAvailable.ps1 create mode 100644 _generated/AzurePowerShellV5/Utility.ps1 create mode 100644 _generated/AzurePowerShellV5/azurepowershell.ts create mode 100644 _generated/AzurePowerShellV5/icon.png create mode 100644 _generated/AzurePowerShellV5/icon.svg create mode 100644 _generated/AzurePowerShellV5/make.json create mode 100644 _generated/AzurePowerShellV5/package-lock.json create mode 100644 _generated/AzurePowerShellV5/package.json create mode 100644 _generated/AzurePowerShellV5/task.json create mode 100644 _generated/AzurePowerShellV5/task.loc.json create mode 100644 _generated/AzurePowerShellV5/tsconfig.json diff --git a/_generated/AzureFileCopyV2.versionmap.txt b/_generated/AzureFileCopyV2.versionmap.txt index 541cb7e3177c..dfad9fdc1c32 100644 --- a/_generated/AzureFileCopyV2.versionmap.txt +++ b/_generated/AzureFileCopyV2.versionmap.txt @@ -1,2 +1,2 @@ -Default|2.231.2 -Node20_229_2|2.231.4 +Default|2.234.0 +Node20_229_2|2.234.1 diff --git a/_generated/AzureFileCopyV2/AzureFileCopy.ps1 b/_generated/AzureFileCopyV2/AzureFileCopy.ps1 index 6b64ce4a6c72..b69f23805337 100644 --- a/_generated/AzureFileCopyV2/AzureFileCopy.ps1 +++ b/_generated/AzureFileCopyV2/AzureFileCopy.ps1 @@ -3,6 +3,10 @@ param() Trace-VstsEnteringInvocation $MyInvocation +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + # Get inputs for the task $connectedServiceNameSelector = Get-VstsInput -Name ConnectedServiceNameSelector -Require $sourcePath = Get-VstsInput -Name SourcePath -Require @@ -211,7 +215,14 @@ try { } if(-not [string]::IsNullOrEmpty($outputStorageContainerSASToken)) { - $storageContainerSaSToken = New-AzureStorageContainerSASToken -Container $containerName -Context $storageContext -Permission rl -ExpiryTime (Get-Date).AddHours($defaultSasTokenTimeOutInHours) + if ($featureFlags.retireAzureRM) + { + $storageContainerSaSToken = New-AzStorageContainerSASToken -Name $containerName -Context $storageContext -Permission rl -ExpiryTime (Get-Date).AddHours($defaultSasTokenTimeOutInHours) + } + else + { + $storageContainerSaSToken = New-AzureStorageContainerSASToken -Container $containerName -Context $storageContext -Permission rl -ExpiryTime (Get-Date).AddHours($defaultSasTokenTimeOutInHours) + } Write-Host "##vso[task.setvariable variable=$outputStorageContainerSASToken;]$storageContainerSasToken" } @@ -280,4 +291,4 @@ try { } finally { Disconnect-AzureAndClearContext -authScheme $connectionType -ErrorAction SilentlyContinue -} \ No newline at end of file +} diff --git a/_generated/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 b/_generated/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 index 3b9642fcf36c..67408989a140 100644 --- a/_generated/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 +++ b/_generated/AzureFileCopyV2/AzureUtilityGTE1.0.ps1 @@ -1,5 +1,9 @@ # This file implements IAzureUtility for Azure PowerShell version >= 1.0.0 +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureStorageKeyFromRDFE { param([string]$storageAccountName, @@ -24,7 +28,14 @@ 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" - $azureStorageAccountResourceDetails = Get-AzureRmResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + if ($featureFlags.retireAzureRM) + { + $azureStorageAccountResourceDetails = Get-AzResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + } + else + { + $azureStorageAccountResourceDetails = Get-AzureRmResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + } Write-Verbose "[Azure Call]Retrieved resource details successfully for azure storage account resource: $storageAccountName with resource type: $ARMStorageAccountResourceType" $azureResourceGroupName = $azureStorageAccountResourceDetails.ResourceGroupName @@ -50,7 +61,14 @@ function Get-AzureStorageKeyFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage key for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageKeyDetails = Get-AzureRMStorageAccountKey -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageKeyDetails = Get-AzStorageAccountKey -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } + else + { + $storageKeyDetails = Get-AzureRMStorageAccountKey -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } $storageKey = $storageKeyDetails.Key1 Write-Verbose "[Azure Call]Retrieved storage key successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -66,7 +84,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -102,7 +127,14 @@ function Get-AzureBlobStorageEndpointFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage account endpoint for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageAccountInfo = Get-AzureRMStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageAccountInfo = Get-AzStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } + else + { + $storageAccountInfo = Get-AzureRMStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } $storageAccountEnpoint = $storageAccountInfo.PrimaryEndpoints[0].blob Write-Verbose "[Azure Call]Retrieved storage account endpoint successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -139,7 +171,14 @@ function Get-AzureStorageAccountTypeFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage account type for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageAccountInfo = Get-AzureRMStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageAccountInfo = Get-AzStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } + else + { + $storageAccountInfo = Get-AzureRMStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } $storageAccountType = $storageAccountInfo.AccountType Write-Verbose "[Azure Call]Retrieved storage account type successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -160,9 +199,23 @@ function Create-AzureContainer Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" if ($isPremiumStorage) { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } } else { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } @@ -178,7 +231,14 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -265,7 +325,14 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -348,17 +415,38 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -367,15 +455,36 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -401,7 +510,14 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInHours hours" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + } Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -416,7 +532,14 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } + else + { + $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -435,7 +558,14 @@ function Get-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName)) { Write-Host (Get-VstsLocString -Key "AFC_GetCustomScriptExtension" -ArgumentList $name, $vmName) - $customScriptExtension = Get-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $customScriptExtension = Get-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -ErrorAction Stop -Verbose + } + else + { + $customScriptExtension = Get-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -455,7 +585,14 @@ function Set-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -474,7 +611,14 @@ function Remove-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_RemoveCustomScriptExtension" -ArgumentList $name, $vmName) - $response = Remove-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -Force -ErrorAction SilentlyContinue -Verbose + if ($featureFlags.retireAzureRM) + { + $response = Remove-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -Force -ErrorAction SilentlyContinue -Verbose + } + else + { + $response = Remove-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -Force -ErrorAction SilentlyContinue -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_RemoveCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -491,7 +635,14 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + if ($featureFlags.retireAzureRM) + { + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } + else + { + $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -513,7 +664,14 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -551,7 +709,14 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + if ($featureFlags.retireAzureRM) + { + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } + else + { + $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -568,11 +733,25 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + if ($featureFlags.retireAzureRM) + { + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } + else + { + $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + if ($featureFlags.retireAzureRM) + { + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } + else + { + $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -583,7 +762,14 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" @@ -612,7 +798,15 @@ function Remove-NetworkSecurityRuleConfig foreach($securityGroup in $securityGroups) { Write-Verbose "[Azure Call]Removing the Rule $ruleName" - $result = Remove-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName | Set-AzureRmNetworkSecurityGroup + if ($featureFlags.retireAzureRM) + { + $result = Remove-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName | Set-AzNetworkSecurityGroup + } + else + { + $result = Remove-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName | Set-AzureRmNetworkSecurityGroup + } Write-Verbose "[Azure Call]Removed the Rule $ruleName" } } + diff --git a/_generated/AzureFileCopyV2/AzureUtilityGTE1.1.0.ps1 b/_generated/AzureFileCopyV2/AzureUtilityGTE1.1.0.ps1 index acf2f971551e..b00250086d92 100644 --- a/_generated/AzureFileCopyV2/AzureUtilityGTE1.1.0.ps1 +++ b/_generated/AzureFileCopyV2/AzureUtilityGTE1.1.0.ps1 @@ -2,6 +2,10 @@ . "$PSScriptRoot/AzureUtilityGTE1.0.ps1" +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureRMVMsInResourceGroup { param([string]$resourceGroupName) @@ -11,7 +15,13 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -41,7 +51,14 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { @@ -55,3 +72,4 @@ function Set-AzureMachineCustomScriptExtension return $result } + diff --git a/_generated/AzureFileCopyV2/AzureUtilityLTE9.8.ps1 b/_generated/AzureFileCopyV2/AzureUtilityLTE9.8.ps1 index dcdd33a0c368..a8f7f9e869a7 100644 --- a/_generated/AzureFileCopyV2/AzureUtilityLTE9.8.ps1 +++ b/_generated/AzureFileCopyV2/AzureUtilityLTE9.8.ps1 @@ -1,5 +1,9 @@ # This file implements IAzureUtility for Azure PowerShell version <= 0.9.8 +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureStorageKeyFromRDFE { param([string]$storageAccountName, @@ -80,7 +84,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -182,11 +193,25 @@ function Create-AzureContainer Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" if ($isPremiumStorage) { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } } else { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } @@ -202,7 +227,14 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -378,7 +410,14 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInHours hours" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + } Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -600,3 +639,4 @@ function Remove-NetworkSecurityRuleConfig Write-Verbose "[Azure Call]Removed the Rule $ruleName" } } + diff --git a/_generated/AzureFileCopyV2/task.json b/_generated/AzureFileCopyV2/task.json index 9a7e83d281b2..70af0eb3d644 100644 --- a/_generated/AzureFileCopyV2/task.json +++ b/_generated/AzureFileCopyV2/task.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" @@ -374,7 +374,7 @@ "ExpiredServicePrincipal": "Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired." }, "_buildConfigMapping": { - "Default": "2.231.2", - "Node20_229_2": "2.231.4" + "Default": "2.234.0", + "Node20_229_2": "2.234.1" } } \ No newline at end of file diff --git a/_generated/AzureFileCopyV2/task.loc.json b/_generated/AzureFileCopyV2/task.loc.json index 522bd397e303..a3c854191873 100644 --- a/_generated/AzureFileCopyV2/task.loc.json +++ b/_generated/AzureFileCopyV2/task.loc.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" @@ -374,7 +374,7 @@ "ExpiredServicePrincipal": "ms-resource:loc.messages.ExpiredServicePrincipal" }, "_buildConfigMapping": { - "Default": "2.231.2", - "Node20_229_2": "2.231.4" + "Default": "2.234.0", + "Node20_229_2": "2.234.1" } } \ No newline at end of file diff --git a/_generated/AzureFileCopyV2_Node20/AzureFileCopy.ps1 b/_generated/AzureFileCopyV2_Node20/AzureFileCopy.ps1 index 6b64ce4a6c72..b69f23805337 100644 --- a/_generated/AzureFileCopyV2_Node20/AzureFileCopy.ps1 +++ b/_generated/AzureFileCopyV2_Node20/AzureFileCopy.ps1 @@ -3,6 +3,10 @@ param() Trace-VstsEnteringInvocation $MyInvocation +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + # Get inputs for the task $connectedServiceNameSelector = Get-VstsInput -Name ConnectedServiceNameSelector -Require $sourcePath = Get-VstsInput -Name SourcePath -Require @@ -211,7 +215,14 @@ try { } if(-not [string]::IsNullOrEmpty($outputStorageContainerSASToken)) { - $storageContainerSaSToken = New-AzureStorageContainerSASToken -Container $containerName -Context $storageContext -Permission rl -ExpiryTime (Get-Date).AddHours($defaultSasTokenTimeOutInHours) + if ($featureFlags.retireAzureRM) + { + $storageContainerSaSToken = New-AzStorageContainerSASToken -Name $containerName -Context $storageContext -Permission rl -ExpiryTime (Get-Date).AddHours($defaultSasTokenTimeOutInHours) + } + else + { + $storageContainerSaSToken = New-AzureStorageContainerSASToken -Container $containerName -Context $storageContext -Permission rl -ExpiryTime (Get-Date).AddHours($defaultSasTokenTimeOutInHours) + } Write-Host "##vso[task.setvariable variable=$outputStorageContainerSASToken;]$storageContainerSasToken" } @@ -280,4 +291,4 @@ try { } finally { Disconnect-AzureAndClearContext -authScheme $connectionType -ErrorAction SilentlyContinue -} \ No newline at end of file +} diff --git a/_generated/AzureFileCopyV2_Node20/AzureUtilityGTE1.0.ps1 b/_generated/AzureFileCopyV2_Node20/AzureUtilityGTE1.0.ps1 index 3b9642fcf36c..67408989a140 100644 --- a/_generated/AzureFileCopyV2_Node20/AzureUtilityGTE1.0.ps1 +++ b/_generated/AzureFileCopyV2_Node20/AzureUtilityGTE1.0.ps1 @@ -1,5 +1,9 @@ # This file implements IAzureUtility for Azure PowerShell version >= 1.0.0 +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureStorageKeyFromRDFE { param([string]$storageAccountName, @@ -24,7 +28,14 @@ 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" - $azureStorageAccountResourceDetails = Get-AzureRmResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + if ($featureFlags.retireAzureRM) + { + $azureStorageAccountResourceDetails = Get-AzResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + } + else + { + $azureStorageAccountResourceDetails = Get-AzureRmResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + } Write-Verbose "[Azure Call]Retrieved resource details successfully for azure storage account resource: $storageAccountName with resource type: $ARMStorageAccountResourceType" $azureResourceGroupName = $azureStorageAccountResourceDetails.ResourceGroupName @@ -50,7 +61,14 @@ function Get-AzureStorageKeyFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage key for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageKeyDetails = Get-AzureRMStorageAccountKey -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageKeyDetails = Get-AzStorageAccountKey -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } + else + { + $storageKeyDetails = Get-AzureRMStorageAccountKey -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } $storageKey = $storageKeyDetails.Key1 Write-Verbose "[Azure Call]Retrieved storage key successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -66,7 +84,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -102,7 +127,14 @@ function Get-AzureBlobStorageEndpointFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage account endpoint for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageAccountInfo = Get-AzureRMStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageAccountInfo = Get-AzStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } + else + { + $storageAccountInfo = Get-AzureRMStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } $storageAccountEnpoint = $storageAccountInfo.PrimaryEndpoints[0].blob Write-Verbose "[Azure Call]Retrieved storage account endpoint successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -139,7 +171,14 @@ function Get-AzureStorageAccountTypeFromARM $azureResourceGroupName = Get-AzureStorageAccountResourceGroupName -storageAccountName $storageAccountName Write-Verbose "[Azure Call]Retrieving storage account type for the storage account: $storageAccount in resource group: $azureResourceGroupName" - $storageAccountInfo = Get-AzureRMStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageAccountInfo = Get-AzStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } + else + { + $storageAccountInfo = Get-AzureRMStorageAccount -ResourceGroupName $azureResourceGroupName -Name $storageAccountName -ErrorAction Stop + } $storageAccountType = $storageAccountInfo.AccountType Write-Verbose "[Azure Call]Retrieved storage account type successfully for the storage account: $storageAccount in resource group: $azureResourceGroupName" @@ -160,9 +199,23 @@ function Create-AzureContainer Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" if ($isPremiumStorage) { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } } else { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } @@ -178,7 +231,14 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -265,7 +325,14 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -348,17 +415,38 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -367,15 +455,36 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -401,7 +510,14 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInHours hours" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + } Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -416,7 +532,14 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } + else + { + $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -435,7 +558,14 @@ function Get-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName)) { Write-Host (Get-VstsLocString -Key "AFC_GetCustomScriptExtension" -ArgumentList $name, $vmName) - $customScriptExtension = Get-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $customScriptExtension = Get-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -ErrorAction Stop -Verbose + } + else + { + $customScriptExtension = Get-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -455,7 +585,14 @@ function Set-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -474,7 +611,14 @@ function Remove-AzureMachineCustomScriptExtension if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_RemoveCustomScriptExtension" -ArgumentList $name, $vmName) - $response = Remove-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -Force -ErrorAction SilentlyContinue -Verbose + if ($featureFlags.retireAzureRM) + { + $response = Remove-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -Force -ErrorAction SilentlyContinue -Verbose + } + else + { + $response = Remove-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -Force -ErrorAction SilentlyContinue -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_RemoveCustomScriptExtensionComplete" -ArgumentList $name, $vmName) } @@ -491,7 +635,14 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + if ($featureFlags.retireAzureRM) + { + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } + else + { + $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -513,7 +664,14 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -551,7 +709,14 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + if ($featureFlags.retireAzureRM) + { + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } + else + { + $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -568,11 +733,25 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + if ($featureFlags.retireAzureRM) + { + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } + else + { + $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + if ($featureFlags.retireAzureRM) + { + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } + else + { + $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -583,7 +762,14 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" @@ -612,7 +798,15 @@ function Remove-NetworkSecurityRuleConfig foreach($securityGroup in $securityGroups) { Write-Verbose "[Azure Call]Removing the Rule $ruleName" - $result = Remove-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName | Set-AzureRmNetworkSecurityGroup + if ($featureFlags.retireAzureRM) + { + $result = Remove-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName | Set-AzNetworkSecurityGroup + } + else + { + $result = Remove-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName | Set-AzureRmNetworkSecurityGroup + } Write-Verbose "[Azure Call]Removed the Rule $ruleName" } } + diff --git a/_generated/AzureFileCopyV2_Node20/AzureUtilityGTE1.1.0.ps1 b/_generated/AzureFileCopyV2_Node20/AzureUtilityGTE1.1.0.ps1 index acf2f971551e..b00250086d92 100644 --- a/_generated/AzureFileCopyV2_Node20/AzureUtilityGTE1.1.0.ps1 +++ b/_generated/AzureFileCopyV2_Node20/AzureUtilityGTE1.1.0.ps1 @@ -2,6 +2,10 @@ . "$PSScriptRoot/AzureUtilityGTE1.0.ps1" +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureRMVMsInResourceGroup { param([string]$resourceGroupName) @@ -11,7 +15,13 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -41,7 +51,14 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { @@ -55,3 +72,4 @@ function Set-AzureMachineCustomScriptExtension return $result } + diff --git a/_generated/AzureFileCopyV2_Node20/AzureUtilityLTE9.8.ps1 b/_generated/AzureFileCopyV2_Node20/AzureUtilityLTE9.8.ps1 index dcdd33a0c368..a8f7f9e869a7 100644 --- a/_generated/AzureFileCopyV2_Node20/AzureUtilityLTE9.8.ps1 +++ b/_generated/AzureFileCopyV2_Node20/AzureUtilityLTE9.8.ps1 @@ -1,5 +1,9 @@ # This file implements IAzureUtility for Azure PowerShell version <= 0.9.8 +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureStorageKeyFromRDFE { param([string]$storageAccountName, @@ -80,7 +84,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -182,11 +193,25 @@ function Create-AzureContainer Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" if ($isPremiumStorage) { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } } else { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } @@ -202,7 +227,14 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -378,7 +410,14 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInHours hours" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddHours($tokenTimeOutInHours) -Context $storageContext -Permission rwdl + } Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -600,3 +639,4 @@ function Remove-NetworkSecurityRuleConfig Write-Verbose "[Azure Call]Removed the Rule $ruleName" } } + diff --git a/_generated/AzureFileCopyV2_Node20/task.json b/_generated/AzureFileCopyV2_Node20/task.json index 5d82b3a5f230..b3eb48c2ce06 100644 --- a/_generated/AzureFileCopyV2_Node20/task.json +++ b/_generated/AzureFileCopyV2_Node20/task.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 231, - "Patch": 4 + "Minor": 234, + "Patch": 1 }, "demands": [ "azureps" @@ -378,7 +378,7 @@ "ExpiredServicePrincipal": "Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired." }, "_buildConfigMapping": { - "Default": "2.231.2", - "Node20_229_2": "2.231.4" + "Default": "2.234.0", + "Node20_229_2": "2.234.1" } } \ No newline at end of file diff --git a/_generated/AzureFileCopyV2_Node20/task.loc.json b/_generated/AzureFileCopyV2_Node20/task.loc.json index 98f70a0e293c..07d168311946 100644 --- a/_generated/AzureFileCopyV2_Node20/task.loc.json +++ b/_generated/AzureFileCopyV2_Node20/task.loc.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 231, - "Patch": 4 + "Minor": 234, + "Patch": 1 }, "demands": [ "azureps" @@ -378,7 +378,7 @@ "ExpiredServicePrincipal": "ms-resource:loc.messages.ExpiredServicePrincipal" }, "_buildConfigMapping": { - "Default": "2.231.2", - "Node20_229_2": "2.231.4" + "Default": "2.234.0", + "Node20_229_2": "2.234.1" } } \ No newline at end of file diff --git a/_generated/AzureFileCopyV3.versionmap.txt b/_generated/AzureFileCopyV3.versionmap.txt index 9c8d63647e05..997601b91b81 100644 --- a/_generated/AzureFileCopyV3.versionmap.txt +++ b/_generated/AzureFileCopyV3.versionmap.txt @@ -1,2 +1,2 @@ -Default|3.231.2 -Node20_229_2|3.231.4 +Default|3.234.0 +Node20_229_2|3.234.1 diff --git a/_generated/AzureFileCopyV3/AzureUtilityARM.ps1 b/_generated/AzureFileCopyV3/AzureUtilityARM.ps1 index 9ed07921a74d..f89fefb0776d 100644 --- a/_generated/AzureFileCopyV3/AzureUtilityARM.ps1 +++ b/_generated/AzureFileCopyV3/AzureUtilityARM.ps1 @@ -2,6 +2,10 @@ . "$PSScriptRoot/AzureUtilityRest.ps1" +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureStorageAccountResourceGroupName { param([string]$storageAccountName) @@ -10,7 +14,14 @@ 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" - $azureStorageAccountResourceDetails = Get-AzureRmResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + if ($featureFlags.retireAzureRM) + { + $azureStorageAccountResourceDetails = Get-AzResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + } + else + { + $azureStorageAccountResourceDetails = Get-AzureRmResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + } Write-Verbose "[Azure Call]Retrieved resource details successfully for azure storage account resource: $storageAccountName with resource type: $ARMStorageAccountResourceType" $azureResourceGroupName = $azureStorageAccountResourceDetails.ResourceGroupName @@ -33,7 +44,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -53,9 +71,25 @@ function Create-AzureContainer Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" if ($isPremiumStorage) { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop - } else { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + } + else + { + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } @@ -71,7 +105,14 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -85,7 +126,14 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -112,17 +160,38 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -131,15 +200,36 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -165,7 +255,14 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInMinutes minutes" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -180,7 +277,14 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } + else + { + $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -201,7 +305,14 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { @@ -224,7 +335,14 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + if ($featureFlags.retireAzureRM) + { + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } + else + { + $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -246,7 +364,14 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -284,7 +409,14 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + if ($featureFlags.retireAzureRM) + { + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } + else + { + $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -301,11 +433,25 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + if ($featureFlags.retireAzureRM) + { + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } + else + { + $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + if ($featureFlags.retireAzureRM) + { + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } + else + { + $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -316,7 +462,14 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" @@ -335,3 +488,4 @@ function Add-NetworkSecurityRuleConfig } } } + diff --git a/_generated/AzureFileCopyV3/task.json b/_generated/AzureFileCopyV3/task.json index 922d33fe6e13..03cb728ce759 100644 --- a/_generated/AzureFileCopyV3/task.json +++ b/_generated/AzureFileCopyV3/task.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 3, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" @@ -313,7 +313,7 @@ "ExpiredServicePrincipal": "Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired." }, "_buildConfigMapping": { - "Default": "3.231.2", - "Node20_229_2": "3.231.4" + "Default": "3.234.0", + "Node20_229_2": "3.234.1" } } \ No newline at end of file diff --git a/_generated/AzureFileCopyV3/task.loc.json b/_generated/AzureFileCopyV3/task.loc.json index b2bf7fdf4771..0b4956a45e41 100644 --- a/_generated/AzureFileCopyV3/task.loc.json +++ b/_generated/AzureFileCopyV3/task.loc.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 3, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" @@ -313,7 +313,7 @@ "ExpiredServicePrincipal": "ms-resource:loc.messages.ExpiredServicePrincipal" }, "_buildConfigMapping": { - "Default": "3.231.2", - "Node20_229_2": "3.231.4" + "Default": "3.234.0", + "Node20_229_2": "3.234.1" } } \ No newline at end of file diff --git a/_generated/AzureFileCopyV3_Node20/AzureUtilityARM.ps1 b/_generated/AzureFileCopyV3_Node20/AzureUtilityARM.ps1 index 9ed07921a74d..f89fefb0776d 100644 --- a/_generated/AzureFileCopyV3_Node20/AzureUtilityARM.ps1 +++ b/_generated/AzureFileCopyV3_Node20/AzureUtilityARM.ps1 @@ -2,6 +2,10 @@ . "$PSScriptRoot/AzureUtilityRest.ps1" +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureStorageAccountResourceGroupName { param([string]$storageAccountName) @@ -10,7 +14,14 @@ 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" - $azureStorageAccountResourceDetails = Get-AzureRmResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + if ($featureFlags.retireAzureRM) + { + $azureStorageAccountResourceDetails = Get-AzResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + } + else + { + $azureStorageAccountResourceDetails = Get-AzureRmResource -ErrorAction Stop | Where-Object { ($_.ResourceType -eq $ARMStorageAccountResourceType) -and ($_.Name -eq $storageAccountName)} + } Write-Verbose "[Azure Call]Retrieved resource details successfully for azure storage account resource: $storageAccountName with resource type: $ARMStorageAccountResourceType" $azureResourceGroupName = $azureStorageAccountResourceDetails.ResourceGroupName @@ -33,7 +44,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -53,9 +71,25 @@ function Create-AzureContainer Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" if ($isPremiumStorage) { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop - } else { - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + } + else + { + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Container -ErrorAction Stop + } } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } @@ -71,7 +105,14 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -85,7 +126,14 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -112,17 +160,38 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -131,15 +200,36 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -165,7 +255,14 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInMinutes minutes" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -180,7 +277,14 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } + else + { + $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -201,7 +305,14 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { @@ -224,7 +335,14 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + if ($featureFlags.retireAzureRM) + { + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } + else + { + $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -246,7 +364,14 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -284,7 +409,14 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + if ($featureFlags.retireAzureRM) + { + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } + else + { + $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -301,11 +433,25 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + if ($featureFlags.retireAzureRM) + { + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } + else + { + $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + if ($featureFlags.retireAzureRM) + { + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } + else + { + $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -316,7 +462,14 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" @@ -335,3 +488,4 @@ function Add-NetworkSecurityRuleConfig } } } + diff --git a/_generated/AzureFileCopyV3_Node20/task.json b/_generated/AzureFileCopyV3_Node20/task.json index 1e5c76f794c3..e4e5944944a5 100644 --- a/_generated/AzureFileCopyV3_Node20/task.json +++ b/_generated/AzureFileCopyV3_Node20/task.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 3, - "Minor": 231, - "Patch": 4 + "Minor": 234, + "Patch": 1 }, "demands": [ "azureps" @@ -317,7 +317,7 @@ "ExpiredServicePrincipal": "Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired." }, "_buildConfigMapping": { - "Default": "3.231.2", - "Node20_229_2": "3.231.4" + "Default": "3.234.0", + "Node20_229_2": "3.234.1" } } \ No newline at end of file diff --git a/_generated/AzureFileCopyV3_Node20/task.loc.json b/_generated/AzureFileCopyV3_Node20/task.loc.json index 23a22d208bda..36ea580d2c7c 100644 --- a/_generated/AzureFileCopyV3_Node20/task.loc.json +++ b/_generated/AzureFileCopyV3_Node20/task.loc.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 3, - "Minor": 231, - "Patch": 4 + "Minor": 234, + "Patch": 1 }, "demands": [ "azureps" @@ -317,7 +317,7 @@ "ExpiredServicePrincipal": "ms-resource:loc.messages.ExpiredServicePrincipal" }, "_buildConfigMapping": { - "Default": "3.231.2", - "Node20_229_2": "3.231.4" + "Default": "3.234.0", + "Node20_229_2": "3.234.1" } } \ No newline at end of file diff --git a/_generated/AzureFileCopyV4.versionmap.txt b/_generated/AzureFileCopyV4.versionmap.txt index de56ed7e38ca..362f1b910d7e 100644 --- a/_generated/AzureFileCopyV4.versionmap.txt +++ b/_generated/AzureFileCopyV4.versionmap.txt @@ -1,2 +1,2 @@ -Default|4.231.2 -Node20_229_2|4.231.4 +Default|4.234.0 +Node20_229_2|4.234.1 diff --git a/_generated/AzureFileCopyV4/AzureUtilityARM.ps1 b/_generated/AzureFileCopyV4/AzureUtilityARM.ps1 index e31f5c2bfd6d..cfb062ca9815 100644 --- a/_generated/AzureFileCopyV4/AzureUtilityARM.ps1 +++ b/_generated/AzureFileCopyV4/AzureUtilityARM.ps1 @@ -10,7 +10,14 @@ 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" - $azureStorageAccountResourceDetails = Get-AzureRmStorageAccount -ErrorAction Stop | Where-Object { $_.StorageAccountName -eq $storageAccountName } + if ($featureFlags.retireAzureRM) + { + $azureStorageAccountResourceDetails = Get-AzStorageAccount -ErrorAction Stop | Where-Object { $_.StorageAccountName -eq $storageAccountName } + } + else + { + $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 @@ -33,7 +40,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -50,7 +64,14 @@ function Create-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } } @@ -69,7 +90,14 @@ function Get-AzureContainer Write-Verbose "[Azure Call]Getting container: $containerName in storage account: $storageAccountName" try { - $container = Get-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = Get-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = Get-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } } catch { @@ -90,7 +118,14 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -104,7 +139,14 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -131,17 +173,38 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -150,15 +213,36 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -184,7 +268,14 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInMinutes minutes" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -199,7 +290,14 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } + else + { + $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -220,7 +318,15 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + $location -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { @@ -243,7 +349,14 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + if ($featureFlags.retireAzureRM) + { + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } + else + { + $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -265,7 +378,14 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -303,7 +423,14 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + if ($featureFlags.retireAzureRM) + { + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } + else + { + $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -320,11 +447,25 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + if ($featureFlags.retireAzureRM) + { + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } + else + { + $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + if ($featureFlags.retireAzureRM) + { + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } + else + { + $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -335,7 +476,14 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" @@ -354,3 +502,4 @@ function Add-NetworkSecurityRuleConfig } } } + diff --git a/_generated/AzureFileCopyV4/task.json b/_generated/AzureFileCopyV4/task.json index 842cd4ba305b..701be10f27d7 100644 --- a/_generated/AzureFileCopyV4/task.json +++ b/_generated/AzureFileCopyV4/task.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 4, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" @@ -301,7 +301,7 @@ "ServicePrincipalError": "There was an error with the service principal used for the deployment." }, "_buildConfigMapping": { - "Default": "4.231.2", - "Node20_229_2": "4.231.4" + "Default": "4.234.0", + "Node20_229_2": "4.234.1" } } \ No newline at end of file diff --git a/_generated/AzureFileCopyV4/task.loc.json b/_generated/AzureFileCopyV4/task.loc.json index 6c0b0432c6d2..9a2519d52649 100644 --- a/_generated/AzureFileCopyV4/task.loc.json +++ b/_generated/AzureFileCopyV4/task.loc.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 4, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" @@ -301,7 +301,7 @@ "ServicePrincipalError": "ms-resource:loc.messages.ServicePrincipalError" }, "_buildConfigMapping": { - "Default": "4.231.2", - "Node20_229_2": "4.231.4" + "Default": "4.234.0", + "Node20_229_2": "4.234.1" } } \ No newline at end of file diff --git a/_generated/AzureFileCopyV4_Node20/AzureUtilityARM.ps1 b/_generated/AzureFileCopyV4_Node20/AzureUtilityARM.ps1 index e31f5c2bfd6d..cfb062ca9815 100644 --- a/_generated/AzureFileCopyV4_Node20/AzureUtilityARM.ps1 +++ b/_generated/AzureFileCopyV4_Node20/AzureUtilityARM.ps1 @@ -10,7 +10,14 @@ 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" - $azureStorageAccountResourceDetails = Get-AzureRmStorageAccount -ErrorAction Stop | Where-Object { $_.StorageAccountName -eq $storageAccountName } + if ($featureFlags.retireAzureRM) + { + $azureStorageAccountResourceDetails = Get-AzStorageAccount -ErrorAction Stop | Where-Object { $_.StorageAccountName -eq $storageAccountName } + } + else + { + $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 @@ -33,7 +40,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -50,7 +64,14 @@ function Create-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } } @@ -69,7 +90,14 @@ function Get-AzureContainer Write-Verbose "[Azure Call]Getting container: $containerName in storage account: $storageAccountName" try { - $container = Get-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = Get-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = Get-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } } catch { @@ -90,7 +118,14 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -104,7 +139,14 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -131,17 +173,38 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -150,15 +213,36 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -184,7 +268,14 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInMinutes minutes" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -199,7 +290,14 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } + else + { + $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -220,7 +318,15 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + $location -ErrorAction Stop -Verbose Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { @@ -243,7 +349,14 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + if ($featureFlags.retireAzureRM) + { + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } + else + { + $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -265,7 +378,14 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -303,7 +423,14 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + if ($featureFlags.retireAzureRM) + { + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } + else + { + $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -320,11 +447,25 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + if ($featureFlags.retireAzureRM) + { + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } + else + { + $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + if ($featureFlags.retireAzureRM) + { + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } + else + { + $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -335,7 +476,14 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" @@ -354,3 +502,4 @@ function Add-NetworkSecurityRuleConfig } } } + diff --git a/_generated/AzureFileCopyV4_Node20/task.json b/_generated/AzureFileCopyV4_Node20/task.json index e121bdf00adf..9970abf53e84 100644 --- a/_generated/AzureFileCopyV4_Node20/task.json +++ b/_generated/AzureFileCopyV4_Node20/task.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 4, - "Minor": 231, - "Patch": 4 + "Minor": 234, + "Patch": 1 }, "demands": [ "azureps" @@ -305,7 +305,7 @@ "ServicePrincipalError": "There was an error with the service principal used for the deployment." }, "_buildConfigMapping": { - "Default": "4.231.2", - "Node20_229_2": "4.231.4" + "Default": "4.234.0", + "Node20_229_2": "4.234.1" } } \ No newline at end of file diff --git a/_generated/AzureFileCopyV4_Node20/task.loc.json b/_generated/AzureFileCopyV4_Node20/task.loc.json index 734c3af92ea7..656130296853 100644 --- a/_generated/AzureFileCopyV4_Node20/task.loc.json +++ b/_generated/AzureFileCopyV4_Node20/task.loc.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 4, - "Minor": 231, - "Patch": 4 + "Minor": 234, + "Patch": 1 }, "demands": [ "azureps" @@ -305,7 +305,7 @@ "ServicePrincipalError": "ms-resource:loc.messages.ServicePrincipalError" }, "_buildConfigMapping": { - "Default": "4.231.2", - "Node20_229_2": "4.231.4" + "Default": "4.234.0", + "Node20_229_2": "4.234.1" } } \ No newline at end of file diff --git a/_generated/AzureFileCopyV5.versionmap.txt b/_generated/AzureFileCopyV5.versionmap.txt index 512e00f0a058..093b5dc77f7a 100644 --- a/_generated/AzureFileCopyV5.versionmap.txt +++ b/_generated/AzureFileCopyV5.versionmap.txt @@ -1,2 +1,2 @@ -Default|5.231.2 -Node20_229_2|5.231.4 +Default|5.234.0 +Node20_229_2|5.234.1 diff --git a/_generated/AzureFileCopyV5/AzureUtilityARM.ps1 b/_generated/AzureFileCopyV5/AzureUtilityARM.ps1 index e31f5c2bfd6d..bc0b524ddd79 100644 --- a/_generated/AzureFileCopyV5/AzureUtilityARM.ps1 +++ b/_generated/AzureFileCopyV5/AzureUtilityARM.ps1 @@ -2,6 +2,10 @@ . "$PSScriptRoot/AzureUtilityRest.ps1" +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureStorageAccountResourceGroupName { param([string]$storageAccountName) @@ -10,7 +14,14 @@ 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" - $azureStorageAccountResourceDetails = Get-AzureRmStorageAccount -ErrorAction Stop | Where-Object { $_.StorageAccountName -eq $storageAccountName } + if ($featureFlags.retireAzureRM) + { + $azureStorageAccountResourceDetails = Get-AzStorageAccount -ErrorAction Stop | Where-Object { $_.StorageAccountName -eq $storageAccountName } + } + else + { + $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 @@ -33,7 +44,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -50,7 +68,14 @@ function Create-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } } @@ -69,7 +94,14 @@ function Get-AzureContainer Write-Verbose "[Azure Call]Getting container: $containerName in storage account: $storageAccountName" try { - $container = Get-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = Get-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = Get-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } } catch { @@ -90,7 +122,15 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -104,7 +144,14 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -131,17 +178,38 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -150,15 +218,36 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -184,7 +273,15 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInMinutes minutes" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -199,7 +296,14 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } + else + { + $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -220,7 +324,14 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { @@ -243,7 +354,14 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + if ($featureFlags.retireAzureRM) + { + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } + else + { + $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -265,7 +383,14 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -303,7 +428,14 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + if ($featureFlags.retireAzureRM) + { + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } + else + { + $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -320,11 +452,25 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + if ($featureFlags.retireAzureRM) + { + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } + else + { + $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + if ($featureFlags.retireAzureRM) + { + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } + else + { + $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -335,7 +481,14 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" @@ -354,3 +507,4 @@ function Add-NetworkSecurityRuleConfig } } } + diff --git a/_generated/AzureFileCopyV5/task.json b/_generated/AzureFileCopyV5/task.json index 558990b9e3b5..b0936d5efced 100644 --- a/_generated/AzureFileCopyV5/task.json +++ b/_generated/AzureFileCopyV5/task.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 5, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" @@ -301,7 +301,7 @@ "AzModuleNotFound": "Could not find the modules: 'Az.Accounts'. If the module was recently installed, retry after restarting the Azure Pipelines task agent." }, "_buildConfigMapping": { - "Default": "5.231.2", - "Node20_229_2": "5.231.4" + "Default": "5.234.0", + "Node20_229_2": "5.234.1" } } \ No newline at end of file diff --git a/_generated/AzureFileCopyV5/task.loc.json b/_generated/AzureFileCopyV5/task.loc.json index cbebf08b3294..8a0d2d93ffda 100644 --- a/_generated/AzureFileCopyV5/task.loc.json +++ b/_generated/AzureFileCopyV5/task.loc.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 5, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 0 }, "demands": [ "azureps" @@ -301,7 +301,7 @@ "AzModuleNotFound": "ms-resource:loc.messages.AzModuleNotFound" }, "_buildConfigMapping": { - "Default": "5.231.2", - "Node20_229_2": "5.231.4" + "Default": "5.234.0", + "Node20_229_2": "5.234.1" } } \ No newline at end of file diff --git a/_generated/AzureFileCopyV5_Node20/AzureUtilityARM.ps1 b/_generated/AzureFileCopyV5_Node20/AzureUtilityARM.ps1 index e31f5c2bfd6d..bc0b524ddd79 100644 --- a/_generated/AzureFileCopyV5_Node20/AzureUtilityARM.ps1 +++ b/_generated/AzureFileCopyV5_Node20/AzureUtilityARM.ps1 @@ -2,6 +2,10 @@ . "$PSScriptRoot/AzureUtilityRest.ps1" +$featureFlags = @{ + retireAzureRM = [System.Convert]::ToBoolean($env:RETIRE_AZURERM_POWERSHELL_MODULE) +} + function Get-AzureStorageAccountResourceGroupName { param([string]$storageAccountName) @@ -10,7 +14,14 @@ 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" - $azureStorageAccountResourceDetails = Get-AzureRmStorageAccount -ErrorAction Stop | Where-Object { $_.StorageAccountName -eq $storageAccountName } + if ($featureFlags.retireAzureRM) + { + $azureStorageAccountResourceDetails = Get-AzStorageAccount -ErrorAction Stop | Where-Object { $_.StorageAccountName -eq $storageAccountName } + } + else + { + $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 @@ -33,7 +44,14 @@ function Create-AzureStorageContext if(-not [string]::IsNullOrEmpty($storageAccountName) -and -not [string]::IsNullOrEmpty($storageAccountKey)) { Write-Verbose "[Azure Call]Creating AzureStorageContext for storage account: $storageAccountName" - $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $storageContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } + else + { + $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey -ErrorAction Stop + } Write-Verbose "[Azure Call]Created AzureStorageContext for storage account: $storageAccountName" return $storageContext @@ -50,7 +68,14 @@ function Create-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Creating container: $containerName in storage account: $storageAccountName" - $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = New-AzStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + } + else + { + $container = New-AzureStorageContainer -Name $containerName -Context $storageContext -Permission Off -ErrorAction Stop + } Write-Verbose "[Azure Call]Created container: $containerName successfully in storage account: $storageAccountName" } } @@ -69,7 +94,14 @@ function Get-AzureContainer Write-Verbose "[Azure Call]Getting container: $containerName in storage account: $storageAccountName" try { - $container = Get-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + if ($featureFlags.retireAzureRM) + { + $container = Get-AzStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } + else + { + $container = Get-AzureStorageContainer -Name $containerName -Context $storageContext -ErrorAction Stop + } } catch { @@ -90,7 +122,15 @@ function Remove-AzureContainer $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Deleting container: $containerName in storage account: $storageAccountName" - Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + if ($featureFlags.retireAzureRM) + { + Remove-AzStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + else + { + Remove-AzureStorageContainer -Name $containerName -Context $storageContext -Force -ErrorAction SilentlyContinue + } + Write-Verbose "[Azure Call]Deleted container: $containerName in storage account: $storageAccountName" } } @@ -104,7 +144,14 @@ function Get-AzureRMVMsInResourceGroup try { Write-Verbose "[Azure Call]Getting resource group:$resourceGroupName RM virtual machines type resources" - $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $azureRMVMResources = Get-AzVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $azureRMVMResources = Get-AzureRMVM -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Count of resource group:$resourceGroupName RM virtual machines type resource is $($azureRMVMResources.Count)" return $azureRMVMResources @@ -131,17 +178,38 @@ function Get-AzureRMResourceGroupResourcesDetails if(-not [string]::IsNullOrEmpty($resourceGroupName) -and $azureRMVMResources) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName" - $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $networkInterfaceResources = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $networkInterfaceResources = Get-AzureRMNetworkInterface -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" $azureRGResourcesDetails.Add("networkInterfaceResources", $networkInterfaceResources) Write-Verbose "[Azure Call]Getting public IP Addresses in resource group $resourceGroupName" - $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $publicIPAddressResources = Get-AzPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $publicIPAddressResources = Get-AzureRMPublicIpAddress -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got public IP Addresses in resource group $resourceGroupName" $azureRGResourcesDetails.Add("publicIPAddressResources", $publicIPAddressResources) Write-Verbose "[Azure Call]Getting load balancers in resource group $resourceGroupName" - $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $lbGroup = Get-AzLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $lbGroup = Get-AzureRMLoadBalancer -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancers in resource group $resourceGroupName" if($lbGroup) @@ -150,15 +218,36 @@ function Get-AzureRMResourceGroupResourcesDetails { $lbDetails = @{} Write-Verbose "[Azure Call]Getting load balancer in resource group $resourceGroupName" - $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $loadBalancer = Get-AzLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } + else + { + $loadBalancer = Get-AzureRMLoadBalancer -Name $lb.Name -ResourceGroupName $resourceGroupName -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got load balancer in resource group $resourceGroupName" Write-Verbose "[Azure Call]Getting LoadBalancer Frontend Ip Config" - $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $frontEndIPConfigs = Get-AzLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $frontEndIPConfigs = Get-AzureRMLoadBalancerFrontendIpConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got LoadBalancer Frontend Ip Config" Write-Verbose "[Azure Call]Getting Azure LoadBalancer Inbound NatRule Config" - $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $inboundRules = Get-AzLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } + else + { + $inboundRules = Get-AzureRMLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -ErrorAction Stop -Verbose + } Write-Verbose "[Azure Call]Got Azure LoadBalancer Inbound NatRule Config" $lbDetails.Add("frontEndIPConfigs", $frontEndIPConfigs) @@ -184,7 +273,15 @@ function Generate-AzureStorageContainerSASToken $storageAccountName = $storageContext.StorageAccountName Write-Verbose "[Azure Call]Generating SasToken for container: $containerName in storage: $storageAccountName with expiry time: $tokenTimeOutInMinutes minutes" - $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + if ($featureFlags.retireAzureRM) + { + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } + else + { + $containerSasToken = New-AzureStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl + } + $containerSasToken = New-AzStorageContainerSASToken -Name $containerName -ExpiryTime (Get-Date).AddMinutes($tokenTimeOutInMinutes) -Context $storageContext -Permission rwdl Write-Verbose "[Azure Call]Generated SasToken: $containerSasToken successfully for container: $containerName in storage: $storageAccountName" return $containerSasToken @@ -199,7 +296,14 @@ function Get-AzureMachineStatus if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($name)) { Write-Host (Get-VstsLocString -Key "AFC_GetVMStatus" -ArgumentList $name) - $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $status = Get-AzVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } + else + { + $status = Get-AzureRmVM -ResourceGroupName $resourceGroupName -Name $name -Status -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_GetVMStatusComplete" -ArgumentList $name) } @@ -220,7 +324,14 @@ function Set-AzureMachineCustomScriptExtension { Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtension" -ArgumentList $name, $vmName) Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" - $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + if ($featureFlags.retireAzureRM) + { + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } + else + { + $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { @@ -243,7 +354,14 @@ function Get-NetworkSecurityGroups if(-not [string]::IsNullOrEmpty($resourceGroupName) -and -not [string]::IsNullOrEmpty($vmId)) { Write-Verbose "[Azure Call]Getting network interfaces in resource group $resourceGroupName for vm $vmId" - $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + if ($featureFlags.retireAzureRM) + { + $networkInterfaces = Get-AzNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } + else + { + $networkInterfaces = Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName | Where-Object { $_.VirtualMachine.Id -eq $vmId } + } Write-Verbose "[Azure Call]Got network interfaces in resource group $resourceGroupName" if($networkInterfaces) @@ -265,7 +383,14 @@ function Get-NetworkSecurityGroups # Get the network security group object Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $sgResourceGroup" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $sgResourceGroup -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $sgResourceGroup" $securityGroups.Add($securityGroup) @@ -303,7 +428,14 @@ function Add-NetworkSecurityRuleConfig $winRMConfigRule = $null Write-Verbose "[Azure Call]Getting network security rule config $ruleName under security group $securityGroupName" - $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + if ($featureFlags.retireAzureRM) + { + $winRMConfigRule = Get-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } + else + { + $winRMConfigRule = Get-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -EA SilentlyContinue + } Write-Verbose "[Azure Call]Got network security rule config $ruleName under security group $securityGroupName" } catch @@ -320,11 +452,25 @@ function Add-NetworkSecurityRuleConfig try { Write-Verbose "[Azure Call]Adding inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" - $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + if ($featureFlags.retireAzureRM) + { + $securityGroup = Add-AzNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } + else + { + $securityGroup = Add-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $securityGroup -Name $ruleName -Direction Inbound -Access Allow -SourceAddressPrefix '*' -SourcePortRange '*' -DestinationAddressPrefix '*' -DestinationPortRange $winrmHttpsPort -Protocol * -Priority $rulePriotity + } Write-Verbose "[Azure Call]Added inbound network security rule config $ruleName with priority $rulePriotity for port $winrmHttpsPort under security group $securityGroupName" Write-Verbose "[Azure Call]Setting the azure network security group" - $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + if ($featureFlags.retireAzureRM) + { + $result = Set-AzNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } + else + { + $result = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $securityGroup + } Write-Verbose "[Azure Call]Set the azure network security group" } catch @@ -335,7 +481,14 @@ function Add-NetworkSecurityRuleConfig $rulePriotity = $newPort.ToString() Write-Verbose "[Azure Call]Getting network security group $securityGroupName in resource group $resourceGroupName" - $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + if ($featureFlags.retireAzureRM) + { + $securityGroup = Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } + else + { + $securityGroup = Get-AzureRmNetworkSecurityGroup -ResourceGroupName $resourceGroupName -Name $securityGroupName + } Write-Verbose "[Azure Call]Got network security group $securityGroupName in resource group $resourceGroupName" @@ -354,3 +507,4 @@ function Add-NetworkSecurityRuleConfig } } } + diff --git a/_generated/AzureFileCopyV5_Node20/task.json b/_generated/AzureFileCopyV5_Node20/task.json index 2e8e6d5c22cc..a529951c904d 100644 --- a/_generated/AzureFileCopyV5_Node20/task.json +++ b/_generated/AzureFileCopyV5_Node20/task.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 5, - "Minor": 231, - "Patch": 4 + "Minor": 234, + "Patch": 1 }, "demands": [ "azureps" @@ -305,7 +305,7 @@ "AzModuleNotFound": "Could not find the modules: 'Az.Accounts'. If the module was recently installed, retry after restarting the Azure Pipelines task agent." }, "_buildConfigMapping": { - "Default": "5.231.2", - "Node20_229_2": "5.231.4" + "Default": "5.234.0", + "Node20_229_2": "5.234.1" } } \ No newline at end of file diff --git a/_generated/AzureFileCopyV5_Node20/task.loc.json b/_generated/AzureFileCopyV5_Node20/task.loc.json index 49ca60f27f4f..a9abd9253ec4 100644 --- a/_generated/AzureFileCopyV5_Node20/task.loc.json +++ b/_generated/AzureFileCopyV5_Node20/task.loc.json @@ -13,8 +13,8 @@ "author": "Microsoft Corporation", "version": { "Major": 5, - "Minor": 231, - "Patch": 4 + "Minor": 234, + "Patch": 1 }, "demands": [ "azureps" @@ -305,7 +305,7 @@ "AzModuleNotFound": "ms-resource:loc.messages.AzModuleNotFound" }, "_buildConfigMapping": { - "Default": "5.231.2", - "Node20_229_2": "5.231.4" + "Default": "5.234.0", + "Node20_229_2": "5.234.1" } } \ No newline at end of file diff --git a/_generated/AzurePowerShellV4.versionmap.txt b/_generated/AzurePowerShellV4.versionmap.txt index cc4d9a107c52..362f1b910d7e 100644 --- a/_generated/AzurePowerShellV4.versionmap.txt +++ b/_generated/AzurePowerShellV4.versionmap.txt @@ -1,2 +1,2 @@ -Default|4.231.0 -Node20_229_2|4.231.2 +Default|4.234.0 +Node20_229_2|4.234.1 diff --git a/_generated/AzurePowerShellV4/AzurePowerShell.ps1 b/_generated/AzurePowerShellV4/AzurePowerShell.ps1 new file mode 100644 index 000000000000..1212b0efaa6e --- /dev/null +++ b/_generated/AzurePowerShellV4/AzurePowerShell.ps1 @@ -0,0 +1,298 @@ +Trace-VstsEnteringInvocation $MyInvocation +Import-VstsLocStrings "$PSScriptRoot\Task.json" + +# Get inputs. +$scriptType = Get-VstsInput -Name ScriptType -Require +$scriptPath = Get-VstsInput -Name ScriptPath +$scriptInline = Get-VstsInput -Name Inline +$scriptArguments = Get-VstsInput -Name ScriptArguments +$__vsts_input_errorActionPreference = Get-VstsInput -Name errorActionPreference +$__vsts_input_failOnStandardError = Get-VstsInput -Name FailOnStandardError -AsBool +$targetAzurePs = Get-VstsInput -Name TargetAzurePs +$customTargetAzurePs = Get-VstsInput -Name CustomTargetAzurePs +$input_pwsh = Get-VstsInput -Name pwsh -AsBool +$input_workingDirectory = Get-VstsInput -Name workingDirectory -Require +$restrictContext = Get-VstsInput -Name RestrictContextToCurrentTask -AsBool +$validateScriptSignature = Get-VstsInput -Name validateScriptSignature -AsBool + +Write-Host "## Validating Inputs" +# Validate the script path and args do not contains new-lines. Otherwise, it will +# break invoking the script via Invoke-Expression. +if ($scriptType -eq "FilePath") { + if ($scriptPath -match '[\r\n]' -or [string]::IsNullOrWhitespace($scriptPath)) { + throw (Get-VstsLocString -Key InvalidScriptPath0 -ArgumentList $scriptPath) + } +} + +if ($scriptArguments -match '[\r\n]') { + throw (Get-VstsLocString -Key InvalidScriptArguments0 -ArgumentList $scriptArguments) +} + +# string constants +$otherVersion = "OtherVersion" +$latestVersion = "LatestVersion" + +if ($targetAzurePs -eq $otherVersion) { + if ($customTargetAzurePs -eq $null) { + throw (Get-VstsLocString -Key InvalidAzurePsVersion $customTargetAzurePs) + } else { + $targetAzurePs = $customTargetAzurePs.Trim() + } +} + +$pattern = "^[0-9]+\.[0-9]+\.[0-9]+$" +$regex = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList $pattern + +if ($targetAzurePs -eq $latestVersion) { + $targetAzurePs = "" +} elseif (-not($regex.IsMatch($targetAzurePs))) { + throw (Get-VstsLocString -Key InvalidAzurePsVersion -ArgumentList $targetAzurePs) +} +Write-Host "## Validating Inputs Complete" + +. $PSScriptRoot\TryMakingModuleAvailable.ps1 -targetVersion "$targetAzurePs" -platform Windows + +if ($validateScriptSignature) { + try { + if ($scriptType -ne "InlineScript") { + Write-Host "## Validating Script Signature" + + # Validate script is signed + $scriptSignature = Get-AuthenticodeSignature $scriptPath + if ($scriptSignature.Status -eq "NotSigned") { + throw "Object does not have a digital signature. Please ensure your script is signed and try again." + } + elseif ($scriptSignature.Status -ne "Valid") { + throw "Digital signature of the object did not verify. Please ensure your script is properly signed and try again." + } + + Write-Host "## Validating Script Signature Complete" + } + } + catch + { + $errorMsg = $_.Exception.Message + throw "Unable to validate script signature: $errorMsg" + } +} + +Write-Host "## Initializing Az module" +. "$PSScriptRoot\Utility.ps1" + +$serviceName = Get-VstsInput -Name ConnectedServiceNameARM -Require +$endpoint = Get-VstsEndpoint -Name $serviceName -Require +CleanUp-PSModulePathForHostedAgent +Update-PSModulePathForHostedAgent -targetAzurePs $targetAzurePs +$vstsEndpoint = Get-VstsEndpoint -Name SystemVssConnection -Require +$vstsAccessToken = $vstsEndpoint.auth.parameters.AccessToken + +# troubleshoot link +$troubleshoot = "https://aka.ms/azurepowershelltroubleshooting" +try +{ + # Initialize Azure. + Import-Module $PSScriptRoot\ps_modules\VstsAzureHelpers_ + $encryptedToken = ConvertTo-SecureString $vstsAccessToken -AsPlainText -Force + Initialize-AzModule -Endpoint $endpoint -connectedServiceNameARM $serviceName ` + -azVersion $targetAzurePs -encryptedToken $encryptedToken -isPSCore $input_pwsh + Write-Host "## Az module initialization Complete" + $success = $true +} +finally { + if (!$success) { + Write-VstsTaskError "Initializing Az module failed: For troubleshooting, refer: $troubleshoot" + } +} + +Write-Host "## Beginning Script Execution" +try { + if ($input_pwsh) + { + # Generate the script contents. + Write-Host (Get-VstsLocString -Key 'GeneratingScript') + $UpdatePSModulePathArgument = $null; + if ($targetAzurePs) + { + $UpdatePSModulePathArgument = "-targetAzurePs $targetAzurePs" + } + + $contents = @() + $contents += "`$ErrorActionPreference = '$__vsts_input_errorActionPreference'" + if ($env:system_debug -eq "true") { + $contents += "`$VerbosePreference = 'continue'" + } + + $contents += ". '$PSScriptRoot\UpdatePSModulePath.ps1' $UpdatePSModulePathArgument" + if ($scriptType -eq "InlineScript") { + $contents += "$scriptInline".Replace("`r`n", "`n").Replace("`n", "`r`n") + } else { + $contents += ". '$("$scriptPath".Replace("'", "''"))' $scriptArguments".Trim() + } + + # Write the script to disk. + $__vstsAzPSScriptPath = [System.IO.Path]::Combine($env:Agent_TempDirectory, ([guid]::NewGuid().ToString() + ".ps1")); + $joinedContents = [System.String]::Join( + ([System.Environment]::NewLine), + $contents) + $null = [System.IO.File]::WriteAllText( + $__vstsAzPSScriptPath, + $joinedContents, + ([System.Text.Encoding]::UTF8)) + + # Prepare the external command values. + # + # Note, use "-Command" instead of "-File". On PowerShell v4 and V3 when using "-File", terminating + # errors do not cause a non-zero exit code. + if ($input_pwsh) { + $powershellPath = Get-Command -Name pwsh.exe -CommandType Application | Select-Object -First 1 -ExpandProperty Path + } else { + $powershellPath = Get-Command -Name powershell.exe -CommandType Application | Select-Object -First 1 -ExpandProperty Path + } + Assert-VstsPath -LiteralPath $powershellPath -PathType 'Leaf' + $arguments = "-NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command `". '$($__vstsAzPSScriptPath.Replace("'", "''"))'`"" + $splat = @{ + 'FileName' = $powershellPath + 'Arguments' = $arguments + 'WorkingDirectory' = $input_workingDirectory + } + + # Switch to "Continue". + $global:ErrorActionPreference = 'Continue' + $failed = $false + + # Run the script. + Write-Host '========================== Starting Command Output ===========================' + if (!$__vsts_input_failOnStandardError) { + Invoke-VstsTool @splat + } + else { + $inError = $false + $errorLines = New-Object System.Text.StringBuilder + Invoke-VstsTool @splat 2>&1 | + ForEach-Object { + if ($_ -is [System.Management.Automation.ErrorRecord]) { + # Buffer the error lines. + $failed = $true + $inError = $true + $null = $errorLines.AppendLine("$($_.Exception.Message)") + + # Write to verbose to mitigate if the process hangs. + Write-Verbose "STDERR: $($_.Exception.Message)" + } else { + # Flush the error buffer. + if ($inError) { + $inError = $false + $message = $errorLines.ToString().Trim() + $null = $errorLines.Clear() + if ($message) { + Write-VstsTaskError -Message $message + } + } + + Write-Host "$_" + } + } + + # Flush the error buffer one last time. + if ($inError) { + $inError = $false + $message = $errorLines.ToString().Trim() + $null = $errorLines.Clear() + if ($message) { + Write-VstsTaskError -Message $message + } + } + } + + # Fail if any errors. + if ($failed) { + Write-VstsSetResult -Result 'Failed' -Message "Error detected" -DoNotThrow + } + } + else + { + # Trace the expression as it will be invoked. + $__vstsAzPSInlineScriptPath = $null + If ($scriptType -eq "InlineScript") { + $scriptArguments = $null + $__vstsAzPSInlineScriptPath = [System.IO.Path]::Combine($env:Agent_TempDirectory, ([guid]::NewGuid().ToString() + ".ps1")); + ($scriptInline | Out-File $__vstsAzPSInlineScriptPath) + $scriptPath = $__vstsAzPSInlineScriptPath + } + + $scriptCommand = "& '$($scriptPath.Replace("'", "''"))' $scriptArguments" + Remove-Variable -Name scriptType + Remove-Variable -Name scriptPath + Remove-Variable -Name scriptInline + Remove-Variable -Name scriptArguments + + # Remove all commands imported from VstsTaskSdk, other than Out-Default. + # Remove all commands imported from VstsAzureHelpers_. + Get-ChildItem -LiteralPath function: | + Where-Object { + ($_.ModuleName -eq 'VstsTaskSdk' -and $_.Name -ne 'Out-Default') -or + ($_.Name -eq 'Invoke-VstsTaskScript') -or + ($_.ModuleName -eq 'VstsAzureHelpers_' ) + } | + Remove-Item + + # For compatibility with the legacy handler implementation, set the error action + # preference to continue. An implication of changing the preference to Continue, + # is that Invoke-VstsTaskScript will no longer handle setting the result to failed. + $global:ErrorActionPreference = 'Continue' + + # Undocumented VstsTaskSdk variable so Verbose/Debug isn't converted to ##vso[task.debug]. + # Otherwise any content the ad-hoc script writes to the verbose pipeline gets dropped by + # the agent when System.Debug is not set. + $global:__vstsNoOverrideVerbose = $true + + # Run the user's script. Redirect the error pipeline to the output pipeline to enable + # a couple goals due to compatibility with the legacy handler implementation: + # 1) STDERR from external commands needs to be converted into error records. Piping + # the redirected error output to an intermediate command before it is piped to + # Out-Default will implicitly perform the conversion. + # 2) The task result needs to be set to failed if an error record is encountered. + # As mentioned above, the requirement to handle this is an implication of changing + # the error action preference. + ([scriptblock]::Create($scriptCommand)) | + ForEach-Object { + Remove-Variable -Name scriptCommand + Write-Host "##[command]$_" + . $_ 2>&1 + } | + ForEach-Object { + if($_ -is [System.Management.Automation.ErrorRecord]) { + if($_.FullyQualifiedErrorId -eq "NativeCommandError" -or $_.FullyQualifiedErrorId -eq "NativeCommandErrorMessage") { + ,$_ + if($__vsts_input_failOnStandardError -eq $true) { + "##vso[task.complete result=Failed]" + } + } + else { + if($__vsts_input_errorActionPreference -eq "continue") { + ,$_ + if($__vsts_input_failOnStandardError -eq $true) { + "##vso[task.complete result=Failed]" + } + } + elseif($__vsts_input_errorActionPreference -eq "stop") { + throw $_ + } + } + } else { + ,$_ + } + } + } + +} +finally { + if ($__vstsAzPSInlineScriptPath -and (Test-Path -LiteralPath $__vstsAzPSInlineScriptPath) ) { + Remove-Item -LiteralPath $__vstsAzPSInlineScriptPath -ErrorAction 'SilentlyContinue' + } + + Import-Module $PSScriptRoot\ps_modules\VstsAzureHelpers_ + Remove-EndpointSecrets + Disconnect-AzureAndClearContext -restrictContext $restrictContext -ErrorAction SilentlyContinue +} +Write-Host "## Script Execution Complete" \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/InitializeAz.ps1 b/_generated/AzurePowerShellV4/InitializeAz.ps1 new file mode 100644 index 000000000000..076d87fe029c --- /dev/null +++ b/_generated/AzurePowerShellV4/InitializeAz.ps1 @@ -0,0 +1,107 @@ +[CmdletBinding()] +param +( + [String] [Parameter(Mandatory = $true)] + $endpoint, + + [String] [Parameter(Mandatory = $false)] + $targetAzurePs +) + +$endpointObject = ConvertFrom-Json $endpoint +$moduleName = "Az.Accounts" +$environmentName = $endpointObject.environment + +. "$PSScriptRoot/Utility.ps1" +Update-PSModulePathForHostedAgentLinux -targetAzurePs $targetAzurePs + +if($targetAzurePs -eq ""){ + $module = Get-Module -Name $moduleName -ListAvailable | Sort-Object Version -Descending | Select-Object -First 1 +} +else{ + $modules = Get-Module -Name $moduleName -ListAvailable + foreach ($moduleVal in $modules) { + # $moduleVal.Path will have value like /usr/local/share/powershell/Modules/Az.Accounts/1.2.1/Az.Accounts.psd1 + $azModulePath = Split-Path (Split-Path (Split-Path $moduleVal.Path -Parent) -Parent) -Parent + $azModulePath = $azModulePath + "/Az/*" + $azModuleVersion = split-path -path $azModulePath -Leaf -Resolve + if($azModuleVersion -eq $targetAzurePs) { + $module = $moduleVal + break + } + } +} + +if (!$module) { + # Will handle localization later + Write-Verbose "No module found with name: $moduleName" + throw ("Could not find the module Az.Accounts with given version. If the module was recently installed, retry after restarting the Azure Pipelines task agent.") +} + +# Import the module. +Write-Host "##[command]Import-Module -Name $($module.Path) -Global" +$module = Import-Module -Name $module.Path -Global -PassThru -Force + +# Clear context +Write-Host "##[command]Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue" +$null = Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue +Write-Host "##[command]Clear-AzContext -Scope Process" +$null = Clear-AzContext -Scope Process + +$scopeLevel = "Subscription" +if($endpointObject.scopeLevel) { + $scopeLevel = $endpointObject.scopeLevel +} +$processScope = @{ Scope = "Process" } + +function Format-Splat { + [CmdletBinding()] + param([Parameter(Mandatory = $true)][hashtable]$Hashtable) + + # Collect the parameters (names and values) in an array. + $parameters = foreach ($key in $Hashtable.Keys) { + $value = $Hashtable[$key] + # If the value is a bool, format the parameter as a switch (ending with ':'). + if ($value -is [bool]) { "-$($key):" } else { "-$key" } + $value + } + + "$parameters" # String join the array. +} + +if ($endpointObject.scheme -eq 'ServicePrincipal') { + try { + if ($endpointObject.authenticationType -ieq 'SPNKey') { + $psCredential = New-Object System.Management.Automation.PSCredential( + $endpointObject.servicePrincipalClientID, + (ConvertTo-SecureString $endpointObject.servicePrincipalKey -AsPlainText -Force)) + Write-Host "##[command]Connect-AzAccount -ServicePrincipal -Tenant $($endpointObject.tenantId) -Credential $psCredential -Environment $environmentName @processScope" + $null = Connect-AzAccount -ServicePrincipal -Tenant $endpointObject.tenantId ` + -Credential $psCredential ` + -Environment $environmentName @processScope -WarningAction SilentlyContinue + } + else { + # Provide an additional, custom, credentials-related error message. Will handle localization later + throw ("Only SPN credential auth scheme is supported for non windows agent.") + } + } + catch { + # Provide an additional, custom, credentials-related error message. Will handle localization later + Write-Host "Exception is : $($_.Exception.Message)" + throw (New-Object System.Exception("There was an error with the service principal used for the deployment.", $_.Exception)) + } + + if($scopeLevel -eq "Subscription") + { + $SubscriptionId = $endpointObject.subscriptionId + $TenantId = $endpointObject.tenantId + $additional = @{ TenantId = $TenantId } + + Write-Host "##[command] Set-AzContext -SubscriptionId $SubscriptionId $(Format-Splat $additional)" + $null = Set-AzContext -SubscriptionId $SubscriptionId @additional + } +} +else { + # Provide an additional, custom, credentials-related error message. Will handle localization later + throw ("Only SPN credential auth scheme is supported for non windows agent.") +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Strings/resources.resjson/de-DE/resources.resjson b/_generated/AzurePowerShellV4/Strings/resources.resjson/de-DE/resources.resjson new file mode 100644 index 000000000000..44d372e42cb4 --- /dev/null +++ b/_generated/AzurePowerShellV4/Strings/resources.resjson/de-DE/resources.resjson @@ -0,0 +1,43 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[Weitere Informationen zu dieser Aufgabe](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "PowerShell-Skript innerhalb einer Azure-Umgebung ausführen", + "loc.instanceNameFormat": "Azure PowerShell-Skript: $(ScriptType)", + "loc.releaseNotes": "Unterstützung für Az-Modul und plattformübergreifende Agents hinzugefügt.", + "loc.group.displayName.AzurePowerShellVersionOptions": "Azure PowerShell-Versionsoptionen", + "loc.group.displayName.advanced": "Erweitert", + "loc.input.label.ConnectedServiceNameARM": "Azure-Abonnement", + "loc.input.help.ConnectedServiceNameARM": "Azure Resource Manager-Abonnement, das vor dem Ausführen von PowerShell konfiguriert wird.", + "loc.input.label.ScriptType": "Skripttyp", + "loc.input.help.ScriptType": "Der Typ des Skripts: Dateipfad oder Inlineskript.", + "loc.input.label.ScriptPath": "Skriptpfad", + "loc.input.help.ScriptPath": "Der Pfad des Skripts. Es muss sich um den vollqualifizierten Pfad oder einen Pfad relativ zum Standardarbeitsverzeichnis handeln.", + "loc.input.label.Inline": "Inlineskript", + "loc.input.help.Inline": "Geben Sie das Skript ein, das ausgeführt werden soll.", + "loc.input.label.ScriptArguments": "Skriptargumente", + "loc.input.help.ScriptArguments": "Zusätzliche Argumente, die an PowerShell übergeben werden sollen. Entweder Ordnungszahl- oder benannte Parameter.", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "Wählen Sie den Wert der Variablen \"ErrorActionPreference\" für die Skriptausführung.", + "loc.input.label.FailOnStandardError": "Fehler bei Standardfehler.", + "loc.input.help.FailOnStandardError": "Wenn dieser Wert TRUE ist, tritt ein Aufgabenfehler auf, wenn Fehler in die Fehlerpipeline oder Daten in den Standard-Fehlerdatenstrom geschrieben werden.", + "loc.input.label.RestrictContextToCurrentTask": "Kontextbereich auf aktuelle Aufgabe beschränken", + "loc.input.help.RestrictContextToCurrentTask": "Wenn diese Option auf TRUE festgelegt ist, beschränkt diese Aufgabe den Kontextbereich nur auf die aktuelle Aufgabe, und der Kontext steht bei Verwendung des privaten Agents für andere Aufgaben in der Pipeline nicht zur Verfügung.", + "loc.input.label.TargetAzurePs": "Azure PowerShell-Version", + "loc.input.help.TargetAzurePs": "Im Falle gehosteter Agents werden die folgenden Azure PowerShell-Versionen unterstützt: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0 (gehostete VS2017-Warteschlange).\nWenn Sie die neueste für den Agent verfügbare Version auswählen möchten, wählen Sie \"Neueste installierte Version\" aus.\n\nFür private Agents können Sie mithilfe von \"Version angeben\" die bevorzugte Version von Azure PowerShell festlegen.", + "loc.input.label.CustomTargetAzurePs": "Bevorzugte Azure PowerShell-Version", + "loc.input.help.CustomTargetAzurePs": "Die bevorzugte Azure PowerShell-Version muss einem ordnungsgemäßen semantischen Versionsmuster folgen, z. B. \"1.2.3\". Reguläre Ausdrücke wie 2.\\*,2.3.\\* werden nicht unterstützt. Der gehostete VS2017-Pool unterstützt aktuell die folgenden Az-Modulversionen: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0", + "loc.input.label.pwsh": "PowerShell Core verwenden", + "loc.input.help.pwsh": "Sofern TRUE, verwendet die Aufgabe unter Windows anstelle von \"powershell.exe\" die in PATH festgelegte \"pwsh.exe\".", + "loc.input.label.validateScriptSignature": "Skriptsignatur überprüfen", + "loc.input.help.validateScriptSignature": "Wenn dies der Fall ist, überprüft die Aufgabe zunächst, ob das angegebene Skript signiert und gültig ist, bevor es ausgeführt wird.", + "loc.input.label.workingDirectory": "Arbeitsverzeichnis", + "loc.input.help.workingDirectory": "Arbeitsverzeichnis zum Ausführen des Skripts.", + "loc.messages.GeneratingScript": "Skript wird erstellt.", + "loc.messages.JS_FormattedCommand": "Formatierter Befehl: %s", + "loc.messages.InvalidScriptArguments0": "Ungültige Skriptargumente \"{0}\". Zeilenumbrüche sind unzulässig.", + "loc.messages.InvalidScriptPath0": "Ungültiger Skriptpfad \"{0}\". Es wurden ungültige Pfadzeichen angegeben.", + "loc.messages.InvalidAzurePsVersion": "Die angegebene Azure PowerShell-Version \"{0}\" weist nicht das richtige Format auf. Überprüfen Sie das Format. Ein Beispiel für das richtige Format ist etwa 1.0.1.", + "loc.messages.JS_ExitCode": "PowerShell wurde beendet mit dem Code \"%s\".", + "loc.messages.JS_Stderr": "PowerShell hat mindestens eine Zeile in den Standardfehlerstream geschrieben.", + "loc.messages.ExpiredServicePrincipal": "Das Zugriffstoken für Azure konnte nicht abgerufen werden. Stellen Sie sicher, dass der verwendete Dienstprinzipal gültig und nicht abgelaufen ist." +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Strings/resources.resjson/en-US/resources.resjson b/_generated/AzurePowerShellV4/Strings/resources.resjson/en-US/resources.resjson new file mode 100644 index 000000000000..5357601c22f5 --- /dev/null +++ b/_generated/AzurePowerShellV4/Strings/resources.resjson/en-US/resources.resjson @@ -0,0 +1,43 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "Run a PowerShell script within an Azure environment", + "loc.instanceNameFormat": "Azure PowerShell script: $(ScriptType)", + "loc.releaseNotes": "Added support for Az Module and cross platform agents.", + "loc.group.displayName.AzurePowerShellVersionOptions": "Azure PowerShell version options", + "loc.group.displayName.advanced": "Advanced", + "loc.input.label.ConnectedServiceNameARM": "Azure Subscription", + "loc.input.help.ConnectedServiceNameARM": "Azure Resource Manager subscription to configure before running PowerShell", + "loc.input.label.ScriptType": "Script Type", + "loc.input.help.ScriptType": "Type of the script: File Path or Inline Script", + "loc.input.label.ScriptPath": "Script Path", + "loc.input.help.ScriptPath": "Path of the script. Should be fully qualified path or relative to the default working directory.", + "loc.input.label.Inline": "Inline Script", + "loc.input.help.Inline": "Enter the script to execute.", + "loc.input.label.ScriptArguments": "Script Arguments", + "loc.input.help.ScriptArguments": "Additional parameters to pass to PowerShell. Can be either ordinal or named parameters.", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "Select the value of the ErrorActionPreference variable for executing the script.", + "loc.input.label.FailOnStandardError": "Fail on Standard Error", + "loc.input.help.FailOnStandardError": "If this is true, this task will fail if any errors are written to the error pipeline, or if any data is written to the Standard Error stream.", + "loc.input.label.RestrictContextToCurrentTask": "Restrict scope of context to current task", + "loc.input.help.RestrictContextToCurrentTask": "If this is true, this task will restrict the scope of context to current task only and the context will not be available to other tasks in the pipeline when using private agent.", + "loc.input.label.TargetAzurePs": "Azure PowerShell Version", + "loc.input.help.TargetAzurePs": "In case of hosted agents, the supported Azure PowerShell Version is: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0 (Hosted VS2017 Queue).\nTo pick the latest version available on the agent, select \"Latest installed version\".\n\nFor private agents you can specify preferred version of Azure PowerShell using \"Specify version\"", + "loc.input.label.CustomTargetAzurePs": "Preferred Azure PowerShell Version", + "loc.input.help.CustomTargetAzurePs": "Preferred Azure PowerShell Version needs to be a proper semantic version eg. 1.2.3. Regex like 2.\\*,2.3.\\* is not supported. The Hosted VS2017 Pool currently supports Az module version: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0", + "loc.input.label.pwsh": "Use PowerShell Core", + "loc.input.help.pwsh": "If this is true, then on Windows the task will use pwsh.exe from your PATH instead of powershell.exe.", + "loc.input.label.validateScriptSignature": "Validate script signature", + "loc.input.help.validateScriptSignature": "If this is true, then the task will first check to make sure specified script is signed and valid before executing it.", + "loc.input.label.workingDirectory": "Working Directory", + "loc.input.help.workingDirectory": "Working directory where the script is run.", + "loc.messages.GeneratingScript": "Generating script.", + "loc.messages.JS_FormattedCommand": "Formatted command: %s", + "loc.messages.InvalidScriptArguments0": "Invalid script arguments '{0}'. Line breaks are not allowed.", + "loc.messages.InvalidScriptPath0": "Invalid script path '{0}'. Invalid path characters specified.", + "loc.messages.InvalidAzurePsVersion": "The Azure PowerShell version '{0}' specified is not in the correct format. Please check the format. An example of correct format is 1.0.1", + "loc.messages.JS_ExitCode": "PowerShell exited with code '%s'.", + "loc.messages.JS_Stderr": "PowerShell wrote one or more lines to the standard error stream.", + "loc.messages.ExpiredServicePrincipal": "Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired." +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Strings/resources.resjson/es-ES/resources.resjson b/_generated/AzurePowerShellV4/Strings/resources.resjson/es-ES/resources.resjson new file mode 100644 index 000000000000..9f596d3fdf27 --- /dev/null +++ b/_generated/AzurePowerShellV4/Strings/resources.resjson/es-ES/resources.resjson @@ -0,0 +1,43 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[Obtener más información acerca de esta tarea](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "Ejecutar un script de PowerShell en un entorno de Azure", + "loc.instanceNameFormat": "Script de Azure PowerShell: $(ScriptType)", + "loc.releaseNotes": "Se ha agregado compatibilidad con el módulo Az y los agentes multiplataforma.", + "loc.group.displayName.AzurePowerShellVersionOptions": "Opciones de versión de Azure PowerShell", + "loc.group.displayName.advanced": "Avanzado", + "loc.input.label.ConnectedServiceNameARM": "Suscripción a Azure", + "loc.input.help.ConnectedServiceNameARM": "Suscripción de Azure Resource Manager para configurar antes de ejecutar PowerShell", + "loc.input.label.ScriptType": "Tipo de script", + "loc.input.help.ScriptType": "Tipo del script: ruta de acceso del archivo o script en línea", + "loc.input.label.ScriptPath": "Ruta de acceso del script", + "loc.input.help.ScriptPath": "Ruta de acceso del script. Debe ser una ruta de acceso completa o relativa al directorio de trabajo predeterminado.", + "loc.input.label.Inline": "Script alineado", + "loc.input.help.Inline": "Escriba el script que se va a ejecutar.", + "loc.input.label.ScriptArguments": "Argumentos de script", + "loc.input.help.ScriptArguments": "Parámetros adicionales que pasar a PowerShell. Pueden ser parámetros ordinales o con nombre.", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "Seleccione el valor de la variable ErrorActionPreference para ejecutar el script.", + "loc.input.label.FailOnStandardError": "Error si se produce un error estándar", + "loc.input.help.FailOnStandardError": "Si es true, se producirá un error en la tarea si se escriben errores en la canalización de errores o si se escriben datos en el flujo de error estándar.", + "loc.input.label.RestrictContextToCurrentTask": "Restringir el ámbito de contexto a la tarea actual", + "loc.input.help.RestrictContextToCurrentTask": "Si es true, esta tarea restringirá el ámbito de contexto solo a la tarea actual y el contexto no estará disponible para otras tareas de la canalización cuando se use el agente privado.", + "loc.input.label.TargetAzurePs": "Versión de Azure PowerShell", + "loc.input.help.TargetAzurePs": "En el caso de los agentes hospedados, las versiones de Azure PowerShell admitidas son 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0 (Hosted VS2017 Queue).\nPara seleccionar la última versión disponible en el agente, seleccione \"Latest installed version\".\n\nPara los agentes privados, puede especificar la versión de Azure PowerShell que prefiera con la opción \"Specify version\"", + "loc.input.label.CustomTargetAzurePs": "Versión de Azure PowerShell preferida", + "loc.input.help.CustomTargetAzurePs": "La versión preferida de Azure PowerShell debe ser una versión de semántica adecuada, por ejemplo, 1.2.3. No se admite una notación regex como 2.\\*,2.3.\\*. El grupo Hosted VS2017 Pool es compatible con las versiones del módulo Az 1.0.0, 1.6.0, 2.3.2, 2.6.0 y 3.1.0", + "loc.input.label.pwsh": "Usar PowerShell Core", + "loc.input.help.pwsh": "Si es true, la tarea usará pwsh.exe desde PATH en lugar de powershell.exe en Windows.", + "loc.input.label.validateScriptSignature": "Validación de la firma del script", + "loc.input.help.validateScriptSignature": "Si es true, la tarea comprobará primero para asegurarse de que el script especificado está firmado y es válido antes de ejecutarlo.", + "loc.input.label.workingDirectory": "Directorio de trabajo", + "loc.input.help.workingDirectory": "Directorio de trabajo donde se ejecuta el script.", + "loc.messages.GeneratingScript": "Generando script.", + "loc.messages.JS_FormattedCommand": "Comando con formato: %s", + "loc.messages.InvalidScriptArguments0": "Argumentos de script '{0}' no válidos. No se permiten los saltos de línea.", + "loc.messages.InvalidScriptPath0": "Ruta del script '{0}' no válida. Los caracteres de ruta de acceso especificados no son válidos.", + "loc.messages.InvalidAzurePsVersion": "La versión de Azure PowerShell \"{0}\" especificada no tiene el formato correcto. Compruebe el formato. Ejemplo de formato correcto: 1.0.1", + "loc.messages.JS_ExitCode": "PowerShell se cerró con el código \"%s\".", + "loc.messages.JS_Stderr": "PowerShell escribió una o varias líneas en la secuencia de error estándar.", + "loc.messages.ExpiredServicePrincipal": "No se pudo capturar el token de acceso de Azure. Compruebe que la entidad de servicio usada es válida y no ha expirado." +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Strings/resources.resjson/fr-FR/resources.resjson b/_generated/AzurePowerShellV4/Strings/resources.resjson/fr-FR/resources.resjson new file mode 100644 index 000000000000..85ffdca03de8 --- /dev/null +++ b/_generated/AzurePowerShellV4/Strings/resources.resjson/fr-FR/resources.resjson @@ -0,0 +1,43 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[En savoir plus sur cette tâche](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "Exécuter un script PowerShell dans un environnement Azure", + "loc.instanceNameFormat": "Script Azure PowerShell : $(ScriptType)", + "loc.releaseNotes": "Ajout de la prise en charge du module Azure et des agents multiplateformes.", + "loc.group.displayName.AzurePowerShellVersionOptions": "Options de version Azure PowerShell", + "loc.group.displayName.advanced": "Avancé", + "loc.input.label.ConnectedServiceNameARM": "Abonnement Azure", + "loc.input.help.ConnectedServiceNameARM": "Abonnement Azure Resource Manager à configurer avant d'exécuter PowerShell", + "loc.input.label.ScriptType": "Type de script", + "loc.input.help.ScriptType": "Type du script : chemin de fichier ou script inline", + "loc.input.label.ScriptPath": "Chemin d'accès du script", + "loc.input.help.ScriptPath": "Chemin d'accès du script. Doit être un chemin d'accès complet ou relatif au répertoire de travail par défaut.", + "loc.input.label.Inline": "Script inline", + "loc.input.help.Inline": "Entrez le script à exécuter.", + "loc.input.label.ScriptArguments": "Arguments de script", + "loc.input.help.ScriptArguments": "Paramètres supplémentaires à passer à PowerShell. Peuvent être des paramètres ordinaux ou nommés.", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "Sélectionnez la valeur de la variable ErrorActionPreference pour l'exécution du script.", + "loc.input.label.FailOnStandardError": "Échec sur une erreur standard", + "loc.input.help.FailOnStandardError": "Si la valeur est true, et si des erreurs sont écrites dans le pipeline d'erreurs ou si des données sont écrites dans le flux d'erreurs standard, cette tâche se solde par un échec.", + "loc.input.label.RestrictContextToCurrentTask": "Limiter l'étendue du contexte à la tâche active", + "loc.input.help.RestrictContextToCurrentTask": "Si cette condition est vérifiée, la tâche limite l'étendue du contexte à la tâche active uniquement. Le contexte n'est pas accessible aux autres tâches du pipeline quand l'agent privé est utilisé.", + "loc.input.label.TargetAzurePs": "Version d'Azure PowerShell", + "loc.input.help.TargetAzurePs": "Dans le cas d'agents hébergés, les versions d'Azure PowerShell prises en charge sont les suivantes : 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0 (file d'attente VS2017 hébergée).\nPour choisir la dernière version disponible sur l'agent, sélectionnez \"Dernière version installée\".\n\nPour les agents privés, vous pouvez spécifier la version par défaut d'Azure PowerShell via \"Spécifier la version\"", + "loc.input.label.CustomTargetAzurePs": "Version préférée d'Azure PowerShell", + "loc.input.help.CustomTargetAzurePs": "La version par défaut d'Azure PowerShell doit être une version sémantique appropriée, par exemple 1.2.3. La notation regex telle que 2.\\*,2.3.\\* n'est pas prise en charge. Le pool VS2017 hébergé prend en charge les versions de module Az suivantes : 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0", + "loc.input.label.pwsh": "Utilisez PowerShell Core", + "loc.input.help.pwsh": "Si la valeur est true, dans Windows, la tâche utilise pwsh.exe à partir de votre variable PATH au lieu de powershell.exe.", + "loc.input.label.validateScriptSignature": "Valider la signature du script", + "loc.input.help.validateScriptSignature": "Si la valeur est true, la tâche vérifie d’abord que le script spécifié est signé et valide avant de l’exécuter.", + "loc.input.label.workingDirectory": "Répertoire de travail", + "loc.input.help.workingDirectory": "Répertoire de travail où le script est exécuté.", + "loc.messages.GeneratingScript": "Génération du script.", + "loc.messages.JS_FormattedCommand": "Commande mise en forme : %s", + "loc.messages.InvalidScriptArguments0": "Arguments de script '{0}' non valides. Les sauts de ligne ne sont pas autorisés.", + "loc.messages.InvalidScriptPath0": "Chemin de script '{0}' non valide. Caractères non valides spécifiés dans le chemin.", + "loc.messages.InvalidAzurePsVersion": "La version '{0}' spécifiée pour Azure PowerShell n'est pas au format approprié. Vérifiez le format. Exemple de format correct : 1.0.1", + "loc.messages.JS_ExitCode": "Arrêt de PowerShell. Code de sortie : '%s'.", + "loc.messages.JS_Stderr": "PowerShell a écrit une ou plusieurs lignes dans le flux d'erreurs standard.", + "loc.messages.ExpiredServicePrincipal": "Impossible de récupérer (fetch) le jeton d'accès pour Azure. Vérifiez si le principal de service utilisé est valide et s'il n'a pas expiré." +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Strings/resources.resjson/it-IT/resources.resjson b/_generated/AzurePowerShellV4/Strings/resources.resjson/it-IT/resources.resjson new file mode 100644 index 000000000000..de03075839b5 --- /dev/null +++ b/_generated/AzurePowerShellV4/Strings/resources.resjson/it-IT/resources.resjson @@ -0,0 +1,43 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[Altre informazioni su questa attività](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "Consente di eseguire uno script PowerShell in un ambiente Azure", + "loc.instanceNameFormat": "Script Azure PowerShell: $(ScriptType)", + "loc.releaseNotes": "È stato aggiunto il supporto per il modulo AZ e gli agenti multipiattaforma.", + "loc.group.displayName.AzurePowerShellVersionOptions": "Opzioni della versione di Azure PowerShell", + "loc.group.displayName.advanced": "Avanzate", + "loc.input.label.ConnectedServiceNameARM": "Sottoscrizione di Azure", + "loc.input.help.ConnectedServiceNameARM": "Sottoscrizione di Azure Resource Manager da configurare prima di eseguire PowerShell", + "loc.input.label.ScriptType": "Tipo di script", + "loc.input.help.ScriptType": "Tipo dello script: Percorso file o Script inline", + "loc.input.label.ScriptPath": "Percorso script", + "loc.input.help.ScriptPath": "Percorso dello script. Deve essere un percorso completo o relativo rispetto alla directory di lavoro predefinita.", + "loc.input.label.Inline": "Script inline", + "loc.input.help.Inline": "Consente di immettere lo script da eseguire.", + "loc.input.label.ScriptArguments": "Argomenti script", + "loc.input.help.ScriptArguments": "Parametri aggiuntivi da passare a PowerShell. Possono essere ordinali o denominati.", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "Consente di selezionare il valore della variabile ErrorActionPreference per l'esecuzione dello script.", + "loc.input.label.FailOnStandardError": "Interrompi in caso di errore standard", + "loc.input.help.FailOnStandardError": "Se il valore è true, questa attività non riuscirà nel caso in cui vengano scritti errori nella pipeline degli errori oppure se vengono scritti dati nel flusso STDERR.", + "loc.input.label.RestrictContextToCurrentTask": "Limita l'ambito del contesto all'attività corrente", + "loc.input.help.RestrictContextToCurrentTask": "Se è true, questa attività limiterà l'ambito del contesto solo all'attività corrente e il contesto non sarà disponibile per altre attività nella pipeline quando si usa l'agente privato.", + "loc.input.label.TargetAzurePs": "Versione di Azure PowerShell", + "loc.input.help.TargetAzurePs": "In caso di agenti ospitati la versione supportata di Azure PowerShell è: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0 (Hosted VS2017 Queue).\nPer selezionare l'ultima versione disponibile per l'agente ospitato, selezionare \"Ultima versione installata\".\n\nPer gli agenti privati è possibile selezionare \"Specifica versione\" per specificare la versione preferita di Azure PowerShell", + "loc.input.label.CustomTargetAzurePs": "Versione preferita di Azure PowerShell", + "loc.input.help.CustomTargetAzurePs": "La versione preferita di Azure PowerShell deve essere una versione semantica valida, ad esempio 1.2.3. Espressioni regolari come 2.\\*,2.3.\\* non sono supportate. La versione Hosted VS2017 Pool supporta attualmente le versioni seguenti del modulo Az: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0", + "loc.input.label.pwsh": "Usa PowerShell Core", + "loc.input.help.pwsh": "Se è impostata su true, in Windows l'attività userà pwsh.exe da PATH invece di powershell.exe.", + "loc.input.label.validateScriptSignature": "Convalida firma script", + "loc.input.help.validateScriptSignature": "Se è True, l'attività verificherà innanzitutto che lo script specificato sia firmato e valido prima di eseguirlo.", + "loc.input.label.workingDirectory": "Directory di lavoro", + "loc.input.help.workingDirectory": "Directory di lavoro in cui viene eseguito lo script.", + "loc.messages.GeneratingScript": "Generazione dello script.", + "loc.messages.JS_FormattedCommand": "Comando formattato: %s", + "loc.messages.InvalidScriptArguments0": "Gli argomenti '{0}' dello script non sono validi. Le interruzioni di riga non sono consentite.", + "loc.messages.InvalidScriptPath0": "Il percorso '{0}' dello script non è valido. Sono stati specificati caratteri non validi.", + "loc.messages.InvalidAzurePsVersion": "Il formato della versione di Azure PowerShell '{0}' specificata non è corretto. Controllare il formato. Un esempio di formato corretto è 1.0.1", + "loc.messages.JS_ExitCode": "PowerShell terminato con codice '%s'.", + "loc.messages.JS_Stderr": "PowerShell ha scritto una o più righe nel flusso di errore standard.", + "loc.messages.ExpiredServicePrincipal": "Non è stato possibile recuperare il token di accesso per Azure. Verificare che l'entità servizio usata sia valida e non sia scaduta." +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Strings/resources.resjson/ja-JP/resources.resjson b/_generated/AzurePowerShellV4/Strings/resources.resjson/ja-JP/resources.resjson new file mode 100644 index 000000000000..5f60ce4b7a81 --- /dev/null +++ b/_generated/AzurePowerShellV4/Strings/resources.resjson/ja-JP/resources.resjson @@ -0,0 +1,43 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[このタスクの詳細を表示](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "Azure 環境内で PowerShell スクリプトを実行します", + "loc.instanceNameFormat": "Azure PowerShell スクリプト: $(ScriptType)", + "loc.releaseNotes": "Az モジュールとクロス プラットフォームのエージェントのサポートが追加されました。", + "loc.group.displayName.AzurePowerShellVersionOptions": "Azure PowerShell バージョンのオプション", + "loc.group.displayName.advanced": "詳細設定", + "loc.input.label.ConnectedServiceNameARM": "Azure サブスクリプション", + "loc.input.help.ConnectedServiceNameARM": "PowerShell を実行する前に構成する Azure Resource Manager サブスクリプション", + "loc.input.label.ScriptType": "スクリプトの種類", + "loc.input.help.ScriptType": "スクリプトの種類: ファイル パスまたはインライン スクリプト", + "loc.input.label.ScriptPath": "スクリプト パス", + "loc.input.help.ScriptPath": "スクリプトのパス。完全修飾パスか、既定の作業ディレクトリを基準とした相対パスのいずれかです。", + "loc.input.label.Inline": "インライン スクリプト", + "loc.input.help.Inline": "実行するスクリプトを入力します。", + "loc.input.label.ScriptArguments": "スクリプトの引数", + "loc.input.help.ScriptArguments": "PowerShell に渡す追加のパラメーター。順序によるパラメーターまたは名前指定されたパラメーターのいずれかです。", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "スクリプトを実行するための ErrorActionPreference 変数の値を選択します。", + "loc.input.label.FailOnStandardError": "標準エラーで失敗", + "loc.input.help.FailOnStandardError": "これが true の場合、何らかのエラーがエラー パイプラインに書き込まれるか、何らかのデータが標準エラー ストリームに書き込まれる場合、このタスクは失敗します。", + "loc.input.label.RestrictContextToCurrentTask": "コンテキストのスコープを現在のタスクに制限する", + "loc.input.help.RestrictContextToCurrentTask": "これが true の場合、このタスクによってコンテキストのスコープが現在のタスクのみに制限されます。また、プライベート エージェントを使用している場合、このコンテキストをパイプライン内の他のタスクで使用することはできなくなります。", + "loc.input.label.TargetAzurePs": "Azure PowerShell バージョン", + "loc.input.help.TargetAzurePs": "ホステッド エージェントの場合、サポートされている Azure PowerShell のバージョンは、1.0.0、1.6.0、2.3.2、2.6.0、3.1.0 (ホステッド VS2017 キュー) です。\nエージェントで利用可能な最新バージョンを選ぶには、[Latest installed version](インストールされている最新バージョン) を選択します。\n\nプライベート エージェントの場合は、[Specify version](バージョンを指定する) を使用して優先されるバージョンの Azure PowerShell を指定できます。", + "loc.input.label.CustomTargetAzurePs": "優先される Azure PowerShell バージョン", + "loc.input.help.CustomTargetAzurePs": "優先される Azure PowerShell バージョンは、1.2.3 などの適切なセマンティック バージョンである必要があります。2.\\*、2.3.\\* などの正規表現はサポートされていません。ホステッド VS2017 プールは、現在次の Az モジュール バージョンをサポートしています: 1.0.0、1.6.0、2.3.2、2.6.0、3.1.0", + "loc.input.label.pwsh": "PowerShell Core を使用する", + "loc.input.help.pwsh": "これが true の場合、Windows 上のタスクは powershell.exe ではなく PATH からの pwsh.exe を使用します。", + "loc.input.label.validateScriptSignature": "スクリプトの署名を検証する", + "loc.input.help.validateScriptSignature": "これが true の場合、タスクはまず、指定されたスクリプトが署名され、有効であることを確認してからこれを実行します。", + "loc.input.label.workingDirectory": "作業ディレクトリ", + "loc.input.help.workingDirectory": "スクリプトが実行される作業ディレクトリ。", + "loc.messages.GeneratingScript": "スクリプトを生成しています。", + "loc.messages.JS_FormattedCommand": "フォーマット後のコマンド: %s", + "loc.messages.InvalidScriptArguments0": "スクリプトの引数 '{0}' が無効です。改行は使用できません。", + "loc.messages.InvalidScriptPath0": "スクリプト パス '{0}' が無効です。無効なパス文字が指定されました。", + "loc.messages.InvalidAzurePsVersion": "指定した Azure PowerShell バージョン '{0}' は、形式が正しくありません。形式をご確認ください。正しい形式の例は、1.0.1 です", + "loc.messages.JS_ExitCode": "PowerShell がコード '%s' で終了しました。", + "loc.messages.JS_Stderr": "PowerShell が標準エラー ストリームに 1 行以上を書き込みました。", + "loc.messages.ExpiredServicePrincipal": "Azure のアクセス トークンをフェッチできませんでした。使用されているサービス プリンシパルが有効であり、有効期限が切れていないことを確認してください。" +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Strings/resources.resjson/ko-KR/resources.resjson b/_generated/AzurePowerShellV4/Strings/resources.resjson/ko-KR/resources.resjson new file mode 100644 index 000000000000..b00a1a1619c4 --- /dev/null +++ b/_generated/AzurePowerShellV4/Strings/resources.resjson/ko-KR/resources.resjson @@ -0,0 +1,43 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[이 작업에 대한 자세한 정보](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "Azure 환경에서 PowerShell 스크립트 실행", + "loc.instanceNameFormat": "Azure PowerShell 스크립트: $(ScriptType)", + "loc.releaseNotes": "Az 모듈 및 플랫폼 간 에이전트에 대한 지원이 추가되었습니다.", + "loc.group.displayName.AzurePowerShellVersionOptions": "Azure PowerShell 버전 옵션", + "loc.group.displayName.advanced": "고급", + "loc.input.label.ConnectedServiceNameARM": "Azure 구독", + "loc.input.help.ConnectedServiceNameARM": "PowerShell을 실행하기 전에 구성할 Azure Resource Manager 구독", + "loc.input.label.ScriptType": "스크립트 유형", + "loc.input.help.ScriptType": "스크립트 유형: 파일 경로 또는 인라인 스크립트", + "loc.input.label.ScriptPath": "스크립트 경로", + "loc.input.help.ScriptPath": "스크립트의 경로입니다. 정규화된 경로이거나 기본 작업 디렉터리에 대한 상대 경로여야 합니다.", + "loc.input.label.Inline": "인라인 스크립트", + "loc.input.help.Inline": "실행할 스크립트를 입력합니다.", + "loc.input.label.ScriptArguments": "스크립트 인수", + "loc.input.help.ScriptArguments": "PowerShell에 전달할 추가 인수입니다. 서수 매개 변수나 명명된 매개 변수 중 하나일 수 있습니다.", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "스크립트 실행에 대한 ErrorActionPreference 변수의 값을 선택합니다.", + "loc.input.label.FailOnStandardError": "표준 오류 시 실패", + "loc.input.help.FailOnStandardError": "이 값이 true이면 오류 파이프라인에 오류가 작성되거나 표준 오류 스트림에 데이터가 작성될 경우 이 작업은 실패하게 됩니다.", + "loc.input.label.RestrictContextToCurrentTask": "컨텍스트 범위를 현재 작업으로 제한", + "loc.input.help.RestrictContextToCurrentTask": "true이면 이 작업이 컨텍스트 범위를 현재 작업으로만 제한하고 프라이빗 에이전트를 사용할 때 파이프라인의 다른 작업에 대해 컨텍스트를 사용할 수 없게 됩니다.", + "loc.input.label.TargetAzurePs": "Azure PowerShell 버전", + "loc.input.help.TargetAzurePs": "호스트된 에이전트의 경우 지원되는 Azure PowerShell 버전은 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0(Hosted VS2017 Queue)입니다.\n에이전트에서 사용 가능한 최신 버전을 선택하려면 \"설치된 최신 버전\"을 선택합니다.\n\n사용자 에이전트의 경우 \"버전 지정\"을 사용하여 기본 Azure PowerShell 버전을 지정할 수 있습니다.", + "loc.input.label.CustomTargetAzurePs": "기본 Azure PowerShell 버전", + "loc.input.help.CustomTargetAzurePs": "기본 Azure PowerShell 버전은 올바른 의미 체계 버전(예: 1.2.3)이어야 합니다. 2.\\*,2.3.\\*와 같은 Regex는 지원되지 않습니다. Hosted VS2017 풀은 현재 Az 모듈 버전 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0을 지원합니다.", + "loc.input.label.pwsh": "PowerShell Core 사용", + "loc.input.help.pwsh": "true이면, Windows에서 작업이 powershell.exe 대신 PATH의 pwsh.exe를 사용합니다.", + "loc.input.label.validateScriptSignature": "스크립트 서명 유효성 검사", + "loc.input.help.validateScriptSignature": "true이면 작업을 실행하기 전에 먼저 지정한 스크립트가 서명되어 있고 유효한지 확인합니다.", + "loc.input.label.workingDirectory": "작업 디렉터리", + "loc.input.help.workingDirectory": "스크립트가 실행되는 작업 디렉터리입니다.", + "loc.messages.GeneratingScript": "스크립트를 생성 중입니다.", + "loc.messages.JS_FormattedCommand": "형식이 지정된 명령: %s", + "loc.messages.InvalidScriptArguments0": "스크립트 인수 '{0}'이(가) 잘못되었습니다. 줄 바꿈은 허용되지 않습니다.", + "loc.messages.InvalidScriptPath0": "스크립트 경로 '{0}'이(가) 잘못되었습니다. 잘못된 경로 문자를 지정했습니다.", + "loc.messages.InvalidAzurePsVersion": "지정한 Azure PowerShell 버전 '{0}'의 형식이 잘못되었습니다. 형식을 확인하세요. 올바른 형식의 예는 1.0.1입니다.", + "loc.messages.JS_ExitCode": "PowerShell이 코드 '%s'(으)로 종료되었습니다.", + "loc.messages.JS_Stderr": "PowerShell이 표준 오류 스트림에 하나 이상의 줄을 썼습니다.", + "loc.messages.ExpiredServicePrincipal": "Azure의 액세스 토큰을 페치할 수 없습니다. 사용한 서비스 주체가 유효하고 만료되지 않았는지 확인하세요." +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Strings/resources.resjson/ru-RU/resources.resjson b/_generated/AzurePowerShellV4/Strings/resources.resjson/ru-RU/resources.resjson new file mode 100644 index 000000000000..c20a9b0fce5f --- /dev/null +++ b/_generated/AzurePowerShellV4/Strings/resources.resjson/ru-RU/resources.resjson @@ -0,0 +1,43 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[См. дополнительные сведения об этой задаче](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "Выполнение скрипта PowerShell в среде Azure", + "loc.instanceNameFormat": "Сценарий Azure PowerShell: $(ScriptType)", + "loc.releaseNotes": "Добавлена поддержка модуля Az и кроссплатформенных агентов.", + "loc.group.displayName.AzurePowerShellVersionOptions": "Параметры версии Azure PowerShell", + "loc.group.displayName.advanced": "Дополнительно", + "loc.input.label.ConnectedServiceNameARM": "Подписка Azure", + "loc.input.help.ConnectedServiceNameARM": "Подписка на Azure Resource Manager для настройки перед запуском PowerShell", + "loc.input.label.ScriptType": "Тип сценария", + "loc.input.help.ScriptType": "Тип сценария: путь к файлу или встроенный сценарий", + "loc.input.label.ScriptPath": "Путь к скрипту", + "loc.input.help.ScriptPath": "Путь к сценарию. Это должен быть полный путь или путь относительно рабочего каталога по умолчанию.", + "loc.input.label.Inline": "Встроенный сценарий", + "loc.input.help.Inline": "Введите сценарий для выполнения.", + "loc.input.label.ScriptArguments": "Аргументы скрипта", + "loc.input.help.ScriptArguments": "Дополнительные параметры для передачи в PowerShell. Могут быть как порядковыми, так и именованными.", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "Выберите значение переменной ErrorActionPreference для выполнения скрипта.", + "loc.input.label.FailOnStandardError": "Сбой со стандартной ошибкой", + "loc.input.help.FailOnStandardError": "Если задано значение True, задача будет завершаться сбоем при записи любых ошибок в конвейер ошибок или записи любых данных в стандартный поток ошибок.", + "loc.input.label.RestrictContextToCurrentTask": "Ограничить область контекста текущей задачей", + "loc.input.help.RestrictContextToCurrentTask": "Если задано значение true, задача ограничивает область контекста только текущей задачей и при использовании частного агента контекст будет недоступен для других задач в конвейере.", + "loc.input.label.TargetAzurePs": "Версия Azure PowerShell", + "loc.input.help.TargetAzurePs": "Для размещенных агентов поддерживаются следующие версии Azure PowerShell: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0 (размещенная очередь Visual Studio 2017).\nЧтобы выбрать последнюю версию, доступную в агенте, выберите пункт \"Последняя установленная версия\".\n\nДля частных агентов можно указать предпочтительную версию Azure PowerShell с помощью элемента \"Указать версию\"", + "loc.input.label.CustomTargetAzurePs": "Предпочтительная версия Azure PowerShell", + "loc.input.help.CustomTargetAzurePs": "Предпочтительная версия Azure PowerShell должна быть надлежащей семантической версией, например 1.2.3. Регулярные выражения, например 2.\\*,2.3.\\*, не поддерживаются. Размещенный пул Visual Studio 2017 сейчас поддерживает следующие версии модуля Az: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0", + "loc.input.label.pwsh": "Использовать PowerShell Core", + "loc.input.help.pwsh": "Если задано значение True, в Windows задача будет использовать программу pwsh.exe, указанную в переменной PATH, вместо powershell.exe.", + "loc.input.label.validateScriptSignature": "Проверка подписи сценария", + "loc.input.help.validateScriptSignature": "Если задано значение true, задача сначала проверит, что указанный сценарий подписан и действителен, прежде чем выполнить его.", + "loc.input.label.workingDirectory": "Рабочий каталог", + "loc.input.help.workingDirectory": "Рабочий каталог, в котором выполняется скрипт.", + "loc.messages.GeneratingScript": "Формируется скрипт.", + "loc.messages.JS_FormattedCommand": "Отформатирована команда: %s", + "loc.messages.InvalidScriptArguments0": "Недопустимые аргументы скрипта \"{0}\". Разрывы строк запрещены.", + "loc.messages.InvalidScriptPath0": "Недопустимый путь к скрипту \"{0}\". Указаны символы, недопустимые в пути.", + "loc.messages.InvalidAzurePsVersion": "Указанная версия Azure PowerShell \"{0}\" имеет неправильный формат. Проверьте формат. Пример правильного формата: 1.0.1", + "loc.messages.JS_ExitCode": "Завершение работы PowerShell с кодом \"%s\".", + "loc.messages.JS_Stderr": "Оболочка PowerShell записала одну или несколько строк в стандартный поток ошибок.", + "loc.messages.ExpiredServicePrincipal": "Не удалось получить маркер доступа для Azure. Убедитесь, что используемый субъект-служба является допустимым, а срок его действия не истек." +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Strings/resources.resjson/zh-CN/resources.resjson b/_generated/AzurePowerShellV4/Strings/resources.resjson/zh-CN/resources.resjson new file mode 100644 index 000000000000..fe4a5eb3b960 --- /dev/null +++ b/_generated/AzurePowerShellV4/Strings/resources.resjson/zh-CN/resources.resjson @@ -0,0 +1,43 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[详细了解此任务](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "在 Azure 环境中运行 PowerShell 脚本", + "loc.instanceNameFormat": "Azure PowerShell 脚本: $(ScriptType)", + "loc.releaseNotes": "添加了对 Azure 模块和跨平台代理的支持。", + "loc.group.displayName.AzurePowerShellVersionOptions": "Azure PowerShell 版本选项", + "loc.group.displayName.advanced": "高级", + "loc.input.label.ConnectedServiceNameARM": "Azure 订阅", + "loc.input.help.ConnectedServiceNameARM": "在运行 PowerShell 之前配置的 Azure 资源管理器订阅", + "loc.input.label.ScriptType": "脚本类型", + "loc.input.help.ScriptType": "脚本类型: 文件路径或内联脚本", + "loc.input.label.ScriptPath": "脚本路径", + "loc.input.help.ScriptPath": "脚本的路径。应是完全限定的路径或相对于默认工作目录。", + "loc.input.label.Inline": "内联脚本", + "loc.input.help.Inline": "输入要执行的脚本。", + "loc.input.label.ScriptArguments": "脚本参数", + "loc.input.help.ScriptArguments": "要传递给 PowerShell 的其他参数。可以是序号或命名参数。", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "选择执行脚本的 ErrorActionPreference 变量的值。", + "loc.input.label.FailOnStandardError": "因标准错误失败", + "loc.input.help.FailOnStandardError": "如果为 true,当有错误被写入错误管道或有数据被写入标准错误流时,此任务将失败。", + "loc.input.label.RestrictContextToCurrentTask": "将上下文的范围限于当前任务", + "loc.input.help.RestrictContextToCurrentTask": "如果为 true,此任务会将上下文的范围仅限于当前任务,并且在使用专用代理时,管道中的其他任务将无法使用该上下文。", + "loc.input.label.TargetAzurePs": "Azure PowerShell 版本", + "loc.input.help.TargetAzurePs": "对于托管代理,受支持的 Azure PowerShell 版本为: 1.0.0、1.6.0、2.3.2、2.6.0、3.1.0 (托管的 VS2017 队列)。\n若要选择代理上的最新可用版本,请选择“已安装的最新版本”。\n\n对于专用代理,可以使用“指定版本”指定 Azure PowerShell 的首选版本", + "loc.input.label.CustomTargetAzurePs": "首选 Azure PowerShell 版本", + "loc.input.help.CustomTargetAzurePs": "首选 Azure PowerShell 版本需为正确的语义版本,例如 1.2.3。不支持 2.\\*、2.3.\\* 等正则表达式。托管 VS2017 池当前支持 Azure 模块版本: 1.0.0、1.6.0、2.3.2、2.6.0、3.1.0", + "loc.input.label.pwsh": "使用 PowerShell Core", + "loc.input.help.pwsh": "如果为 true,则在 Windows 上,任务将使用来自 PATH 的 pwsh.exe,而不是 powershell.exe。", + "loc.input.label.validateScriptSignature": "验证脚本签名", + "loc.input.help.validateScriptSignature": "如果为 true,则任务将首先检查以确保指定的脚本已签名并且在执行前有效。", + "loc.input.label.workingDirectory": "工作目录", + "loc.input.help.workingDirectory": "在其中运行脚本的工作目录。", + "loc.messages.GeneratingScript": "正在生成脚本。", + "loc.messages.JS_FormattedCommand": "已设置格式的命令: %s", + "loc.messages.InvalidScriptArguments0": "脚本参数“{0}”无效。不允许换行。", + "loc.messages.InvalidScriptPath0": "脚本路径“{0}”无效。指定的路径字符无效。", + "loc.messages.InvalidAzurePsVersion": "指定的 Azure PowerShell 版本“{0}”格式不正确。请检查格式。正确格式的示例为 1.0.1", + "loc.messages.JS_ExitCode": "PowerShell 已退出,代码为“%s”。", + "loc.messages.JS_Stderr": "PowerShell 向标准错误流写入一个或多个行。", + "loc.messages.ExpiredServicePrincipal": "无法提取 Azure 的访问令牌。请确保使用的服务主体有效且未过期。" +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Strings/resources.resjson/zh-TW/resources.resjson b/_generated/AzurePowerShellV4/Strings/resources.resjson/zh-TW/resources.resjson new file mode 100644 index 000000000000..5b87db2dbbac --- /dev/null +++ b/_generated/AzurePowerShellV4/Strings/resources.resjson/zh-TW/resources.resjson @@ -0,0 +1,43 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[深入了解此工作](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "在 Azure 環境中執行 PowerShell 指令碼", + "loc.instanceNameFormat": "Azure PowerShell 指令碼: $(ScriptType)", + "loc.releaseNotes": "新增了 Az 模組和跨平台代理程式的支援。", + "loc.group.displayName.AzurePowerShellVersionOptions": "Azure PowerShell 版本選項", + "loc.group.displayName.advanced": "進階", + "loc.input.label.ConnectedServiceNameARM": "Azure 訂用帳戶", + "loc.input.help.ConnectedServiceNameARM": "執行 PowerShell 之前要設定的 Azure Resource Manager 訂用帳戶", + "loc.input.label.ScriptType": "指令碼類型", + "loc.input.help.ScriptType": "指令碼類型: 檔案路徑或內嵌指令碼", + "loc.input.label.ScriptPath": "指令碼路徑", + "loc.input.help.ScriptPath": "指令碼的路徑。必須是完整路徑名稱或預設工作目錄的相對路徑。", + "loc.input.label.Inline": "內嵌指令碼", + "loc.input.help.Inline": "請輸入要執行的指令碼。", + "loc.input.label.ScriptArguments": "指令碼引數", + "loc.input.help.ScriptArguments": "傳遞至 PowerShell 的額外引數。可以是序數或具名參數。", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "請選取用於執行指令碼的 ErrorActionPreference 變數值。", + "loc.input.label.FailOnStandardError": "發生標準錯誤的失敗", + "loc.input.help.FailOnStandardError": "若此項為 true,如果在錯誤管線中寫入任何錯誤,或在標準錯誤資料流中寫入任何資料,此工作就會失敗。", + "loc.input.label.RestrictContextToCurrentTask": "將內容範圍限制在目前的工作", + "loc.input.help.RestrictContextToCurrentTask": "若為 true,則此工作只會將內容範圍限制在目前的工作,而在使用私人代理程式時,管線中的其他工作將無法使用內容。", + "loc.input.label.TargetAzurePs": "Azure PowerShell 版本", + "loc.input.help.TargetAzurePs": "若為裝載的代理程式,則支援的 Azure PowerShell 版本為: 1.0.0、1.6.0、2.3.2、2.6.0、3.1.0 (裝載的 VS2017 佇列)。\n若要挑選代理程式上可用的最新版本,請選取 [最新安裝的版本]。\n\n若為私人代理程式,您可以使用 [指定版本] 指定慣用的 Azure PowerShell 版本", + "loc.input.label.CustomTargetAzurePs": "慣用的 Azure PowerShell 版本", + "loc.input.help.CustomTargetAzurePs": "慣用的 Azure PowerShell 版本必須是正確的語意版本,例如 1.2.3。不支援像 2.\\*,2.3.\\* 這樣的 Regex。裝載的 VS2017 集區目前支援 Az 模組版本: 1.0.0、1.6.0、2.3.2、2.6.0、3.1.0", + "loc.input.label.pwsh": "使用 PowerShell Core", + "loc.input.help.pwsh": "若此為 true,那麼在 Windows 上,工作就會使用 PATH 中的 pwsh.exe 而非 powershell.exe。", + "loc.input.label.validateScriptSignature": "驗證指令碼簽章", + "loc.input.help.validateScriptSignature": "如果此為 true,則工作會先進行檢查,確定指定的指令碼已簽署且有效,然後再執行。", + "loc.input.label.workingDirectory": "工作目錄", + "loc.input.help.workingDirectory": "指令碼執行所在的工作目錄。", + "loc.messages.GeneratingScript": "正在產生指令碼。", + "loc.messages.JS_FormattedCommand": "經過格式化的命令: %s", + "loc.messages.InvalidScriptArguments0": "指令碼引數 '{0}' 無效。不允許分行符號。", + "loc.messages.InvalidScriptPath0": "指令碼路徑 '{0}' 無效。指定的路徑字元無效。", + "loc.messages.InvalidAzurePsVersion": "指定的 Azure PowerShell 版本 '{0}' 格式不正確。請檢查格式。正確格式的範例為 1.0.1", + "loc.messages.JS_ExitCode": "PowerShell 已結束,代碼為 '%s'。", + "loc.messages.JS_Stderr": "PowerShell 已將一或多行寫入標準錯誤資料流。", + "loc.messages.ExpiredServicePrincipal": "無法擷取 Azure 的存取權杖。請驗證使用的服務主體是否有效且未過期。" +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Tests/ChecksForPowerShell.ps1 b/_generated/AzurePowerShellV4/Tests/ChecksForPowerShell.ps1 new file mode 100644 index 000000000000..c88aa1ffb54d --- /dev/null +++ b/_generated/AzurePowerShellV4/Tests/ChecksForPowerShell.ps1 @@ -0,0 +1,30 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +$targetAzurePs = "4.1.0" +Register-Mock Get-VstsInput { "FilePath" } -- -Name ScriptType -Require +Register-Mock Get-VstsInput { "$PSScriptRoot/PerformsBasicFlow_TargetScript.ps1" } -- -Name ScriptPath +Register-Mock Get-VstsInput { $targetAzurePs } -- -Name TargetAzurePs +Register-Mock Get-VstsInput { 'arg1 arg2' } -- -Name ScriptArguments +Register-Mock Get-VstsInput { "continue" } -- -Name errorActionPreference +Register-Mock Get-VstsInput { $true } -- -Name FailOnStandardError +Register-Mock Get-VstsInput { $false } -- -Name pwsh -AsBool +Register-Mock Update-PSModulePathForHostedAgent +Register-Mock Get-Module +Register-Mock Initialize-AzModule +Register-Mock Get-VstsEndpoint { @{auth = @{ scheme = "ServicePrincipal" }} } +Register-Mock Remove-EndpointSecrets +Register-Mock Disconnect-AzureAndClearContext +Register-Mock Assert-VstsPath +Register-Mock Invoke-VstsTool { } +Register-Mock Expand-ModuleZip +Register-Mock Invoke-RestMethod +Register-Mock Save-Module + +# Act. +$actual = & $PSScriptRoot\..\AzurePowerShell.ps1 + +Assert-WasCalled Invoke-VstsTool -Times 1 +Assert-WasCalled Invoke-VstsTool -ArgumentsEvaluator {($args | ConvertTo-Json) -like '*powershell.exe*'} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Tests/ChecksForPowerShellCore.ps1 b/_generated/AzurePowerShellV4/Tests/ChecksForPowerShellCore.ps1 new file mode 100644 index 000000000000..60caed9e28fe --- /dev/null +++ b/_generated/AzurePowerShellV4/Tests/ChecksForPowerShellCore.ps1 @@ -0,0 +1,31 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +$targetAzurePs = "4.1.0" +Register-Mock Get-VstsInput { "FilePath" } -- -Name ScriptType -Require +Register-Mock Get-VstsInput { "$PSScriptRoot/PerformsBasicFlow_TargetScript.ps1" } -- -Name ScriptPath +Register-Mock Get-VstsInput { $targetAzurePs } -- -Name TargetAzurePs +Register-Mock Get-VstsInput { 'arg1 arg2' } -- -Name ScriptArguments +Register-Mock Get-VstsInput { "continue" } -- -Name errorActionPreference +Register-Mock Get-VstsInput { $true } -- -Name FailOnStandardError +Register-Mock Get-VstsInput { $true } -- -Name pwsh -AsBool +Register-Mock Update-PSModulePathForHostedAgent +Register-Mock Get-Module +Register-Mock Initialize-AzModule +Register-Mock Get-VstsEndpoint { @{auth = @{ scheme = "ServicePrincipal" }} } +Register-Mock Remove-EndpointSecrets +Register-Mock Disconnect-AzureAndClearContext +Register-Mock Assert-VstsPath +Register-Mock Invoke-VstsTool { } +Register-Mock Expand-ModuleZip +Register-Mock Invoke-RestMethod +Register-Mock Save-Module +Register-Mock ConvertTo-SecureString + +# Act. +$actual = & $PSScriptRoot\..\AzurePowerShell.ps1 + +Assert-WasCalled Invoke-VstsTool -Times 1 +Assert-WasCalled Invoke-VstsTool -ArgumentsEvaluator {($args | ConvertTo-Json) -like '*pwsh.exe*'} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Tests/ChecksForWorkingDirectory.ps1 b/_generated/AzurePowerShellV4/Tests/ChecksForWorkingDirectory.ps1 new file mode 100644 index 000000000000..4f824ae5b8c2 --- /dev/null +++ b/_generated/AzurePowerShellV4/Tests/ChecksForWorkingDirectory.ps1 @@ -0,0 +1,33 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +$targetAzurePs = "4.1.0" +$input_workingDirectory = "C:\Users" +Register-Mock Get-VstsInput { "FilePath" } -- -Name ScriptType -Require +Register-Mock Get-VstsInput { "$PSScriptRoot/PerformsBasicFlow_TargetScript.ps1" } -- -Name ScriptPath +Register-Mock Get-VstsInput { $targetAzurePs } -- -Name TargetAzurePs +Register-Mock Get-VstsInput { 'arg1 arg2' } -- -Name ScriptArguments +Register-Mock Get-VstsInput { "continue" } -- -Name errorActionPreference +Register-Mock Get-VstsInput { $true } -- -Name FailOnStandardError +Register-Mock Get-VstsInput { $true } -- -Name pwsh -AsBool +Register-Mock Get-VstsInput { $input_workingDirectory } -- -Name workingDirectory -Require +Register-Mock Update-PSModulePathForHostedAgent +Register-Mock Get-Module +Register-Mock Initialize-AzModule +Register-Mock Get-VstsEndpoint { @{auth = @{ scheme = "ServicePrincipal" }} } +Register-Mock Remove-EndpointSecrets +Register-Mock Disconnect-AzureAndClearContext +Register-Mock Assert-VstsPath +Register-Mock Invoke-VstsTool { } +Register-Mock Expand-ModuleZip +Register-Mock Invoke-RestMethod +Register-Mock Save-Module +Register-Mock ConvertTo-SecureString + +# Act. +$actual = & $PSScriptRoot\..\AzurePowerShell.ps1 + +Assert-WasCalled Invoke-VstsTool -Times 1 +Assert-WasCalled Invoke-VstsTool -ArgumentsEvaluator {($args | ConvertTo-Json) -like '*C:\\Users*'} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Tests/L0.ts b/_generated/AzurePowerShellV4/Tests/L0.ts new file mode 100644 index 000000000000..23000ff892d3 --- /dev/null +++ b/_generated/AzurePowerShellV4/Tests/L0.ts @@ -0,0 +1,58 @@ +/// +/// +/// + +import Q = require('q'); +import assert = require('assert'); +import path = require('path'); +var psm = require('../../../Tests/lib/psRunner'); +var psr = null; + +describe('AzurePowerShell Suite', function () { + this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT) || 20000); + + before((done) => { + if (psm.testSupported()) { + psr = new psm.PSRunner(); + psr.start(); + } + + done(); + }); + + after(function () { + if (psr) { + psr.kill(); + } + }); + + if (psm.testSupported()) { + it('checks for powershell core', (done) => { + psr.run(path.join(__dirname, 'ChecksForPowerShellCore.ps1'), done); + }) + /*it('checks for powershell', (done) => { + psr.run(path.join(__dirname, 'ChecksForPowerShell.ps1'), done); + })*/ + it('checks for working directory', (done) => { + psr.run(path.join(__dirname, 'ChecksForWorkingDirectory.ps1'), done); + }) + it('performs basic flow', (done) => { + psr.run(path.join(__dirname, 'PerformsBasicFlow.ps1'), done); + }) + it('throws when otherversion is specified in a wrong format', (done) => { + psr.run(path.join(__dirname, 'ThrowsForInvalidVersion.ps1'), done); + }) + it('throws when invalid script arguments', (done) => { + psr.run(path.join(__dirname, 'ThrowsWhenInvalidScriptArguments.ps1'), done); + }) + it('throws when invalid script path', (done) => { + psr.run(path.join(__dirname, 'ThrowsWhenInvalidScriptPath.ps1'), done); + }) + it('Get-LatestModule returns the latest available module', (done) => { + psr.run(path.join(__dirname, 'Utility.Get-LatestModule.ps1'), done); + }) + it('Update-PSModulePathForHostedAgent updated psmodulepath correctly', (done) => { + psr.run(path.join(__dirname, 'Utility.UpdatePSModulePathForHostedAgentWorksCorrectly.ps1'), done); + }) + } +}); \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Tests/PerformsBasicFlow.ps1 b/_generated/AzurePowerShellV4/Tests/PerformsBasicFlow.ps1 new file mode 100644 index 000000000000..6a2b2e74708d --- /dev/null +++ b/_generated/AzurePowerShellV4/Tests/PerformsBasicFlow.ps1 @@ -0,0 +1,35 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +$targetAzurePs = "4.1.0" +Register-Mock Get-VstsInput { "FilePath" } -- -Name ScriptType -Require +Register-Mock Get-VstsInput { "$PSScriptRoot/PerformsBasicFlow_TargetScript.ps1" } -- -Name ScriptPath +Register-Mock Get-VstsInput { $targetAzurePs } -- -Name TargetAzurePs +Register-Mock Get-VstsInput { 'arg1 arg2' } -- -Name ScriptArguments +Register-Mock Get-VstsInput { "continue" } -- -Name errorActionPreference +Register-Mock Get-VstsInput { $true } -- -Name FailOnStandardError +Register-Mock Update-PSModulePathForHostedAgent +Register-Mock Get-Module +Register-Mock Initialize-AzModule +Register-Mock Get-VstsEndpoint { @{auth = @{ scheme = "ServicePrincipal" }} } +Register-Mock Remove-EndpointSecrets +Register-Mock Disconnect-AzureAndClearContext +Register-Mock Assert-VstsPath +Register-Mock Invoke-VstsTool { } +Register-Mock Expand-ModuleZip +Register-Mock Invoke-RestMethod +Register-Mock Save-Module +Register-Mock ConvertTo-SecureString + +# Act. +$actual = & $PSScriptRoot\..\AzurePowerShell.ps1 + +# Assert the error action preference was set to Continue. +Assert-AreEqual "Continue" $global:ErrorActionPreference +$global:ErrorActionPreference = 'Stop' # Reset to stop. + +# Assert the Azure helpers module was imported and invoked. +Assert-WasCalled Import-Module -- ([System.IO.Path]::GetFullPath("$PSScriptRoot\..\ps_modules\VstsAzureHelpers_")) +Assert-WasCalled Initialize-AzModule diff --git a/_generated/AzurePowerShellV4/Tests/PerformsBasicFlow_TargetScript.ps1 b/_generated/AzurePowerShellV4/Tests/PerformsBasicFlow_TargetScript.ps1 new file mode 100644 index 000000000000..53aafdebcdd8 --- /dev/null +++ b/_generated/AzurePowerShellV4/Tests/PerformsBasicFlow_TargetScript.ps1 @@ -0,0 +1,4 @@ +# Return key information. +New-Object psobject -Property @{ + Args = $args +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Tests/ThrowsForInvalidVersion.ps1 b/_generated/AzurePowerShellV4/Tests/ThrowsForInvalidVersion.ps1 new file mode 100644 index 000000000000..5afc27858f1e --- /dev/null +++ b/_generated/AzurePowerShellV4/Tests/ThrowsForInvalidVersion.ps1 @@ -0,0 +1,15 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 + +Register-Mock Get-VstsInput { "FilePath" } -- -Name ScriptType -Require +Register-Mock Get-VstsInput { "foobar.ps1" } -- -Name ScriptPath +Register-Mock Get-VstsInput { "OtherVersion" } -- -Name TargetAzurePs +Register-Mock Get-VstsInput { "x.y.z" } -- -Name CustomTargetAzurePs + +# Act/Assert. +Assert-Throws { + & $PSScriptRoot\..\AzurePowerShell.ps1 +} -MessagePattern "InvalidAzurePsVersion*x.y.z" diff --git a/_generated/AzurePowerShellV4/Tests/ThrowsWhenInvalidScriptArguments.ps1 b/_generated/AzurePowerShellV4/Tests/ThrowsWhenInvalidScriptArguments.ps1 new file mode 100644 index 000000000000..af93358163bc --- /dev/null +++ b/_generated/AzurePowerShellV4/Tests/ThrowsWhenInvalidScriptArguments.ps1 @@ -0,0 +1,14 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +foreach ($arguments in @( "script`rarguments", "script`narguments" )) { + Unregister-Mock Get-VstsInput + Register-Mock Get-VstsInput { $arguments } -- -Name ScriptArguments + + # Act/Assert. + Assert-Throws { + & $PSScriptRoot\..\AzurePowerShell.ps1 + } -MessagePattern "InvalidScriptArguments0*$arguments" +} diff --git a/_generated/AzurePowerShellV4/Tests/ThrowsWhenInvalidScriptPath.ps1 b/_generated/AzurePowerShellV4/Tests/ThrowsWhenInvalidScriptPath.ps1 new file mode 100644 index 000000000000..a1334790ccba --- /dev/null +++ b/_generated/AzurePowerShellV4/Tests/ThrowsWhenInvalidScriptPath.ps1 @@ -0,0 +1,16 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +foreach ($path in @( "script`rpath", "script`npath" )) { + Unregister-Mock Get-VstsInput + Register-Mock Get-VstsInput { "FilePath" } -- -Name ScriptType -Require + Register-Mock Get-VstsInput { $path } -- -Name ScriptPath + Register-Mock Get-VstsInput { "4.1.0" } -- -Name TargetAzurePs + + # Act/Assert. + Assert-Throws { + & $PSScriptRoot\..\AzurePowerShell.ps1 + } -MessagePattern "InvalidScriptPath0*$path" +} diff --git a/_generated/AzurePowerShellV4/Tests/Utility.Get-LatestModule.ps1 b/_generated/AzurePowerShellV4/Tests/Utility.Get-LatestModule.ps1 new file mode 100644 index 000000000000..71609db6ede0 --- /dev/null +++ b/_generated/AzurePowerShellV4/Tests/Utility.Get-LatestModule.ps1 @@ -0,0 +1,30 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +. $PSScriptRoot\..\Utility.ps1 + +$azModulePath = "c:\modules\az_4.1.0" + +$azModulePattern = "^az_[0-9]+\.[0-9]+\.[0-9]+$" +$versionPattern = "[0-9]+\.[0-9]+\.[0-9]+$" + +$mockDirectoryStructure = @( + @{ + Name = "az_4.1.0" + FullName = "C:\Modules\az_4.1.0" + } + @{ + Name = "az_3.6.0" + FullName = "C:\Modules\az_3.6.0" + } +) + +Register-Mock Get-ChildItem { $mockDirectoryStructure } -- -Directory -Path "C:\Modules" +Register-Mock Test-Path { $true } + +# Act +$result = Get-LatestModule -patternToMatch $azModulePattern -patternToExtract $versionPattern +# Assert +Assert-AreEqual $result.toLower() $azModulePath \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Tests/Utility.UpdatePSModulePathForHostedAgentWorksCorrectly.ps1 b/_generated/AzurePowerShellV4/Tests/Utility.UpdatePSModulePathForHostedAgentWorksCorrectly.ps1 new file mode 100644 index 000000000000..53c9c7875e54 --- /dev/null +++ b/_generated/AzurePowerShellV4/Tests/Utility.UpdatePSModulePathForHostedAgentWorksCorrectly.ps1 @@ -0,0 +1,47 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +. $PSScriptRoot\..\Utility.ps1 + +$azModulePath = "c:\modules\az_3.6.0" + +$azModulePattern = "^az_[0-9]+\.[0-9]+\.[0-9]+$" +$versionPattern = "[0-9]+\.[0-9]+\.[0-9]+$" + +$variableSets = @( + @{ + targetAzurePsVersion = "3.6.0" + azModuleExist = $true + } + @{ + targetAzurePsVersion = "" + azModulePath = $true + } +) + +$temp = $env:PSModulePath + +foreach ($variableSet in $variableSets) { + $env:PSModulePath = $temp + # Arrange + Unregister-Mock Get-LatestModule + if($variableSet.azModuleExist) { + Register-Mock Get-LatestModule { $azModulePath } -- -patternToMatch $azModulePattern -patternToExtract $versionPattern -Classic:$false + } else { + Register-Mock Get-LatestModule { "" } -- -patternToMatch $azModulePattern -patternToExtract $versionPattern -Classic:$false + } + + # Act + Update-PSModulePathForHostedAgent -targetAzurePs $variableSet.targetAzurePsVersion + + # Assert + if($variableSet.azModuleExist) { + Assert-IsGreaterThan -1 $env:PSModulePath.toLower().IndexOf($azModulePath) + } else { + Assert-AreEqual -1 $env:PSModulePath.toLower().IndexOf($azModulePath) + } + + Assert-IsGreaterThan 0 $env:PSModulePath.toLower().IndexOf(";") +} diff --git a/_generated/AzurePowerShellV4/ThirdPartyNotices.txt b/_generated/AzurePowerShellV4/ThirdPartyNotices.txt new file mode 100644 index 000000000000..abc33cfd772f --- /dev/null +++ b/_generated/AzurePowerShellV4/ThirdPartyNotices.txt @@ -0,0 +1,136 @@ + +THIRD-PARTY SOFTWARE NOTICES AND INFORMATION +Do Not Translate or Localize + +Azure PowerShell incorporates third party material from the projects listed below. The original copyright notice and the license under which Microsoft received such third party material are set forth below. Microsoft reserves all other rights not expressly granted, whether by implication, estoppel or otherwise. + +1. OpenSSL (http://www.openssl.org) + +%% OpenSSL NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= + LICENSE ISSUES + ============== + + The OpenSSL toolkit stays under a dual license, i.e. both the conditions of + the OpenSSL License and the original SSLeay license apply to the toolkit. + See below for the actual license texts. Actually both licenses are BSD-style + Open Source licenses. In case of any license issues related to OpenSSL + please contact openssl-core@openssl.org. + + OpenSSL License + --------------- + +/* ==================================================================== + * Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/) + * + * 4. The names OpenSSL Toolkit and OpenSSL Project must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called OpenSSL + * nor may OpenSSL appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/) + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + + Original SSLeay License + ----------------------- + +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com) + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * This product includes software written by Tim Hudson (tjh@cryptsoft.com) + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] +========================================= +END OF OpenSSL NOTICES, INFORMATION, AND LICENSE diff --git a/_generated/AzurePowerShellV4/TryMakingModuleAvailable.ps1 b/_generated/AzurePowerShellV4/TryMakingModuleAvailable.ps1 new file mode 100644 index 000000000000..71d91e944af9 --- /dev/null +++ b/_generated/AzurePowerShellV4/TryMakingModuleAvailable.ps1 @@ -0,0 +1,85 @@ +[CmdletBinding()] +param ( + [string] + $targetVersion, + + [string] [Parameter(Mandatory = $true)] [ValidateSet("Windows", "Linux", "Mac")] + $platform +) + +try { + $isWin = $platform -eq "Windows" + + . (Join-Path $PSScriptRoot "Utility.ps1") + $isHostedAgent = Test-IsHostedAgentPathPresent -isWin $isWin + + if (!$isHostedAgent) { + Write-Verbose "Module path not present as expected in hosted agent, skipping step to make module available." + $moduleSource = "privateAgent" + return + } + + if (!$targetVersion) { + Write-Verbose "Latest selected, will make use of the latest available in agent as folder." + $moduleSource = "hostedAgentFolder" + return + } + + $modulePath = Get-SavedModulePath -azurePowerShellVersion $targetVersion -isWin $isWin + if (Test-Path $modulePath) { + Write-Verbose "Az $targetVersion present at $modulePath as folder." + $moduleSource = "hostedAgentFolder" + return + } + + $moduleContainerPath = Get-SavedModuleContainerPath -isWin $isWin + $moduleZipPath = $modulePath + ".zip"; + if (Test-Path $moduleZipPath) { + Write-Verbose "Az $targetVersion present at $moduleZipPath as zip, expanding it." + Expand-ModuleZip -zipPath $moduleZipPath -destination $moduleContainerPath -isWin $isWin + Write-Verbose "Zip expanded" + $moduleSource = "hostedAgentZip" + return + } + + Write-Host "Az version $targetVersion not avaiable locally on the agent. Downloading dynamically." + + try { + Write-Verbose "Getting versions manifest from GHRelease." + $versionsManifest = Invoke-RestMethod -Method Get ` + -Headers @{ "Accept" = "application/vnd.github.VERSION.raw" } ` + -Uri "https://api.github.com/repos/Azure/az-ps-module-versions/contents/versions-manifest.json" + Write-Verbose "Versions manifest downloaded." + $downloadUrlEntity = $versionsManifest | Where-Object version -eq $targetVersion + if ($downloadUrlEntity) { + $downloadUrl = $downloadUrlEntity.files[0].download_url + Write-Verbose "Downloading Az $targetVersion from GHRelease" + (New-Object System.Net.WebClient).DownloadFile($downloadUrl, $moduleZipPath) + Write-Verbose "Download succeeded" + if (Test-Path $moduleZipPath) { + Write-Verbose "Expanding Az $targetVersion downloaded at $moduleZipPath as zip." + Expand-ModuleZip -zipPath $moduleZipPath -destination $moduleContainerPath -isWin $isWin + Write-Verbose "Zip expanded" + $moduleSource = "hostedAgentGHRelease" + return + } + } else { + Write-Verbose "Az $targetVersion not present in versions manifest from GHRelease" + } + } catch { + Write-Verbose "Failed to download from GHRelease" + Write-Verbose $_ + } + + Write-Verbose "Downloading Az $targetVersion from PSGallery." + Save-Module -Path $modulePath -Name Az -RequiredVersion $targetVersion -Force -ErrorAction Stop + $moduleSource = "hostedAgentPSGallery" +} finally { + # Telemetry + # moduleSource value will be privateAgent(in case of self hosted private agents), hostedAgentFolder(when a version is present as folder or + # when latest is selected we will use the one latest available as folder), hostedAgentZip(when the module is available as a zip locally), + # hostedAgentGHRelease(when the module zip is downloaded from our GitHub releases management), hostedAgentPSGallery(when we download from PSGallery + # using the Save-Module cmdlet). + $telemetryJsonContent = @{ targetAzurePs = $targetVersion; moduleSource = $moduleSource } | ConvertTo-Json -Compress + Write-Host "##vso[telemetry.publish area=TaskHub;feature=AzurePowerShellV4]$telemetryJsonContent" +} diff --git a/_generated/AzurePowerShellV4/UpdatePSModulePath.ps1 b/_generated/AzurePowerShellV4/UpdatePSModulePath.ps1 new file mode 100644 index 000000000000..e36160743c59 --- /dev/null +++ b/_generated/AzurePowerShellV4/UpdatePSModulePath.ps1 @@ -0,0 +1,11 @@ +[CmdletBinding()] +param +( + [String] [Parameter(Mandatory = $false)] + $targetAzurePs +) + +# Update PSModulePath for hosted agent +. "$PSScriptRoot\Utility.ps1" +CleanUp-PSModulePathForHostedAgent +Update-PSModulePathForHostedAgent -targetAzurePs $targetAzurePs \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/Utility.ps1 b/_generated/AzurePowerShellV4/Utility.ps1 new file mode 100644 index 000000000000..8e6804ffe66e --- /dev/null +++ b/_generated/AzurePowerShellV4/Utility.ps1 @@ -0,0 +1,203 @@ +function Get-SavedModuleContainerPath { + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true)] + [bool] + $isWin + ) + + if ($isWin) { + return $env:SystemDrive + "\Modules"; + } else { + return "/usr/share"; + } +} + +function Test-IsHostedAgentPathPresent { + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true)] + [bool] + $isWin + ) + + $containerPath = Get-SavedModuleContainerPath -isWin $isWin + return Test-Path (Join-Path $containerPath "az_*") +} + +function Get-SavedModulePath { + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true)] + [string] + $azurePowerShellVersion, + + [Parameter(Mandatory = $true)] + [bool] + $isWin + ) + + $savedModulePath = Join-Path (Get-SavedModuleContainerPath -isWin $isWin) "az_$azurePowerShellVersion" + Write-Verbose "The value of the module path is: $savedModulePath" + return $savedModulePath +} + +function Expand-ModuleZip { + param ( + [string] [Parameter(Mandatory = $true)] + $zipPath, + + [string] [Parameter(Mandatory = $true)] + $destination, + + [bool] [Parameter(Mandatory=$true)] + $isWin + ) + + if ($isWin) { + $parameter = @("x", "-o$destination", "$zipPath") + $command = "$PSScriptRoot\7zip\7z.exe" + &$command @parameter + } else { + $prevProgressPref = $ProgressPreference + $ProgressPreference = 'SilentlyContinue' + Expand-Archive -Path $zipPath -DestinationPath $destination + $ProgressPreference = $prevProgressPref + } +} + +function Update-PSModulePathForHostedAgent { + [CmdletBinding()] + param([string] $targetAzurePs) + try { + if ($targetAzurePs) { + $hostedAgentAzModulePath = Get-SavedModulePath -azurePowerShellVersion $targetAzurePs -isWin $true + } + else { + $hostedAgentAzModulePath = Get-LatestModule -patternToMatch "^az_[0-9]+\.[0-9]+\.[0-9]+$" -patternToExtract "[0-9]+\.[0-9]+\.[0-9]+$" + } + $env:PSModulePath = $hostedAgentAzModulePath + ";" + $env:PSModulePath + $env:PSModulePath = $env:PSModulePath.TrimStart(';') + } finally { + Write-Verbose "The updated value of the PSModulePath is: $($env:PSModulePath)" + } +} + +function Update-PSModulePathForHostedAgentLinux { + [CmdletBinding()] + param([string] $targetAzurePs) + try { + if ($targetAzurePs) { + $hostedAgentAzModulePath = Get-SavedModulePath -azurePowerShellVersion $targetAzurePs -isWin $false + if(!(Test-Path $hostedAgentAzModulePath)) { + Write-Verbose "No module path found with this name" + throw ("Could not find the module path with given version.") + } + } + else { + $hostedAgentAzModulePath = Get-LatestModuleLinux -patternToMatch "^az_[0-9]+\.[0-9]+\.[0-9]+$" -patternToExtract "[0-9]+\.[0-9]+\.[0-9]+$" + } + $env:PSModulePath = $hostedAgentAzModulePath + ":" + $env:PSModulePath + $env:PSModulePath = $env:PSModulePath.TrimStart(':') + } finally { + Write-Verbose "The updated value of the PSModulePath is: $($env:PSModulePath)" + } +} + +function Get-LatestModule { + [CmdletBinding()] + param([string] $patternToMatch, + [string] $patternToExtract) + + $resultFolder = "" + $regexToMatch = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList $patternToMatch + $regexToExtract = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList $patternToExtract + $maxVersion = [version] "0.0.0" + $modulePath = $env:SystemDrive + "\Modules"; + + try { + if (-not (Test-Path -Path $modulePath)) { + return $resultFolder + } + + $moduleFolders = Get-ChildItem -Directory -Path $modulePath | Where-Object { $regexToMatch.IsMatch($_.Name) } + foreach ($moduleFolder in $moduleFolders) { + $moduleVersion = [version] $($regexToExtract.Match($moduleFolder.Name).Groups[0].Value) + if($moduleVersion -gt $maxVersion) { + $modulePath = [System.IO.Path]::Combine($moduleFolder.FullName,"Az\$moduleVersion\Az.psm1") + + if(Test-Path -LiteralPath $modulePath -PathType Leaf) { + $maxVersion = $moduleVersion + $resultFolder = $moduleFolder.FullName + } else { + Write-Verbose "A folder matching the module folder pattern was found at $($moduleFolder.FullName) but didn't contain a valid module file" + } + } + } + } + catch { + Write-Verbose "Attempting to find the Latest Module Folder failed with the error: $($_.Exception.Message)" + $resultFolder = "" + } + Write-Verbose "Latest module folder detected: $resultFolder" + return $resultFolder +} + +function Get-LatestModuleLinux { + [CmdletBinding()] + param([string] $patternToMatch, + [string] $patternToExtract) + + $resultFolder = "" + $regexToMatch = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList $patternToMatch + $regexToExtract = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList $patternToExtract + $maxVersion = [version] "0.0.0" + + try { + $moduleFolders = Get-ChildItem -Directory -Path $("/usr/share") | Where-Object { $regexToMatch.IsMatch($_.Name) } + foreach ($moduleFolder in $moduleFolders) { + $moduleVersion = [version] $($regexToExtract.Match($moduleFolder.Name).Groups[0].Value) + if($moduleVersion -gt $maxVersion) { + $modulePath = [System.IO.Path]::Combine($moduleFolder.FullName,"Az/$moduleVersion/Az.psm1") + + if(Test-Path -LiteralPath $modulePath -PathType Leaf) { + $maxVersion = $moduleVersion + $resultFolder = $moduleFolder.FullName + } else { + Write-Verbose "A folder matching the module folder pattern was found at $($moduleFolder.FullName) but didn't contain a valid module file" + } + } + } + } + catch { + Write-Verbose "Attempting to find the Latest Module Folder failed with the error: $($_.Exception.Message)" + $resultFolder = "" + } + Write-Verbose "Latest module folder detected: $resultFolder" + return $resultFolder +} + +function CleanUp-PSModulePathForHostedAgent { + # Clean up PSModulePath for hosted agent + $azureRMModulePath = "C:\Modules\azurerm_2.1.0" + $azureModulePath = "C:\Modules\azure_2.1.0" + $azPSModulePath = $env:PSModulePath + + if ($azPSModulePath.split(";") -contains $azureRMModulePath) { + $azPSModulePath = (($azPSModulePath).Split(";") | ? { $_ -ne $azureRMModulePath }) -join ";" + write-verbose "$azureRMModulePath removed. Restart the prompt for the changes to take effect." + } + else { + write-verbose "$azureRMModulePath is not present in $azPSModulePath" + } + + if ($azPSModulePath.split(";") -contains $azureModulePath) { + $azPSModulePath = (($azPSModulePath).Split(";") | ? { $_ -ne $azureModulePath }) -join ";" + write-verbose "$azureModulePath removed. Restart the prompt for the changes to take effect." + } + else { + write-verbose "$azureModulePath is not present in $azPSModulePath" + } + + $env:PSModulePath = $azPSModulePath +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/azurepowershell.ts b/_generated/AzurePowerShellV4/azurepowershell.ts new file mode 100644 index 000000000000..055826a0965a --- /dev/null +++ b/_generated/AzurePowerShellV4/azurepowershell.ts @@ -0,0 +1,169 @@ +import fs = require('fs'); +import path = require('path'); +import os = require('os'); +import tl = require('azure-pipelines-task-lib/task'); +import tr = require('azure-pipelines-task-lib/toolrunner'); +import * as telemetry from 'azure-pipelines-tasks-utility-common/telemetry'; + +import { AzureRMEndpoint } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-endpoint'; +var uuidV4 = require('uuid/v4'); + +function convertToNullIfUndefined(arg: T): T|null { + return arg ? arg : null; +} + +async function run() { + try { + tl.setResourcePath(path.join(__dirname, 'task.json')); + + // Get inputs. + console.log("## Validating Inputs"); + let _vsts_input_errorActionPreference: string = tl.getInput('errorActionPreference', false) || 'Stop'; + switch (_vsts_input_errorActionPreference.toUpperCase()) { + case 'STOP': + case 'CONTINUE': + case 'SILENTLYCONTINUE': + break; + default: + throw new Error(tl.loc('JS_InvalidErrorActionPreference', _vsts_input_errorActionPreference)); + } + let scriptType: string = tl.getInput('ScriptType', /*required*/true); + let scriptPath = convertToNullIfUndefined(tl.getPathInput('ScriptPath', false)); + let scriptInline: string = convertToNullIfUndefined(tl.getInput('Inline', false)); + let scriptArguments: string = convertToNullIfUndefined(tl.getInput('ScriptArguments', false)); + let _vsts_input_failOnStandardError = convertToNullIfUndefined(tl.getBoolInput('FailOnStandardError', false)); + let targetAzurePs: string = convertToNullIfUndefined(tl.getInput('TargetAzurePs', false)); + let customTargetAzurePs: string = convertToNullIfUndefined(tl.getInput('CustomTargetAzurePs', false)); + let serviceName = tl.getInput('ConnectedServiceNameARM',/*required*/true); + let endpointObject= await new AzureRMEndpoint(serviceName).getEndpoint(); + let input_workingDirectory = tl.getPathInput('workingDirectory', /*required*/ true, /*check*/ true); + let isDebugEnabled = (process.env['SYSTEM_DEBUG'] || "").toLowerCase() === "true"; + + // string constants + let otherVersion = "OtherVersion" + + if (targetAzurePs == otherVersion) { + if (customTargetAzurePs != "") { + targetAzurePs = customTargetAzurePs; + } + else { + console.log(tl.loc('InvalidAzurePsVersion',customTargetAzurePs)); + } + } + else { + targetAzurePs = "" + } + + var endpoint = JSON.stringify(endpointObject); + + if (scriptType.toUpperCase() == 'FILEPATH') { + if (!tl.stats(scriptPath).isFile() || !scriptPath.toUpperCase().match(/\.PS1$/)) { + throw new Error(tl.loc('JS_InvalidFilePath', scriptPath)); + } + } + console.log("## Validating Inputs Complete"); + + // Generate the script contents. + console.log("## Initializing Az module"); + console.log(tl.loc('GeneratingScript')); + let contents: string[] = []; + + if (isDebugEnabled) { + contents.push("$VerbosePreference = 'continue'"); + } + + const makeModuleAvailableScriptPath = path.join(path.resolve(__dirname), 'TryMakingModuleAvailable.ps1'); + contents.push(`${makeModuleAvailableScriptPath} -targetVersion '${targetAzurePs}' -platform Linux`); + + let azFilePath = path.join(path.resolve(__dirname), 'InitializeAz.ps1'); + contents.push(`$ErrorActionPreference = '${_vsts_input_errorActionPreference}'`); + if(targetAzurePs == "") { + contents.push(`${azFilePath} -endpoint '${endpoint}'`); + } + else { + contents.push(`${azFilePath} -endpoint '${endpoint}' -targetAzurePs ${targetAzurePs}`); + } + + if(scriptArguments == null) + { + scriptArguments = ""; + } + + if (scriptType.toUpperCase() == 'FILEPATH') { + contents.push(`. '${scriptPath.replace(/'/g, "''")}' ${scriptArguments}`.trim()); + console.log(tl.loc('JS_FormattedCommand', contents[contents.length - 1])); + } + else { + contents.push(scriptInline); + } + + // Write the script to disk. + tl.assertAgent('2.115.0'); + let tempDirectory = tl.getVariable('agent.tempDirectory'); + tl.checkPath(tempDirectory, `${tempDirectory} (agent.tempDirectory)`); + let filePath = path.join(tempDirectory, uuidV4() + '.ps1'); + await fs.writeFile( + filePath, + '\ufeff' + contents.join(os.EOL), // Prepend the Unicode BOM character. + { encoding: 'utf8' }, // Since UTF8 encoding is specified, node will + function (err) { // encode the BOM into its UTF8 binary sequence. + if (err) throw err; + console.log('Saved!'); + }); + console.log("## Az module initialization Complete"); + console.log("## Beginning Script Execution"); + // Run the script. + // + // Note, prefer "pwsh" over "powershell". At some point we can remove support for "powershell". + // + // Note, use "-Command" instead of "-File" to match the Windows implementation. Refer to + // comment on Windows implementation for an explanation why "-Command" is preferred. + let powershell = tl.tool(tl.which('pwsh') || tl.which('powershell') || tl.which('pwsh', true)) + .arg('-NoLogo') + .arg('-NoProfile') + .arg('-NonInteractive') + .arg('-ExecutionPolicy') + .arg('Unrestricted') + .arg('-Command') + .arg(`. '${filePath.replace(/'/g, "''")}'`); + + let options = { + cwd: input_workingDirectory, + failOnStdErr: false, + errStream: process.stdout, // Direct all output to STDOUT, otherwise the output may appear out + outStream: process.stdout, // of order since Node buffers it's own STDOUT but not STDERR. + ignoreReturnCode: true + }; + + // Listen for stderr. + let stderrFailure = false; + if (_vsts_input_failOnStandardError) { + powershell.on('stderr', (data) => { + stderrFailure = true; + }); + } + + // Run bash. + let exitCode: number = await powershell.exec(options); + + // Fail on exit code. + if (exitCode !== 0) { + tl.setResult(tl.TaskResult.Failed, tl.loc('JS_ExitCode', exitCode)); + } + + // Fail on stderr. + if (stderrFailure) { + tl.setResult(tl.TaskResult.Failed, tl.loc('JS_Stderr')); + } + console.log("## Script Execution Complete"); + } + catch (err) { + // troubleshoot link + const troubleshoot = "https://aka.ms/azurepowershelltroubleshooting"; + console.log(`##[error] run failed: For troubleshooting, refer: ${troubleshoot}`); + tl.setResult(tl.TaskResult.Failed, err.message || 'run() failed'); + } +} + + +run(); diff --git a/_generated/AzurePowerShellV4/icon.png b/_generated/AzurePowerShellV4/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..039b77995289e8e4627cd9332874ef713e92c1a5 GIT binary patch literal 15348 zcmeI3Yg7|w8pj8(lwI251-b2Mh?kYcWHJc>GAE>k1c9}|1cC)D>M$8#Fv*0>00HHq zRxRLKbx)7BD?(j#SFE_8QnY7RyVZ4DwcSd!R%i<@ZFOa(TF|;~4?B}Uc)2<4o_?I1 z6XxN4|NrNC=l5PRU#7~CoZ#ydmEyi$ zclUQ{At-tgX-a3(_0OX?WtC!PDw~ixt#(!cLF#9nb_`!jFrsWCm$b!*``$h+7Ln!{ z@e4}5OmEi`d1PX#gGen+HsPgfag|y8tj0&}MA-yZg26;itHnm6&KR*PFUrPTGb|Rl zB+S|vaV%F*l&&|3w3LGoDW#DT98pAzqEu2usfw0IED_0NNF*#%!AOKehM+PPDnmp= zAF;-Vjnocv4w|A{I#iDRFGiflFm@D%i;Ih;#R@6q$b}J=N(Ia0uv{)-6%x9{#$Zl~ zjh^pLGMq<8(71!NGbCjbae1+9s*s5hi@8Fc&(M8Y?Vdt5dWaoM5q4sB7?H~0iA-kP zH>6tPh#cXV0S;iq4}ZDe38+v@km-dcCLigyXeZCoD}f@kK0x zA*2&JX;X=vfKv#XDsPa{$V*IoKU!#u)4eWdXH79y5;SP!21` zXh5fdj4PE$((DQ?0ah-%eqE4bE)|!mNfzwT=wS;~cV)|L+94^8@zDYZT`Zw#RKKcPf`^ z@+35s!xUoCH8_8(oL&e5411|3D zbsr0<>|+9p5I?U>M*F_{tQ7&5vi3iv^H z&7-@OeOzFlRAA4e%IGQfY=oaU7`daLI5C(`C<4;pjRjo1h(LjW3#7pt3%Ga@fdT;+ zNP{;PaPcAn1p+RR25&6j;za}s1Y95u-dMoJiwG15xIh}bv4D#g5hxIFfi!qy0T(YK zP$1v}Y4FAZE?z{SK)?mk;Ee@byof-7fD5F-8wcoBgD0T)PvHx_X5A_4^hE|3Oq{8(H*BQO6EHujCbV)oU( z?()EN_O(C}o|vMCpwfj9RJjR)9uBhCTM$$zgP?z{fgp4b1kIy%tv0(XJ z>%F_P66YA_oF9DfLGQ)hrp)dHVp+=0w*xk0WEk&%AOEp-Y5W|M4kk^eHPejnLxX?+ z!g!I%FvqX|^319RLs;8uyG~|ii)&I2bu=AQ98=KiypJ$h#h=x0Rll;EzB5?dr+TnA z@UH>yo{p%lu;365{Wovw>iYq|y~AuNO1mFak`?s3p7xAcUOQ?NZx=m(yfbEBsCs+O zGxFDS+d3tyD?Y`SOz#T%+kvEpe^kp~y3yW#Ze4|MSNvPu*DgQ3{=2N)B)_wR(0lqD z`Hf$96rK0|<|=jVUjC-EvKbe=D&w|Rnl^MXhpYXH^4?GC={#|=wYFex_gAG~8c#<< zmS2Bq&wsu0LNeK4*xf<(gygSyYFki!oBqP!n|o3#R(A}nipA@yrfi))PjSvKw5cd> zy755QZ$1nde6u6HFYQwQwC&ScdXL}DtI534o^hwED@+`F<;CEG8DYugDFv2 zd>n>7I(zd`@Sm^xW!~C(>7sLGV+U1#F?dQsWy_NA#Z@hHzqsx5>iKX@#)7u)U4KG0 zC)B-TZ_C&mcu@5czTekNA-#KqR0sKAYeqJo53k#xQp#V1H8UfOnmAmecJ2?V+P57c``M zuX^#Xrp5)A#u_*F+j4u1!o z{r3lkKy2GPncWqK_xyc(Pwg4M2)G4rNi=-_*_nMyr|ZiW?TxIic}={e=fhdwHZHnf zW~fhSdoehnynM&ry0Bls{fl?cAMmSWfd(*+{7Y^)L z94m?|yR@v~bmrYxpR^7%`=8J$L$|etp37cQed=CFM`P%_H|rB5>pwqo^x^*I<6nHT zj)~N)GFHVk)4F}N&)u%cefgLE+y7bm-nF`q0?t%C^$iYfJAwV)P?g`xy_cI5pR8+& HTeI + + + + + + + + + + + + + + + + + + + diff --git a/_generated/AzurePowerShellV4/make.json b/_generated/AzurePowerShellV4/make.json new file mode 100644 index 000000000000..6e4e2035caab --- /dev/null +++ b/_generated/AzurePowerShellV4/make.json @@ -0,0 +1,52 @@ +{ + "rm": [ + { + "items": [ + "node_modules/https-proxy-agent/node_modules/agent-base", + "node_modules/azure-pipelines-tasks-azure-arm-rest/node_modules/azure-pipelines-task-lib", + "node_modules/azure-pipelines-tasks-utility-common/node_modules/azure-pipelines-task-lib", + "node_modules/azure-pipelines-tool-lib/node_modules/azure-pipelines-task-lib" + ], + "options": "-Rf" + } + ], + "common": [ + { + "module": "../Common/VstsAzureHelpers_", + "type": "ps" + }, + { + "module": "../Common/TlsHelper_", + "type": "ps" + } + ], + "externals": { + "nugetv2": [ + { + "name": "VstsTaskSdk", + "version": "0.11.0", + "repository": "https://www.powershellgallery.com/api/v2/", + "cp": [ + { + "source": [ + "*.dll", + "*.ps1", + "*.psd1", + "*.psm1", + "lib.json", + "Strings" + ], + "dest": "ps_modules/VstsTaskSdk/", + "options": "-R" + } + ] + } + ], + "archivePackages": [ + { + "url": "https://vstsagenttools.blob.core.windows.net/tools/7zip/4/7zip.zip", + "dest": "./" + } + ] + } +} diff --git a/_generated/AzurePowerShellV4/package-lock.json b/_generated/AzurePowerShellV4/package-lock.json new file mode 100644 index 000000000000..4df893519494 --- /dev/null +++ b/_generated/AzurePowerShellV4/package-lock.json @@ -0,0 +1,859 @@ +{ + "name": "azure-powershell-v4", + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@azure/msal-common": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-9.1.1.tgz", + "integrity": "sha512-we9xR8lvu47fF0h+J8KyXoRy9+G/fPzm3QEa2TrdR3jaVS3LKAyE2qyMuUkNdbVkvzl8Zr9f7l+IUSP22HeqXw==" + }, + "@azure/msal-node": { + "version": "1.14.5", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.14.5.tgz", + "integrity": "sha512-NcVdMfn8Z3ogN+9RjOSF7uwf2Gki5DEJl0BdDSL83KUAgVAobtkZi5W8EqxbJLrTO/ET0jv5DregrcR5qg2pEA==", + "requires": { + "@azure/msal-common": "^9.0.1", + "jsonwebtoken": "^8.5.1", + "uuid": "^8.3.0" + }, + "dependencies": { + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } + } + }, + "@types/concat-stream": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.1.tgz", + "integrity": "sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==", + "requires": { + "@types/node": "*" + } + }, + "@types/form-data": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", + "integrity": "sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==", + "requires": { + "@types/node": "*" + } + }, + "@types/jsonwebtoken": { + "version": "8.5.9", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.9.tgz", + "integrity": "sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg==", + "requires": { + "@types/node": "*" + } + }, + "@types/mocha": { + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", + "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==" + }, + "@types/node": { + "version": "16.18.39", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.39.tgz", + "integrity": "sha512-8q9ZexmdYYyc5/cfujaXb4YOucpQxAV4RMG0himLyDUOEr8Mr79VrqsFI+cQ2M2h89YIuy95lbxuYjxT4Hk4kQ==" + }, + "@types/q": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.0.7.tgz", + "integrity": "sha512-0WS7XU7sXzQ7J1nbnMKKYdjrrFoO3YtZYgUzeV8JFXffPnHfvSJQleR70I8BOAsOm14i4dyaAZ3YzqIl1YhkXQ==" + }, + "@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + }, + "@types/semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ==" + }, + "@types/uuid": { + "version": "3.4.10", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.10.tgz", + "integrity": "sha512-BgeaZuElf7DEYZhWYDTc/XcLZXdVgFkVSTa13BqKvbnmUrxr3TJFKofUxCtDO9UQOdhnV+HPOESdHiHKZOJV1A==" + }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "requires": { + "debug": "4" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==" + }, + "async-mutex": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.4.0.tgz", + "integrity": "sha512-eJFZ1YhRR8UN8eBLoNzcDPcy/jqjsg6I1AP+KvWQX80BqOSW1oJPJXDylPUEeMr2ZQvHgnQ//Lp6f3RQ1zI7HA==", + "requires": { + "tslib": "^2.4.0" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "azure-devops-node-api": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-12.1.0.tgz", + "integrity": "sha512-VY+G45eNKVJfMIO0uyZfbi4PzUR8JHEfsHQjEUAXUGRkYhhBbhGHjy8cpiyYFxLXc3a4PL5cqgqqV/YD1SaCXg==", + "requires": { + "tunnel": "0.0.6", + "typed-rest-client": "^1.8.4" + } + }, + "azure-pipelines-task-lib": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-4.4.0.tgz", + "integrity": "sha512-JgtxfjxjRA+KWY0Q5UC1fo48nkbVxFHgKEuasKdJMSNxHydOyNlB5MNw4UTiTXp9b0nnqKeOQOBn5RN3go3aPg==", + "requires": { + "minimatch": "3.0.5", + "mockery": "^2.1.0", + "q": "^1.5.1", + "semver": "^5.1.0", + "shelljs": "^0.8.5", + "sync-request": "6.1.0", + "uuid": "^3.0.1" + } + }, + "azure-pipelines-tasks-azure-arm-rest": { + "version": "3.225.1", + "resolved": "https://registry.npmjs.org/azure-pipelines-tasks-azure-arm-rest/-/azure-pipelines-tasks-azure-arm-rest-3.225.1.tgz", + "integrity": "sha512-fbRcoYKEbFj2jslocX4wV0hbnN/9ZGepdzcLI+5vdOkGcKNIdOctUNvggrN1KFg9nH+NoxK1pE4+kl316VVpMA==", + "requires": { + "@azure/msal-node": "1.14.5", + "@types/jsonwebtoken": "^8.5.8", + "@types/mocha": "^5.2.7", + "@types/node": "^10.17.0", + "@types/q": "1.5.4", + "async-mutex": "^0.4.0", + "azure-devops-node-api": "^12.0.0", + "azure-pipelines-task-lib": "^3.4.0", + "https-proxy-agent": "^4.0.0", + "jsonwebtoken": "^8.5.1", + "node-fetch": "^2.6.7", + "q": "1.5.1", + "typed-rest-client": "1.8.4", + "xml2js": "0.4.13" + }, + "dependencies": { + "@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + }, + "@types/q": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.4.tgz", + "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==" + }, + "azure-pipelines-task-lib": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-3.4.0.tgz", + "integrity": "sha512-3eC4OTFw+7xD7A2aUhxR/j+jRlTI+vVfS0CGxt1pCLs4c/KmY0tQWgbqjD3157kmiucWxELBvgZHaD2gCBe9fg==", + "requires": { + "minimatch": "3.0.5", + "mockery": "^2.1.0", + "q": "^1.5.1", + "semver": "^5.1.0", + "shelljs": "^0.8.5", + "sync-request": "6.1.0", + "uuid": "^3.0.1" + } + } + } + }, + "azure-pipelines-tasks-utility-common": { + "version": "3.225.0", + "resolved": "https://registry.npmjs.org/azure-pipelines-tasks-utility-common/-/azure-pipelines-tasks-utility-common-3.225.0.tgz", + "integrity": "sha512-Na7g1+zcsQpYogyex457QT6o9EB2+WQYwLUXPiszhTdf83hKJUmDMqvl2qm/mHqYuP1zg5KkRfJaPy4/09M8pA==", + "requires": { + "@types/node": "^16.11.39", + "azure-pipelines-task-lib": "^4.4.0", + "azure-pipelines-tool-lib": "^2.0.0-preview", + "js-yaml": "3.13.1", + "semver": "^5.4.1" + } + }, + "azure-pipelines-tool-lib": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/azure-pipelines-tool-lib/-/azure-pipelines-tool-lib-2.0.4.tgz", + "integrity": "sha512-LgAelZKJe3k/t3NsKSKzjeRviphns0w0p5tgwz8uHN70I9m2TToiOKl+fogrdXcM6+jiLBk5KTqrcRBqPpv/XA==", + "requires": { + "@types/semver": "^5.3.0", + "@types/uuid": "^3.4.5", + "azure-pipelines-task-lib": "^4.1.0", + "semver": "^5.7.0", + "semver-compare": "^1.0.0", + "typed-rest-client": "^1.8.6", + "uuid": "^3.3.2" + }, + "dependencies": { + "typed-rest-client": { + "version": "1.8.11", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.11.tgz", + "integrity": "sha512-5UvfMpd1oelmUPRbbaVnq+rHP7ng2cE4qoQkQeAqxRL6PklkxsM0g32/HL0yfvruK6ojQ5x8EE+HF4YV6DtuCA==", + "requires": { + "qs": "^6.9.1", + "tunnel": "0.0.6", + "underscore": "^1.12.1" + } + } + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" + }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, + "form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + } + }, + "get-port": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", + "integrity": "sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg==" + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "dependencies": { + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==" + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "http-basic": { + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-8.1.3.tgz", + "integrity": "sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw==", + "requires": { + "caseless": "^0.12.0", + "concat-stream": "^1.6.2", + "http-response-object": "^3.0.1", + "parse-cache-control": "^1.0.1" + } + }, + "http-response-object": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz", + "integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==", + "requires": { + "@types/node": "^10.0.3" + }, + "dependencies": { + "@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + } + } + }, + "https-proxy-agent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz", + "integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==", + "requires": { + "agent-base": "5", + "debug": "4" + }, + "dependencies": { + "agent-base": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", + "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==" + } + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" + }, + "is-core-module": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", + "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", + "requires": { + "has": "^1.0.3" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsonwebtoken": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "requires": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + } + }, + "jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, + "minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "mockery": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mockery/-/mockery-2.1.0.tgz", + "integrity": "sha512-9VkOmxKlWXoDO/h1jDZaS4lH33aWfRiJiNT/tKj+8OGzrcFDLo8d0syGdbsc3Bc4GvRXPb+NMMvojotmuGJTvA==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node-fetch": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", + "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "requires": { + "wrappy": "1" + } + }, + "parse-cache-control": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", + "integrity": "sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg==" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "promise": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", + "integrity": "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==", + "requires": { + "asap": "~2.0.6" + } + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==" + }, + "qs": { + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", + "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", + "requires": { + "side-channel": "^1.0.4" + } + }, + "readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "requires": { + "resolve": "^1.1.6" + } + }, + "resolve": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "requires": { + "is-core-module": "^2.11.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + }, + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" + }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==" + }, + "shelljs": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + }, + "sync-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-6.1.0.tgz", + "integrity": "sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw==", + "requires": { + "http-response-object": "^3.0.1", + "sync-rpc": "^1.2.1", + "then-request": "^6.0.0" + } + }, + "sync-rpc": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/sync-rpc/-/sync-rpc-1.3.6.tgz", + "integrity": "sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw==", + "requires": { + "get-port": "^3.1.0" + } + }, + "then-request": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/then-request/-/then-request-6.0.2.tgz", + "integrity": "sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA==", + "requires": { + "@types/concat-stream": "^1.6.0", + "@types/form-data": "0.0.33", + "@types/node": "^8.0.0", + "@types/qs": "^6.2.31", + "caseless": "~0.12.0", + "concat-stream": "^1.6.0", + "form-data": "^2.2.0", + "http-basic": "^8.1.1", + "http-response-object": "^3.0.1", + "promise": "^8.0.0", + "qs": "^6.4.0" + }, + "dependencies": { + "@types/node": { + "version": "8.10.66", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz", + "integrity": "sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==" + } + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "tslib": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.1.tgz", + "integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==" + }, + "tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" + }, + "typed-rest-client": { + "version": "1.8.4", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.4.tgz", + "integrity": "sha512-MyfKKYzk3I6/QQp6e1T50py4qg+c+9BzOEl2rBmQIpStwNUoqQ73An+Tkfy9YuV7O+o2mpVVJpe+fH//POZkbg==", + "requires": { + "qs": "^6.9.1", + "tunnel": "0.0.6", + "underscore": "^1.12.1" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + }, + "typescript": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", + "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", + "dev": true + }, + "underscore": { + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", + "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "xml2js": { + "version": "0.4.13", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.13.tgz", + "integrity": "sha512-BoxD65qWA2p4znzbaati/Td19uFEc0X6ydj0bFphJO62RrNaGqOyW6ljLWPo3GKDbvW/6dnxAoRX01BsgEWsMA==", + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": ">=2.4.6" + } + }, + "xmlbuilder": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", + "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==" + } + } +} diff --git a/_generated/AzurePowerShellV4/package.json b/_generated/AzurePowerShellV4/package.json new file mode 100644 index 000000000000..9d310c0b992f --- /dev/null +++ b/_generated/AzurePowerShellV4/package.json @@ -0,0 +1,18 @@ +{ + "name": "azure-powershell-v4", + "author": { + "name": "Microsoft Corporation" + }, + "dependencies": { + "@types/mocha": "^5.2.7", + "@types/node": "^16.11.39", + "@types/q": "1.0.7", + "agent-base": "6.0.2", + "azure-pipelines-task-lib": "^4.4.0", + "azure-pipelines-tasks-azure-arm-rest": "^3.225.1", + "azure-pipelines-tasks-utility-common": "^3.225.0" + }, + "devDependencies": { + "typescript": "4.0.2" + } +} diff --git a/_generated/AzurePowerShellV4/task.json b/_generated/AzurePowerShellV4/task.json new file mode 100644 index 000000000000..a4a1b586683d --- /dev/null +++ b/_generated/AzurePowerShellV4/task.json @@ -0,0 +1,217 @@ +{ + "id": "72A1931B-EFFB-4D2E-8FD8-F8472A07CB62", + "name": "AzurePowerShell", + "friendlyName": "Azure PowerShell", + "description": "Run a PowerShell script within an Azure environment", + "helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?LinkID=613749)", + "helpUrl": "https://aka.ms/azurepowershelltroubleshooting", + "category": "Deploy", + "visibility": [ + "Build", + "Release" + ], + "runsOn": [ + "Agent", + "DeploymentGroup" + ], + "author": "Microsoft Corporation", + "version": { + "Major": 4, + "Minor": 234, + "Patch": 0 + }, + "releaseNotes": "Added support for Az Module and cross platform agents.", + "groups": [ + { + "name": "AzurePowerShellVersionOptions", + "displayName": "Azure PowerShell version options", + "isExpanded": true + }, + { + "name": "advanced", + "displayName": "Advanced", + "isExpanded": false + } + ], + "minimumAgentVersion": "2.115.0", + "inputs": [ + { + "name": "ConnectedServiceNameARM", + "aliases": [ + "azureSubscription" + ], + "type": "connectedService:AzureRM", + "label": "Azure Subscription", + "defaultValue": "", + "required": true, + "helpMarkDown": "Azure Resource Manager subscription to configure before running PowerShell", + "properties": { + "EndpointFilterRule": "ScopeLevel != AzureMLWorkspace" + } + }, + { + "name": "ScriptType", + "type": "radio", + "label": "Script Type", + "required": false, + "helpMarkDown": "Type of the script: File Path or Inline Script", + "defaultValue": "FilePath", + "options": { + "FilePath": "Script File Path", + "InlineScript": "Inline Script" + } + }, + { + "name": "ScriptPath", + "type": "filePath", + "label": "Script Path", + "defaultValue": "", + "required": false, + "helpMarkDown": "Path of the script. Should be fully qualified path or relative to the default working directory.", + "visibleRule": "ScriptType = FilePath" + }, + { + "name": "Inline", + "type": "multiLine", + "label": "Inline Script", + "required": false, + "defaultValue": "# You can write your azure powershell scripts inline here. \n# You can also pass predefined and custom variables to this script using arguments", + "helpMarkDown": "Enter the script to execute.", + "visibleRule": "ScriptType = InlineScript", + "properties": { + "resizable": "true", + "rows": "10", + "maxLength": "5000" + } + }, + { + "name": "ScriptArguments", + "type": "string", + "label": "Script Arguments", + "defaultValue": "", + "visibleRule": "ScriptType = FilePath", + "required": false, + "properties": { + "editorExtension": "ms.vss-services-azure.parameters-grid" + }, + "helpMarkDown": "Additional parameters to pass to PowerShell. Can be either ordinal or named parameters." + }, + { + "name": "errorActionPreference", + "type": "pickList", + "label": "ErrorActionPreference", + "required": false, + "defaultValue": "stop", + "options": { + "stop": "Stop", + "continue": "Continue", + "silentlyContinue": "SilentlyContinue" + }, + "helpMarkDown": "Select the value of the ErrorActionPreference variable for executing the script." + }, + { + "name": "FailOnStandardError", + "type": "boolean", + "label": "Fail on Standard Error", + "required": false, + "defaultValue": "false", + "helpMarkDown": "If this is true, this task will fail if any errors are written to the error pipeline, or if any data is written to the Standard Error stream." + }, + { + "name": "RestrictContextToCurrentTask", + "type": "boolean", + "label": "Restrict scope of context to current task", + "required": false, + "defaultValue": "false", + "helpMarkDown": "If this is true, this task will restrict the scope of context to current task only and the context will not be available to other tasks in the pipeline when using private agent." + }, + { + "name": "TargetAzurePs", + "aliases": [ + "azurePowerShellVersion" + ], + "type": "radio", + "label": "Azure PowerShell Version", + "defaultValue": "OtherVersion", + "required": false, + "options": { + "LatestVersion": "Latest installed version", + "OtherVersion": "Specify other version" + }, + "groupName": "AzurePowerShellVersionOptions", + "helpMarkDown": "In case of hosted agents, the supported Azure PowerShell Version is: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0 (Hosted VS2017 Queue).\nTo pick the latest version available on the agent, select \"Latest installed version\".\n\nFor private agents you can specify preferred version of Azure PowerShell using \"Specify version\"" + }, + { + "name": "CustomTargetAzurePs", + "aliases": [ + "preferredAzurePowerShellVersion" + ], + "type": "string", + "label": "Preferred Azure PowerShell Version", + "defaultValue": "", + "required": true, + "visibleRule": "TargetAzurePs = OtherVersion", + "groupName": "AzurePowerShellVersionOptions", + "helpMarkDown": "Preferred Azure PowerShell Version needs to be a proper semantic version eg. 1.2.3. Regex like 2.\\*,2.3.\\* is not supported. The Hosted VS2017 Pool currently supports Az module version: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0" + }, + { + "name": "pwsh", + "type": "boolean", + "label": "Use PowerShell Core", + "required": false, + "defaultValue": "false", + "helpMarkDown": "If this is true, then on Windows the task will use pwsh.exe from your PATH instead of powershell.exe.", + "groupName": "advanced" + }, + { + "name": "validateScriptSignature", + "type": "boolean", + "label": "Validate script signature", + "required": false, + "defaultValue": "false", + "helpMarkDown": "If this is true, then the task will first check to make sure specified script is signed and valid before executing it.", + "groupName": "advanced", + "visibleRule": "ScriptType = FilePath" + }, + { + "name": "workingDirectory", + "type": "filePath", + "label": "Working Directory", + "required": false, + "defaultValue": "", + "helpMarkDown": "Working directory where the script is run.", + "groupName": "advanced" + } + ], + "instanceNameFormat": "Azure PowerShell script: $(ScriptType)", + "execution": { + "PowerShell3": { + "target": "azurepowershell.ps1", + "platforms": [ + "windows" + ] + }, + "Node10": { + "target": "azurepowershell.js", + "argumentFormat": "" + }, + "Node16": { + "target": "azurepowershell.js", + "argumentFormat": "" + } + }, + "messages": { + "GeneratingScript": "Generating script.", + "JS_FormattedCommand": "Formatted command: %s", + "InvalidScriptArguments0": "Invalid script arguments '{0}'. Line breaks are not allowed.", + "InvalidScriptPath0": "Invalid script path '{0}'. Invalid path characters specified.", + "InvalidAzurePsVersion": "The Azure PowerShell version '{0}' specified is not in the correct format. Please check the format. An example of correct format is 1.0.1", + "JS_ExitCode": "PowerShell exited with code '%s'.", + "JS_Stderr": "PowerShell wrote one or more lines to the standard error stream.", + "ExpiredServicePrincipal": "Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired." + }, + "_buildConfigMapping": { + "Default": "4.234.0", + "Node20_229_2": "4.234.1" + } +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/task.loc.json b/_generated/AzurePowerShellV4/task.loc.json new file mode 100644 index 000000000000..5cab57b90782 --- /dev/null +++ b/_generated/AzurePowerShellV4/task.loc.json @@ -0,0 +1,217 @@ +{ + "id": "72A1931B-EFFB-4D2E-8FD8-F8472A07CB62", + "name": "AzurePowerShell", + "friendlyName": "ms-resource:loc.friendlyName", + "description": "ms-resource:loc.description", + "helpMarkDown": "ms-resource:loc.helpMarkDown", + "helpUrl": "https://aka.ms/azurepowershelltroubleshooting", + "category": "Deploy", + "visibility": [ + "Build", + "Release" + ], + "runsOn": [ + "Agent", + "DeploymentGroup" + ], + "author": "Microsoft Corporation", + "version": { + "Major": 4, + "Minor": 234, + "Patch": 0 + }, + "releaseNotes": "ms-resource:loc.releaseNotes", + "groups": [ + { + "name": "AzurePowerShellVersionOptions", + "displayName": "ms-resource:loc.group.displayName.AzurePowerShellVersionOptions", + "isExpanded": true + }, + { + "name": "advanced", + "displayName": "ms-resource:loc.group.displayName.advanced", + "isExpanded": false + } + ], + "minimumAgentVersion": "2.115.0", + "inputs": [ + { + "name": "ConnectedServiceNameARM", + "aliases": [ + "azureSubscription" + ], + "type": "connectedService:AzureRM", + "label": "ms-resource:loc.input.label.ConnectedServiceNameARM", + "defaultValue": "", + "required": true, + "helpMarkDown": "ms-resource:loc.input.help.ConnectedServiceNameARM", + "properties": { + "EndpointFilterRule": "ScopeLevel != AzureMLWorkspace" + } + }, + { + "name": "ScriptType", + "type": "radio", + "label": "ms-resource:loc.input.label.ScriptType", + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.ScriptType", + "defaultValue": "FilePath", + "options": { + "FilePath": "Script File Path", + "InlineScript": "Inline Script" + } + }, + { + "name": "ScriptPath", + "type": "filePath", + "label": "ms-resource:loc.input.label.ScriptPath", + "defaultValue": "", + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.ScriptPath", + "visibleRule": "ScriptType = FilePath" + }, + { + "name": "Inline", + "type": "multiLine", + "label": "ms-resource:loc.input.label.Inline", + "required": false, + "defaultValue": "# You can write your azure powershell scripts inline here. \n# You can also pass predefined and custom variables to this script using arguments", + "helpMarkDown": "ms-resource:loc.input.help.Inline", + "visibleRule": "ScriptType = InlineScript", + "properties": { + "resizable": "true", + "rows": "10", + "maxLength": "5000" + } + }, + { + "name": "ScriptArguments", + "type": "string", + "label": "ms-resource:loc.input.label.ScriptArguments", + "defaultValue": "", + "visibleRule": "ScriptType = FilePath", + "required": false, + "properties": { + "editorExtension": "ms.vss-services-azure.parameters-grid" + }, + "helpMarkDown": "ms-resource:loc.input.help.ScriptArguments" + }, + { + "name": "errorActionPreference", + "type": "pickList", + "label": "ms-resource:loc.input.label.errorActionPreference", + "required": false, + "defaultValue": "stop", + "options": { + "stop": "Stop", + "continue": "Continue", + "silentlyContinue": "SilentlyContinue" + }, + "helpMarkDown": "ms-resource:loc.input.help.errorActionPreference" + }, + { + "name": "FailOnStandardError", + "type": "boolean", + "label": "ms-resource:loc.input.label.FailOnStandardError", + "required": false, + "defaultValue": "false", + "helpMarkDown": "ms-resource:loc.input.help.FailOnStandardError" + }, + { + "name": "RestrictContextToCurrentTask", + "type": "boolean", + "label": "ms-resource:loc.input.label.RestrictContextToCurrentTask", + "required": false, + "defaultValue": "false", + "helpMarkDown": "ms-resource:loc.input.help.RestrictContextToCurrentTask" + }, + { + "name": "TargetAzurePs", + "aliases": [ + "azurePowerShellVersion" + ], + "type": "radio", + "label": "ms-resource:loc.input.label.TargetAzurePs", + "defaultValue": "OtherVersion", + "required": false, + "options": { + "LatestVersion": "Latest installed version", + "OtherVersion": "Specify other version" + }, + "groupName": "AzurePowerShellVersionOptions", + "helpMarkDown": "ms-resource:loc.input.help.TargetAzurePs" + }, + { + "name": "CustomTargetAzurePs", + "aliases": [ + "preferredAzurePowerShellVersion" + ], + "type": "string", + "label": "ms-resource:loc.input.label.CustomTargetAzurePs", + "defaultValue": "", + "required": true, + "visibleRule": "TargetAzurePs = OtherVersion", + "groupName": "AzurePowerShellVersionOptions", + "helpMarkDown": "ms-resource:loc.input.help.CustomTargetAzurePs" + }, + { + "name": "pwsh", + "type": "boolean", + "label": "ms-resource:loc.input.label.pwsh", + "required": false, + "defaultValue": "false", + "helpMarkDown": "ms-resource:loc.input.help.pwsh", + "groupName": "advanced" + }, + { + "name": "validateScriptSignature", + "type": "boolean", + "label": "ms-resource:loc.input.label.validateScriptSignature", + "required": false, + "defaultValue": "false", + "helpMarkDown": "ms-resource:loc.input.help.validateScriptSignature", + "groupName": "advanced", + "visibleRule": "ScriptType = FilePath" + }, + { + "name": "workingDirectory", + "type": "filePath", + "label": "ms-resource:loc.input.label.workingDirectory", + "required": false, + "defaultValue": "", + "helpMarkDown": "ms-resource:loc.input.help.workingDirectory", + "groupName": "advanced" + } + ], + "instanceNameFormat": "ms-resource:loc.instanceNameFormat", + "execution": { + "PowerShell3": { + "target": "azurepowershell.ps1", + "platforms": [ + "windows" + ] + }, + "Node10": { + "target": "azurepowershell.js", + "argumentFormat": "" + }, + "Node16": { + "target": "azurepowershell.js", + "argumentFormat": "" + } + }, + "messages": { + "GeneratingScript": "ms-resource:loc.messages.GeneratingScript", + "JS_FormattedCommand": "ms-resource:loc.messages.JS_FormattedCommand", + "InvalidScriptArguments0": "ms-resource:loc.messages.InvalidScriptArguments0", + "InvalidScriptPath0": "ms-resource:loc.messages.InvalidScriptPath0", + "InvalidAzurePsVersion": "ms-resource:loc.messages.InvalidAzurePsVersion", + "JS_ExitCode": "ms-resource:loc.messages.JS_ExitCode", + "JS_Stderr": "ms-resource:loc.messages.JS_Stderr", + "ExpiredServicePrincipal": "ms-resource:loc.messages.ExpiredServicePrincipal" + }, + "_buildConfigMapping": { + "Default": "4.234.0", + "Node20_229_2": "4.234.1" + } +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4/tsconfig.json b/_generated/AzurePowerShellV4/tsconfig.json new file mode 100644 index 000000000000..6a07b24acf54 --- /dev/null +++ b/_generated/AzurePowerShellV4/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "target": "ES6", + "module": "commonjs", + "skipLibCheck": true + } +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV4_Node20/task.json b/_generated/AzurePowerShellV4_Node20/task.json index fe172213b2d3..337dbfca7ee8 100644 --- a/_generated/AzurePowerShellV4_Node20/task.json +++ b/_generated/AzurePowerShellV4_Node20/task.json @@ -17,8 +17,8 @@ "author": "Microsoft Corporation", "version": { "Major": 4, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 1 }, "releaseNotes": "Added support for Az Module and cross platform agents.", "groups": [ @@ -215,7 +215,7 @@ "ExpiredServicePrincipal": "Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired." }, "_buildConfigMapping": { - "Default": "4.231.0", - "Node20_229_2": "4.231.2" + "Default": "4.234.0", + "Node20_229_2": "4.234.1" } } \ No newline at end of file diff --git a/_generated/AzurePowerShellV4_Node20/task.loc.json b/_generated/AzurePowerShellV4_Node20/task.loc.json index 4c741d5a9ebd..328e84159244 100644 --- a/_generated/AzurePowerShellV4_Node20/task.loc.json +++ b/_generated/AzurePowerShellV4_Node20/task.loc.json @@ -17,8 +17,8 @@ "author": "Microsoft Corporation", "version": { "Major": 4, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 1 }, "releaseNotes": "ms-resource:loc.releaseNotes", "groups": [ @@ -215,7 +215,7 @@ "ExpiredServicePrincipal": "ms-resource:loc.messages.ExpiredServicePrincipal" }, "_buildConfigMapping": { - "Default": "4.231.0", - "Node20_229_2": "4.231.2" + "Default": "4.234.0", + "Node20_229_2": "4.234.1" } } \ No newline at end of file diff --git a/_generated/AzurePowerShellV5.versionmap.txt b/_generated/AzurePowerShellV5.versionmap.txt index 5f75d031b10a..093b5dc77f7a 100644 --- a/_generated/AzurePowerShellV5.versionmap.txt +++ b/_generated/AzurePowerShellV5.versionmap.txt @@ -1,2 +1,2 @@ -Default|5.231.0 -Node20_229_2|5.231.2 +Default|5.234.0 +Node20_229_2|5.234.1 diff --git a/_generated/AzurePowerShellV5/AzurePowerShell.ps1 b/_generated/AzurePowerShellV5/AzurePowerShell.ps1 new file mode 100644 index 000000000000..a2bcc5ffb40e --- /dev/null +++ b/_generated/AzurePowerShellV5/AzurePowerShell.ps1 @@ -0,0 +1,199 @@ +Trace-VstsEnteringInvocation $MyInvocation +Import-VstsLocStrings "$PSScriptRoot\Task.json" + +# Get inputs. +$scriptType = Get-VstsInput -Name ScriptType -Require +$scriptPath = Get-VstsInput -Name ScriptPath +$scriptInline = Get-VstsInput -Name Inline +$scriptArguments = Get-VstsInput -Name ScriptArguments +$__vsts_input_errorActionPreference = Get-VstsInput -Name errorActionPreference +$__vsts_input_failOnStandardError = Get-VstsInput -Name FailOnStandardError -AsBool +$targetAzurePs = Get-VstsInput -Name TargetAzurePs +$customTargetAzurePs = Get-VstsInput -Name CustomTargetAzurePs +$input_pwsh = Get-VstsInput -Name pwsh -AsBool -Default $false +$input_workingDirectory = Get-VstsInput -Name workingDirectory -Require +$validateScriptSignature = Get-VstsInput -Name validateScriptSignature -AsBool + +# Validate the script path and args do not contains new-lines. Otherwise, it will +# break invoking the script via Invoke-Expression. +if ($scriptType -eq "FilePath") { + if ($scriptPath -match '[\r\n]' -or [string]::IsNullOrWhitespace($scriptPath)) { + throw (Get-VstsLocString -Key InvalidScriptPath0 -ArgumentList $scriptPath) + } +} + +if ($scriptArguments -match '[\r\n]') { + throw (Get-VstsLocString -Key InvalidScriptArguments0 -ArgumentList $scriptArguments) +} + +# string constants +$otherVersion = "OtherVersion" +$latestVersion = "LatestVersion" + +if ($targetAzurePs -eq $otherVersion) { + if ($null -eq $customTargetAzurePs) { + throw (Get-VstsLocString -Key InvalidAzurePsVersion $customTargetAzurePs) + } else { + $targetAzurePs = $customTargetAzurePs.Trim() + } +} + +$pattern = "^[0-9]+\.[0-9]+\.[0-9]+$" +$regex = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList $pattern + +if ($targetAzurePs -eq $latestVersion) { + $targetAzurePs = "" +} elseif (-not($regex.IsMatch($targetAzurePs))) { + throw (Get-VstsLocString -Key InvalidAzurePsVersion -ArgumentList $targetAzurePs) +} + +. $PSScriptRoot\TryMakingModuleAvailable.ps1 -targetVersion "$targetAzurePs" -platform Windows + +if ($validateScriptSignature) { + try { + if ($scriptType -ne "InlineScript") { + Write-Host "## Validating Script Signature" + + # Validate script is signed + $scriptSignature = Get-AuthenticodeSignature $scriptPath + if ($scriptSignature.Status -eq "NotSigned") { + throw "Object does not have a digital signature. Please ensure your script is signed and try again." + } + elseif ($scriptSignature.Status -ne "Valid") { + throw "Digital signature of the object did not verify. Please ensure your script is properly signed and try again." + } + + Write-Host "## Validating Script Signature Complete" + } + } + catch + { + $errorMsg = $_.Exception.Message + throw "Unable to validate script signature: $errorMsg" + } +} + +. "$PSScriptRoot\Utility.ps1" + +$serviceName = Get-VstsInput -Name ConnectedServiceNameARM -Require +$endpointObject = Get-VstsEndpoint -Name $serviceName -Require +$endpoint = ConvertTo-Json $endpointObject +$vstsEndpoint = Get-VstsEndpoint -Name SystemVssConnection -Require +$vstsAccessToken = $vstsEndpoint.auth.parameters.AccessToken + +try +{ + # Generate the script contents. + Write-Host (Get-VstsLocString -Key 'GeneratingScript') + $contents = @() + $contents += "`$ErrorActionPreference = '$__vsts_input_errorActionPreference'" + if ($env:system_debug -eq "true") { + $contents += "`$VerbosePreference = 'continue'" + } + + $CoreAzArgument = "-endpoint '$endpoint' -connectedServiceNameARM $serviceName -vstsAccessToken $vstsAccessToken -isPSCore $" + "$input_pwsh" + if ($targetAzurePs) { + $CoreAzArgument += " -targetAzurePs $targetAzurePs" + } + $contents += ". '$PSScriptRoot\CoreAz.ps1' $CoreAzArgument" + + if ($scriptType -eq "InlineScript") { + $contents += "$scriptInline".Replace("`r`n", "`n").Replace("`n", "`r`n") + } else { + $contents += ". '$("$scriptPath".Replace("'", "''"))' $scriptArguments".Trim() + } + + # Write the script to disk. + $__vstsAzPSScriptPath = [System.IO.Path]::Combine($env:Agent_TempDirectory, ([guid]::NewGuid().ToString() + ".ps1")); + $joinedContents = [System.String]::Join( + ([System.Environment]::NewLine), + $contents) + $null = [System.IO.File]::WriteAllText( + $__vstsAzPSScriptPath, + $joinedContents, + ([System.Text.Encoding]::UTF8)) + + # Prepare the external command values. + # + # Note, use "-Command" instead of "-File". On PowerShell V5, V4 and V3 when using "-File", terminating + # errors do not cause a non-zero exit code. + if ($input_pwsh) { + $powershellPath = Get-Command -Name pwsh.exe -CommandType Application | Select-Object -First 1 -ExpandProperty Path + } else { + $powershellPath = Get-Command -Name powershell.exe -CommandType Application | Select-Object -First 1 -ExpandProperty Path + } + Assert-VstsPath -LiteralPath $powershellPath -PathType 'Leaf' + $arguments = "-NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command `". '$($__vstsAzPSScriptPath.Replace("'", "''"))'`"" + $splat = @{ + 'FileName' = $powershellPath + 'Arguments' = $arguments + 'WorkingDirectory' = $input_workingDirectory + } + + # Switch to "Continue". + $global:ErrorActionPreference = 'Continue' + $failed = $false + + # Run the script. + Write-Host '========================== Starting Command Output ===========================' + if (!$__vsts_input_failOnStandardError) { + Invoke-VstsTool @splat + } + else { + $inError = $false + $errorLines = New-Object System.Text.StringBuilder + Invoke-VstsTool @splat 2>&1 | + ForEach-Object { + if ($_ -is [System.Management.Automation.ErrorRecord]) { + # Buffer the error lines. + $failed = $true + $inError = $true + $null = $errorLines.AppendLine("$($_.Exception.Message)") + + # Write to verbose to mitigate if the process hangs. + Write-Verbose "STDERR: $($_.Exception.Message)" + } else { + # Flush the error buffer. + if ($inError) { + $inError = $false + $message = $errorLines.ToString().Trim() + $null = $errorLines.Clear() + if ($message) { + Write-VstsTaskError -Message $message + } + } + + Write-Host "$_" + } + } + + # Flush the error buffer one last time. + if ($inError) { + $inError = $false + $message = $errorLines.ToString().Trim() + $null = $errorLines.Clear() + if ($message) { + Write-VstsTaskError -Message $message + } + } + } + + if ($LASTEXITCODE -ne 0) { + $failed = $true + Write-VstsTaskError -Message (Get-VstsLocString -Key 'PS_ExitCode' -ArgumentList $LASTEXITCODE) + } + + # Fail if any errors. + if ($failed) { + Write-VstsSetResult -Result 'Failed' -Message "Error detected" -DoNotThrow + } +} +finally { + if ($__vstsAzPSInlineScriptPath -and (Test-Path -LiteralPath $__vstsAzPSInlineScriptPath) ) { + Remove-Item -LiteralPath $__vstsAzPSInlineScriptPath -ErrorAction 'SilentlyContinue' + } + + Import-Module $PSScriptRoot\ps_modules\VstsAzureHelpers_ + Remove-EndpointSecrets + Disconnect-AzureAndClearContext -ErrorAction SilentlyContinue +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/CoreAz.ps1 b/_generated/AzurePowerShellV5/CoreAz.ps1 new file mode 100644 index 000000000000..b78884c0be5f --- /dev/null +++ b/_generated/AzurePowerShellV5/CoreAz.ps1 @@ -0,0 +1,32 @@ +[CmdletBinding()] +param +( + [String] [Parameter(Mandatory = $true)] + $endpoint, + + [String] [Parameter(Mandatory = $false)] + $connectedServiceNameARM, + + [String] [Parameter(Mandatory = $false)] + $targetAzurePs, + + [bool] [Parameter(Mandatory = $false)] + $isPSCore, + + [String] [Parameter(Mandatory = $false)] + $vstsAccessToken +) + +Import-Module "$PSScriptRoot\ps_modules\VstsTaskSdk" -ArgumentList @{ NonInteractive = $true } +Import-VstsLocStrings -LiteralPath "$PSScriptRoot\task.json" + +# Update PSModulePath for hosted agent +. "$PSScriptRoot\Utility.ps1" +CleanUp-PSModulePathForHostedAgent +Update-PSModulePathForHostedAgent -targetAzurePs $targetAzurePs + +$endpointObject = ConvertFrom-Json $endpoint +Import-Module "$PSScriptRoot\ps_modules\VstsAzureHelpers_" +$encryptedToken = ConvertTo-SecureString $vstsAccessToken -AsPlainText -Force +Initialize-AzModule -Endpoint $endpointObject -connectedServiceNameARM $connectedServiceNameARM ` + -azVersion $targetAzurePs -isPSCore $isPSCore -encryptedToken $encryptedToken \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/InitializeAz.ps1 b/_generated/AzurePowerShellV5/InitializeAz.ps1 new file mode 100644 index 000000000000..f820acb0bf50 --- /dev/null +++ b/_generated/AzurePowerShellV5/InitializeAz.ps1 @@ -0,0 +1,122 @@ +[CmdletBinding()] +param +( + [String] [Parameter(Mandatory = $true)] + $endpoint, + [String] [Parameter(Mandatory = $false)] + $targetAzurePs, + [String] [Parameter(Mandatory = $false)] + $clientAssertionJwt +) + +$endpointObject = ConvertFrom-Json $endpoint +$moduleName = "Az.Accounts" +$environmentName = $endpointObject.environment + +. "$PSScriptRoot/Utility.ps1" +Update-PSModulePathForHostedAgentLinux -targetAzurePs $targetAzurePs + +if ($targetAzurePs -eq "") { + $module = Get-Module -Name $moduleName -ListAvailable | Sort-Object Version -Descending | Select-Object -First 1 +} +else{ + $modules = Get-Module -Name $moduleName -ListAvailable + foreach ($moduleVal in $modules) { + # $moduleVal.Path will have value like /usr/local/share/powershell/Modules/Az.Accounts/1.2.1/Az.Accounts.psd1 + $azModulePath = Split-Path (Split-Path (Split-Path $moduleVal.Path -Parent) -Parent) -Parent + $azModulePath = $azModulePath + "/Az/*" + $azModuleVersion = split-path -path $azModulePath -Leaf -Resolve + if ($azModuleVersion -eq $targetAzurePs) { + $module = $moduleVal + break + } + } +} + +if (!$module) { + # Will handle localization later + Write-Verbose "No module found with name: $moduleName" + throw ("Could not find the module Az.Accounts with given version. If the module was recently installed, retry after restarting the Azure Pipelines task agent.") +} + +# Import the module. +Write-Host "##[command]Import-Module -Name $($module.Path) -Global" +$module = Import-Module -Name $module.Path -Global -PassThru -Force + +# Clear context +Write-Host "##[command]Clear-AzContext -Scope Process" +$null = Clear-AzContext -Scope Process +Write-Host "##[command]Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue" +$null = Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue + +$scopeLevel = "Subscription" +if ($endpointObject.scopeLevel) { + $scopeLevel = $endpointObject.scopeLevel +} +$processScope = @{ Scope = "Process" } + +function Format-Splat { + [CmdletBinding()] + param([Parameter(Mandatory = $true)][hashtable]$Hashtable) + + # Collect the parameters (names and values) in an array. + $parameters = foreach ($key in $Hashtable.Keys) { + $value = $Hashtable[$key] + # If the value is a bool, format the parameter as a switch (ending with ':'). + if ($value -is [bool]) { "-$($key):" } else { "-$key" } + $value + } + + "$parameters" # String join the array. +} + +if ($endpointObject.scheme -eq 'ServicePrincipal') { + Write-Verbose "Using ServicePrincipal authentication scheme" + try { + if ($endpointObject.authenticationType -ieq 'SPNKey') { + $psCredential = New-Object System.Management.Automation.PSCredential( + $endpointObject.servicePrincipalClientID, + (ConvertTo-SecureString $endpointObject.servicePrincipalKey -AsPlainText -Force)) + Write-Host "##[command]Connect-AzAccount -ServicePrincipal -Tenant $($endpointObject.tenantId) -Credential $psCredential -Environment $environmentName @processScope" + $null = Connect-AzAccount -ServicePrincipal -Tenant $endpointObject.tenantId ` + -Credential $psCredential ` + -Environment $environmentName @processScope -WarningAction SilentlyContinue + } + else { + # Provide an additional, custom, credentials-related error message. Will handle localization later + throw ("Only SPNKey auth type is supported for ServicePrincipal auth scheme using non windows agent.") + } + } + catch { + # Provide an additional, custom, credentials-related error message. Will handle localization later + Write-Host "Exception is : $($_.Exception.Message)" + throw (New-Object System.Exception("There was an error with the service principal used for the deployment.", $_.Exception)) + } + + if ($scopeLevel -eq "Subscription") { + $SubscriptionId = $endpointObject.subscriptionId + $TenantId = $endpointObject.tenantId + $additional = @{ TenantId = $TenantId } + + Write-Host "##[command] Set-AzContext -SubscriptionId $SubscriptionId $(Format-Splat $additional)" + $null = Set-AzContext -SubscriptionId $SubscriptionId @additional + } +} +elseif ($endpointObject.scheme -eq 'WorkloadIdentityFederation') { + Write-Verbose "Using WorkloadIdentityFederation authentication scheme" + + $logStr = "##[command] Connect-AzAccount -ServicePrincipal -Tenant $($endpointObject.tenantId) -ApplicationId $($endpointObject.servicePrincipalClientID)" + $logStr += " -FederatedToken ***** -Environment $environmentName -Scope Process" + Write-Host $logStr + Connect-AzAccount -ServicePrincipal -Tenant $endpointObject.tenantId -ApplicationId $endpointObject.servicePrincipalClientID ` + -FederatedToken $clientAssertionJwt -Environment $environmentName -Scope 'Process' + + if ($scopeLevel -ne "ManagementGroup") { + Write-Host "##[command] Set-AzContext -SubscriptionId $($endpointObject.subscriptionID) -TenantId $($endpointObject.tenantId)" + Set-AzContext -SubscriptionId $endpointObject.subscriptionID -TenantId $endpointObject.tenantId + } +} +else { + # Provide an additional, custom, credentials-related error message. Will handle localization later + throw ("Only SPN credential and WorkloadIdentityFederation auth schemes are supported for non windows agent.") +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Strings/resources.resjson/de-DE/resources.resjson b/_generated/AzurePowerShellV5/Strings/resources.resjson/de-DE/resources.resjson new file mode 100644 index 000000000000..4d9a18a84ffa --- /dev/null +++ b/_generated/AzurePowerShellV5/Strings/resources.resjson/de-DE/resources.resjson @@ -0,0 +1,42 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[Weitere Informationen zu dieser Aufgabe](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "PowerShell-Skript innerhalb einer Azure-Umgebung ausführen", + "loc.instanceNameFormat": "Azure PowerShell-Skript: $(ScriptType)", + "loc.releaseNotes": "Unterstützung für Az-Modul und plattformübergreifende Agents hinzugefügt.", + "loc.group.displayName.AzurePowerShellVersionOptions": "Azure PowerShell-Versionsoptionen", + "loc.group.displayName.advanced": "Erweitert", + "loc.input.label.ConnectedServiceNameARM": "Azure-Abonnement", + "loc.input.help.ConnectedServiceNameARM": "Azure Resource Manager-Abonnement, das vor dem Ausführen von PowerShell konfiguriert wird.", + "loc.input.label.ScriptType": "Skripttyp", + "loc.input.help.ScriptType": "Der Typ des Skripts: Dateipfad oder Inlineskript.", + "loc.input.label.ScriptPath": "Skriptpfad", + "loc.input.help.ScriptPath": "Der Pfad des Skripts. Es muss sich um den vollqualifizierten Pfad oder einen Pfad relativ zum Standardarbeitsverzeichnis handeln.", + "loc.input.label.Inline": "Inlineskript", + "loc.input.help.Inline": "Geben Sie das Skript ein, das ausgeführt werden soll.", + "loc.input.label.ScriptArguments": "Skriptargumente", + "loc.input.help.ScriptArguments": "Zusätzliche Argumente, die an PowerShell übergeben werden sollen. Entweder Ordnungszahl- oder benannte Parameter.", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "Wählen Sie den Wert der Variablen \"ErrorActionPreference\" für die Skriptausführung.", + "loc.input.label.FailOnStandardError": "Fehler bei Standardfehler.", + "loc.input.help.FailOnStandardError": "Wenn dieser Wert TRUE ist, tritt ein Aufgabenfehler auf, wenn Fehler in die Fehlerpipeline oder Daten in den Standard-Fehlerdatenstrom geschrieben werden.", + "loc.input.label.TargetAzurePs": "Azure PowerShell-Version", + "loc.input.help.TargetAzurePs": "Im Falle gehosteter Agents werden die folgenden Azure PowerShell-Versionen unterstützt: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0 (gehostete VS2017-Warteschlange).\nWenn Sie die neueste für den Agent verfügbare Version auswählen möchten, wählen Sie \"Neueste installierte Version\" aus.\n\nFür private Agents können Sie mithilfe von \"Version angeben\" die bevorzugte Version von Azure PowerShell festlegen.", + "loc.input.label.CustomTargetAzurePs": "Bevorzugte Azure PowerShell-Version", + "loc.input.help.CustomTargetAzurePs": "Die bevorzugte Azure PowerShell-Version muss einem ordnungsgemäßen semantischen Versionsmuster folgen, z. B. \"1.2.3\". Reguläre Ausdrücke wie 2.\\*,2.3.\\* werden nicht unterstützt. Der gehostete VS2017-Pool unterstützt aktuell die folgenden Az-Modulversionen: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0", + "loc.input.label.pwsh": "PowerShell Core verwenden", + "loc.input.help.pwsh": "Sofern TRUE, verwendet die Aufgabe unter Windows anstelle von \"powershell.exe\" die in PATH festgelegte \"pwsh.exe\".", + "loc.input.label.validateScriptSignature": "Skriptsignatur überprüfen", + "loc.input.help.validateScriptSignature": "Wenn dies der Fall ist, überprüft die Aufgabe zunächst, ob das angegebene Skript signiert und gültig ist, bevor es ausgeführt wird.", + "loc.input.label.workingDirectory": "Arbeitsverzeichnis", + "loc.input.help.workingDirectory": "Arbeitsverzeichnis zum Ausführen des Skripts.", + "loc.messages.GeneratingScript": "Skript wird erstellt.", + "loc.messages.JS_FormattedCommand": "Formatierter Befehl: %s", + "loc.messages.InvalidScriptArguments0": "Ungültige Skriptargumente \"{0}\". Zeilenumbrüche sind unzulässig.", + "loc.messages.InvalidScriptPath0": "Ungültiger Skriptpfad \"{0}\". Es wurden ungültige Pfadzeichen angegeben.", + "loc.messages.InvalidAzurePsVersion": "Die angegebene Azure PowerShell-Version \"{0}\" weist nicht das richtige Format auf. Überprüfen Sie das Format. Ein Beispiel für das richtige Format ist etwa 1.0.1.", + "loc.messages.JS_ExitCode": "PowerShell wurde beendet mit dem Code \"%s\".", + "loc.messages.JS_Stderr": "PowerShell hat mindestens eine Zeile in den Standardfehlerstream geschrieben.", + "loc.messages.ExpiredServicePrincipal": "Das Zugriffstoken für Azure konnte nicht abgerufen werden. Stellen Sie sicher, dass der verwendete Dienstprinzipal gültig und nicht abgelaufen ist.", + "loc.messages.PS_ExitCode": "PowerShell wurde beendet mit dem Code \"{0}\"." +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Strings/resources.resjson/en-US/resources.resjson b/_generated/AzurePowerShellV5/Strings/resources.resjson/en-US/resources.resjson new file mode 100644 index 000000000000..e64b310b685a --- /dev/null +++ b/_generated/AzurePowerShellV5/Strings/resources.resjson/en-US/resources.resjson @@ -0,0 +1,42 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "Run a PowerShell script within an Azure environment", + "loc.instanceNameFormat": "Azure PowerShell script: $(ScriptType)", + "loc.releaseNotes": "Added support for Az Module and cross platform agents.", + "loc.group.displayName.AzurePowerShellVersionOptions": "Azure PowerShell version options", + "loc.group.displayName.advanced": "Advanced", + "loc.input.label.ConnectedServiceNameARM": "Azure Subscription", + "loc.input.help.ConnectedServiceNameARM": "Azure Resource Manager subscription to configure before running PowerShell", + "loc.input.label.ScriptType": "Script Type", + "loc.input.help.ScriptType": "Type of the script: File Path or Inline Script", + "loc.input.label.ScriptPath": "Script Path", + "loc.input.help.ScriptPath": "Path of the script. Should be fully qualified path or relative to the default working directory.", + "loc.input.label.Inline": "Inline Script", + "loc.input.help.Inline": "Enter the script to execute.", + "loc.input.label.ScriptArguments": "Script Arguments", + "loc.input.help.ScriptArguments": "Additional parameters to pass to PowerShell. Can be either ordinal or named parameters.", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "Select the value of the ErrorActionPreference variable for executing the script.", + "loc.input.label.FailOnStandardError": "Fail on Standard Error", + "loc.input.help.FailOnStandardError": "If this is true, this task will fail if any errors are written to the error pipeline, or if any data is written to the Standard Error stream.", + "loc.input.label.TargetAzurePs": "Azure PowerShell Version", + "loc.input.help.TargetAzurePs": "In case of hosted agents, the supported Azure PowerShell Version is: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0 (Hosted VS2017 Queue).\nTo pick the latest version available on the agent, select \"Latest installed version\".\n\nFor private agents you can specify preferred version of Azure PowerShell using \"Specify version\"", + "loc.input.label.CustomTargetAzurePs": "Preferred Azure PowerShell Version", + "loc.input.help.CustomTargetAzurePs": "Preferred Azure PowerShell Version needs to be a proper semantic version eg. 1.2.3. Regex like 2.\\*,2.3.\\* is not supported. The Hosted VS2017 Pool currently supports Az module version: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0", + "loc.input.label.pwsh": "Use PowerShell Core", + "loc.input.help.pwsh": "If this is true, then on Windows the task will use pwsh.exe from your PATH instead of powershell.exe.", + "loc.input.label.validateScriptSignature": "Validate script signature", + "loc.input.help.validateScriptSignature": "If this is true, then the task will first check to make sure specified script is signed and valid before executing it.", + "loc.input.label.workingDirectory": "Working Directory", + "loc.input.help.workingDirectory": "Working directory where the script is run.", + "loc.messages.GeneratingScript": "Generating script.", + "loc.messages.JS_FormattedCommand": "Formatted command: %s", + "loc.messages.InvalidScriptArguments0": "Invalid script arguments '{0}'. Line breaks are not allowed.", + "loc.messages.InvalidScriptPath0": "Invalid script path '{0}'. Invalid path characters specified.", + "loc.messages.InvalidAzurePsVersion": "The Azure PowerShell version '{0}' specified is not in the correct format. Please check the format. An example of correct format is 1.0.1", + "loc.messages.JS_ExitCode": "PowerShell exited with code '%s'.", + "loc.messages.JS_Stderr": "PowerShell wrote one or more lines to the standard error stream.", + "loc.messages.ExpiredServicePrincipal": "Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired.", + "loc.messages.PS_ExitCode": "PowerShell exited with code '{0}'." +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Strings/resources.resjson/es-ES/resources.resjson b/_generated/AzurePowerShellV5/Strings/resources.resjson/es-ES/resources.resjson new file mode 100644 index 000000000000..1953d36b3225 --- /dev/null +++ b/_generated/AzurePowerShellV5/Strings/resources.resjson/es-ES/resources.resjson @@ -0,0 +1,42 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[Obtener más información acerca de esta tarea](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "Ejecutar un script de PowerShell en un entorno de Azure", + "loc.instanceNameFormat": "Script de Azure PowerShell: $(ScriptType)", + "loc.releaseNotes": "Se ha agregado compatibilidad con el módulo Az y los agentes multiplataforma.", + "loc.group.displayName.AzurePowerShellVersionOptions": "Opciones de versión de Azure PowerShell", + "loc.group.displayName.advanced": "Avanzado", + "loc.input.label.ConnectedServiceNameARM": "Suscripción a Azure", + "loc.input.help.ConnectedServiceNameARM": "Suscripción de Azure Resource Manager para configurar antes de ejecutar PowerShell", + "loc.input.label.ScriptType": "Tipo de script", + "loc.input.help.ScriptType": "Tipo del script: ruta de acceso del archivo o script en línea", + "loc.input.label.ScriptPath": "Ruta de acceso del script", + "loc.input.help.ScriptPath": "Ruta de acceso del script. Debe ser una ruta de acceso completa o relativa al directorio de trabajo predeterminado.", + "loc.input.label.Inline": "Script alineado", + "loc.input.help.Inline": "Escriba el script que se va a ejecutar.", + "loc.input.label.ScriptArguments": "Argumentos de script", + "loc.input.help.ScriptArguments": "Parámetros adicionales que pasar a PowerShell. Pueden ser parámetros ordinales o con nombre.", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "Seleccione el valor de la variable ErrorActionPreference para ejecutar el script.", + "loc.input.label.FailOnStandardError": "Error si se produce un error estándar", + "loc.input.help.FailOnStandardError": "Si es true, se producirá un error en la tarea si se escriben errores en la canalización de errores o si se escriben datos en el flujo de error estándar.", + "loc.input.label.TargetAzurePs": "Versión de Azure PowerShell", + "loc.input.help.TargetAzurePs": "En el caso de los agentes hospedados, las versiones de Azure PowerShell admitidas son 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0 (Hosted VS2017 Queue).\nPara seleccionar la última versión disponible en el agente, seleccione \"Latest installed version\".\n\nPara los agentes privados, puede especificar la versión de Azure PowerShell que prefiera con la opción \"Specify version\"", + "loc.input.label.CustomTargetAzurePs": "Versión de Azure PowerShell preferida", + "loc.input.help.CustomTargetAzurePs": "La versión preferida de Azure PowerShell debe ser una versión de semántica adecuada, por ejemplo, 1.2.3. No se admite una notación regex como 2.\\*,2.3.\\*. El grupo Hosted VS2017 Pool es compatible con las versiones del módulo Az 1.0.0, 1.6.0, 2.3.2, 2.6.0 y 3.1.0", + "loc.input.label.pwsh": "Usar PowerShell Core", + "loc.input.help.pwsh": "Si es true, la tarea usará pwsh.exe desde PATH en lugar de powershell.exe en Windows.", + "loc.input.label.validateScriptSignature": "Validación de la firma del script", + "loc.input.help.validateScriptSignature": "Si es true, la tarea comprobará primero para asegurarse de que el script especificado está firmado y es válido antes de ejecutarlo.", + "loc.input.label.workingDirectory": "Directorio de trabajo", + "loc.input.help.workingDirectory": "Directorio de trabajo donde se ejecuta el script.", + "loc.messages.GeneratingScript": "Generando script.", + "loc.messages.JS_FormattedCommand": "Comando con formato: %s", + "loc.messages.InvalidScriptArguments0": "Argumentos de script '{0}' no válidos. No se permiten los saltos de línea.", + "loc.messages.InvalidScriptPath0": "Ruta del script '{0}' no válida. Los caracteres de ruta de acceso especificados no son válidos.", + "loc.messages.InvalidAzurePsVersion": "La versión de Azure PowerShell \"{0}\" especificada no tiene el formato correcto. Compruebe el formato. Ejemplo de formato correcto: 1.0.1", + "loc.messages.JS_ExitCode": "PowerShell se cerró con el código \"%s\".", + "loc.messages.JS_Stderr": "PowerShell escribió una o varias líneas en la secuencia de error estándar.", + "loc.messages.ExpiredServicePrincipal": "No se pudo capturar el token de acceso de Azure. Compruebe que la entidad de servicio usada es válida y no ha expirado.", + "loc.messages.PS_ExitCode": "PowerShell se cerró con el código \"{0}\"." +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Strings/resources.resjson/fr-FR/resources.resjson b/_generated/AzurePowerShellV5/Strings/resources.resjson/fr-FR/resources.resjson new file mode 100644 index 000000000000..415241dc76b2 --- /dev/null +++ b/_generated/AzurePowerShellV5/Strings/resources.resjson/fr-FR/resources.resjson @@ -0,0 +1,42 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[En savoir plus sur cette tâche](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "Exécuter un script PowerShell dans un environnement Azure", + "loc.instanceNameFormat": "Script Azure PowerShell : $(ScriptType)", + "loc.releaseNotes": "Ajout de la prise en charge du module Azure et des agents multiplateformes.", + "loc.group.displayName.AzurePowerShellVersionOptions": "Options de version Azure PowerShell", + "loc.group.displayName.advanced": "Avancé", + "loc.input.label.ConnectedServiceNameARM": "Abonnement Azure", + "loc.input.help.ConnectedServiceNameARM": "Abonnement Azure Resource Manager à configurer avant d'exécuter PowerShell", + "loc.input.label.ScriptType": "Type de script", + "loc.input.help.ScriptType": "Type du script : chemin de fichier ou script inline", + "loc.input.label.ScriptPath": "Chemin d'accès du script", + "loc.input.help.ScriptPath": "Chemin d'accès du script. Doit être un chemin d'accès complet ou relatif au répertoire de travail par défaut.", + "loc.input.label.Inline": "Script inline", + "loc.input.help.Inline": "Entrez le script à exécuter.", + "loc.input.label.ScriptArguments": "Arguments de script", + "loc.input.help.ScriptArguments": "Paramètres supplémentaires à passer à PowerShell. Peuvent être des paramètres ordinaux ou nommés.", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "Sélectionnez la valeur de la variable ErrorActionPreference pour l'exécution du script.", + "loc.input.label.FailOnStandardError": "Échec sur une erreur standard", + "loc.input.help.FailOnStandardError": "Si la valeur est true, et si des erreurs sont écrites dans le pipeline d'erreurs ou si des données sont écrites dans le flux d'erreurs standard, cette tâche se solde par un échec.", + "loc.input.label.TargetAzurePs": "Version d'Azure PowerShell", + "loc.input.help.TargetAzurePs": "Dans le cas d'agents hébergés, les versions d'Azure PowerShell prises en charge sont les suivantes : 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0 (file d'attente VS2017 hébergée).\nPour choisir la dernière version disponible sur l'agent, sélectionnez \"Dernière version installée\".\n\nPour les agents privés, vous pouvez spécifier la version par défaut d'Azure PowerShell via \"Spécifier la version\"", + "loc.input.label.CustomTargetAzurePs": "Version préférée d'Azure PowerShell", + "loc.input.help.CustomTargetAzurePs": "La version par défaut d'Azure PowerShell doit être une version sémantique appropriée, par exemple 1.2.3. La notation regex telle que 2.\\*,2.3.\\* n'est pas prise en charge. Le pool VS2017 hébergé prend en charge les versions de module Az suivantes : 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0", + "loc.input.label.pwsh": "Utilisez PowerShell Core", + "loc.input.help.pwsh": "Si la valeur est true, dans Windows, la tâche utilise pwsh.exe à partir de votre variable PATH au lieu de powershell.exe.", + "loc.input.label.validateScriptSignature": "Valider la signature du script", + "loc.input.help.validateScriptSignature": "Si la valeur est true, la tâche vérifie d’abord que le script spécifié est signé et valide avant de l’exécuter.", + "loc.input.label.workingDirectory": "Répertoire de travail", + "loc.input.help.workingDirectory": "Répertoire de travail où le script est exécuté.", + "loc.messages.GeneratingScript": "Génération du script.", + "loc.messages.JS_FormattedCommand": "Commande mise en forme : %s", + "loc.messages.InvalidScriptArguments0": "Arguments de script '{0}' non valides. Les sauts de ligne ne sont pas autorisés.", + "loc.messages.InvalidScriptPath0": "Chemin de script '{0}' non valide. Caractères non valides spécifiés dans le chemin.", + "loc.messages.InvalidAzurePsVersion": "La version '{0}' spécifiée pour Azure PowerShell n'est pas au format approprié. Vérifiez le format. Exemple de format correct : 1.0.1", + "loc.messages.JS_ExitCode": "Arrêt de PowerShell. Code de sortie : '%s'.", + "loc.messages.JS_Stderr": "PowerShell a écrit une ou plusieurs lignes dans le flux d'erreurs standard.", + "loc.messages.ExpiredServicePrincipal": "Impossible de récupérer (fetch) le jeton d'accès pour Azure. Vérifiez si le principal de service utilisé est valide et s'il n'a pas expiré.", + "loc.messages.PS_ExitCode": "Arrêt de PowerShell. Code de sortie : '{0}'." +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Strings/resources.resjson/it-IT/resources.resjson b/_generated/AzurePowerShellV5/Strings/resources.resjson/it-IT/resources.resjson new file mode 100644 index 000000000000..1e89ea59c698 --- /dev/null +++ b/_generated/AzurePowerShellV5/Strings/resources.resjson/it-IT/resources.resjson @@ -0,0 +1,42 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[Altre informazioni su questa attività](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "Consente di eseguire uno script PowerShell in un ambiente Azure", + "loc.instanceNameFormat": "Script Azure PowerShell: $(ScriptType)", + "loc.releaseNotes": "È stato aggiunto il supporto per il modulo AZ e gli agenti multipiattaforma.", + "loc.group.displayName.AzurePowerShellVersionOptions": "Opzioni della versione di Azure PowerShell", + "loc.group.displayName.advanced": "Avanzate", + "loc.input.label.ConnectedServiceNameARM": "Sottoscrizione di Azure", + "loc.input.help.ConnectedServiceNameARM": "Sottoscrizione di Azure Resource Manager da configurare prima di eseguire PowerShell", + "loc.input.label.ScriptType": "Tipo di script", + "loc.input.help.ScriptType": "Tipo dello script: Percorso file o Script inline", + "loc.input.label.ScriptPath": "Percorso script", + "loc.input.help.ScriptPath": "Percorso dello script. Deve essere un percorso completo o relativo rispetto alla directory di lavoro predefinita.", + "loc.input.label.Inline": "Script inline", + "loc.input.help.Inline": "Consente di immettere lo script da eseguire.", + "loc.input.label.ScriptArguments": "Argomenti script", + "loc.input.help.ScriptArguments": "Parametri aggiuntivi da passare a PowerShell. Possono essere ordinali o denominati.", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "Consente di selezionare il valore della variabile ErrorActionPreference per l'esecuzione dello script.", + "loc.input.label.FailOnStandardError": "Interrompi in caso di errore standard", + "loc.input.help.FailOnStandardError": "Se il valore è true, questa attività non riuscirà nel caso in cui vengano scritti errori nella pipeline degli errori oppure se vengono scritti dati nel flusso STDERR.", + "loc.input.label.TargetAzurePs": "Versione di Azure PowerShell", + "loc.input.help.TargetAzurePs": "In caso di agenti ospitati la versione supportata di Azure PowerShell è: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0 (Hosted VS2017 Queue).\nPer selezionare l'ultima versione disponibile per l'agente ospitato, selezionare \"Ultima versione installata\".\n\nPer gli agenti privati è possibile selezionare \"Specifica versione\" per specificare la versione preferita di Azure PowerShell", + "loc.input.label.CustomTargetAzurePs": "Versione preferita di Azure PowerShell", + "loc.input.help.CustomTargetAzurePs": "La versione preferita di Azure PowerShell deve essere una versione semantica valida, ad esempio 1.2.3. Espressioni regolari come 2.\\*,2.3.\\* non sono supportate. La versione Hosted VS2017 Pool supporta attualmente le versioni seguenti del modulo Az: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0", + "loc.input.label.pwsh": "Usa PowerShell Core", + "loc.input.help.pwsh": "Se è impostata su true, in Windows l'attività userà pwsh.exe da PATH invece di powershell.exe.", + "loc.input.label.validateScriptSignature": "Convalida firma script", + "loc.input.help.validateScriptSignature": "Se è True, l'attività verificherà innanzitutto che lo script specificato sia firmato e valido prima di eseguirlo.", + "loc.input.label.workingDirectory": "Directory di lavoro", + "loc.input.help.workingDirectory": "Directory di lavoro in cui viene eseguito lo script.", + "loc.messages.GeneratingScript": "Generazione dello script.", + "loc.messages.JS_FormattedCommand": "Comando formattato: %s", + "loc.messages.InvalidScriptArguments0": "Gli argomenti '{0}' dello script non sono validi. Le interruzioni di riga non sono consentite.", + "loc.messages.InvalidScriptPath0": "Il percorso '{0}' dello script non è valido. Sono stati specificati caratteri non validi.", + "loc.messages.InvalidAzurePsVersion": "Il formato della versione di Azure PowerShell '{0}' specificata non è corretto. Controllare il formato. Un esempio di formato corretto è 1.0.1", + "loc.messages.JS_ExitCode": "PowerShell terminato con codice '%s'.", + "loc.messages.JS_Stderr": "PowerShell ha scritto una o più righe nel flusso di errore standard.", + "loc.messages.ExpiredServicePrincipal": "Non è stato possibile recuperare il token di accesso per Azure. Verificare che l'entità servizio usata sia valida e non sia scaduta.", + "loc.messages.PS_ExitCode": "PowerShell terminato con codice '{0}'." +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Strings/resources.resjson/ja-JP/resources.resjson b/_generated/AzurePowerShellV5/Strings/resources.resjson/ja-JP/resources.resjson new file mode 100644 index 000000000000..f2b1b4f51de3 --- /dev/null +++ b/_generated/AzurePowerShellV5/Strings/resources.resjson/ja-JP/resources.resjson @@ -0,0 +1,42 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[このタスクの詳細を表示](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "Azure 環境内で PowerShell スクリプトを実行します", + "loc.instanceNameFormat": "Azure PowerShell スクリプト: $(ScriptType)", + "loc.releaseNotes": "Az モジュールとクロス プラットフォームのエージェントのサポートが追加されました。", + "loc.group.displayName.AzurePowerShellVersionOptions": "Azure PowerShell バージョンのオプション", + "loc.group.displayName.advanced": "詳細設定", + "loc.input.label.ConnectedServiceNameARM": "Azure サブスクリプション", + "loc.input.help.ConnectedServiceNameARM": "PowerShell を実行する前に構成する Azure Resource Manager サブスクリプション", + "loc.input.label.ScriptType": "スクリプトの種類", + "loc.input.help.ScriptType": "スクリプトの種類: ファイル パスまたはインライン スクリプト", + "loc.input.label.ScriptPath": "スクリプト パス", + "loc.input.help.ScriptPath": "スクリプトのパス。完全修飾パスか、既定の作業ディレクトリを基準とした相対パスのいずれかです。", + "loc.input.label.Inline": "インライン スクリプト", + "loc.input.help.Inline": "実行するスクリプトを入力します。", + "loc.input.label.ScriptArguments": "スクリプトの引数", + "loc.input.help.ScriptArguments": "PowerShell に渡す追加のパラメーター。順序によるパラメーターまたは名前指定されたパラメーターのいずれかです。", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "スクリプトを実行するための ErrorActionPreference 変数の値を選択します。", + "loc.input.label.FailOnStandardError": "標準エラーで失敗", + "loc.input.help.FailOnStandardError": "これが true の場合、何らかのエラーがエラー パイプラインに書き込まれるか、何らかのデータが標準エラー ストリームに書き込まれる場合、このタスクは失敗します。", + "loc.input.label.TargetAzurePs": "Azure PowerShell バージョン", + "loc.input.help.TargetAzurePs": "ホステッド エージェントの場合、サポートされている Azure PowerShell のバージョンは、1.0.0、1.6.0、2.3.2、2.6.0、3.1.0 (ホステッド VS2017 キュー) です。\nエージェントで利用可能な最新バージョンを選ぶには、[Latest installed version](インストールされている最新バージョン) を選択します。\n\nプライベート エージェントの場合は、[Specify version](バージョンを指定する) を使用して優先されるバージョンの Azure PowerShell を指定できます。", + "loc.input.label.CustomTargetAzurePs": "優先される Azure PowerShell バージョン", + "loc.input.help.CustomTargetAzurePs": "優先される Azure PowerShell バージョンは、1.2.3 などの適切なセマンティック バージョンである必要があります。2.\\*、2.3.\\* などの正規表現はサポートされていません。ホステッド VS2017 プールは、現在次の Az モジュール バージョンをサポートしています: 1.0.0、1.6.0、2.3.2、2.6.0、3.1.0", + "loc.input.label.pwsh": "PowerShell Core を使用する", + "loc.input.help.pwsh": "これが true の場合、Windows 上のタスクは powershell.exe ではなく PATH からの pwsh.exe を使用します。", + "loc.input.label.validateScriptSignature": "スクリプトの署名を検証する", + "loc.input.help.validateScriptSignature": "これが true の場合、タスクはまず、指定されたスクリプトが署名され、有効であることを確認してからこれを実行します。", + "loc.input.label.workingDirectory": "作業ディレクトリ", + "loc.input.help.workingDirectory": "スクリプトが実行される作業ディレクトリ。", + "loc.messages.GeneratingScript": "スクリプトを生成しています。", + "loc.messages.JS_FormattedCommand": "フォーマット後のコマンド: %s", + "loc.messages.InvalidScriptArguments0": "スクリプトの引数 '{0}' が無効です。改行は使用できません。", + "loc.messages.InvalidScriptPath0": "スクリプト パス '{0}' が無効です。無効なパス文字が指定されました。", + "loc.messages.InvalidAzurePsVersion": "指定した Azure PowerShell バージョン '{0}' は、形式が正しくありません。形式をご確認ください。正しい形式の例は、1.0.1 です", + "loc.messages.JS_ExitCode": "PowerShell がコード '%s' で終了しました。", + "loc.messages.JS_Stderr": "PowerShell が標準エラー ストリームに 1 行以上を書き込みました。", + "loc.messages.ExpiredServicePrincipal": "Azure のアクセス トークンをフェッチできませんでした。使用されているサービス プリンシパルが有効であり、有効期限が切れていないことを確認してください。", + "loc.messages.PS_ExitCode": "PowerShell がコード '{0}' で終了しました。" +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Strings/resources.resjson/ko-KR/resources.resjson b/_generated/AzurePowerShellV5/Strings/resources.resjson/ko-KR/resources.resjson new file mode 100644 index 000000000000..4459a234b77f --- /dev/null +++ b/_generated/AzurePowerShellV5/Strings/resources.resjson/ko-KR/resources.resjson @@ -0,0 +1,42 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[이 작업에 대한 자세한 정보](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "Azure 환경에서 PowerShell 스크립트 실행", + "loc.instanceNameFormat": "Azure PowerShell 스크립트: $(ScriptType)", + "loc.releaseNotes": "Az 모듈 및 플랫폼 간 에이전트에 대한 지원이 추가되었습니다.", + "loc.group.displayName.AzurePowerShellVersionOptions": "Azure PowerShell 버전 옵션", + "loc.group.displayName.advanced": "고급", + "loc.input.label.ConnectedServiceNameARM": "Azure 구독", + "loc.input.help.ConnectedServiceNameARM": "PowerShell을 실행하기 전에 구성할 Azure Resource Manager 구독", + "loc.input.label.ScriptType": "스크립트 유형", + "loc.input.help.ScriptType": "스크립트 유형: 파일 경로 또는 인라인 스크립트", + "loc.input.label.ScriptPath": "스크립트 경로", + "loc.input.help.ScriptPath": "스크립트의 경로입니다. 정규화된 경로이거나 기본 작업 디렉터리에 대한 상대 경로여야 합니다.", + "loc.input.label.Inline": "인라인 스크립트", + "loc.input.help.Inline": "실행할 스크립트를 입력합니다.", + "loc.input.label.ScriptArguments": "스크립트 인수", + "loc.input.help.ScriptArguments": "PowerShell에 전달할 추가 인수입니다. 서수 매개 변수나 명명된 매개 변수 중 하나일 수 있습니다.", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "스크립트 실행에 대한 ErrorActionPreference 변수의 값을 선택합니다.", + "loc.input.label.FailOnStandardError": "표준 오류 시 실패", + "loc.input.help.FailOnStandardError": "이 값이 true이면 오류 파이프라인에 오류가 작성되거나 표준 오류 스트림에 데이터가 작성될 경우 이 작업은 실패하게 됩니다.", + "loc.input.label.TargetAzurePs": "Azure PowerShell 버전", + "loc.input.help.TargetAzurePs": "호스트된 에이전트의 경우 지원되는 Azure PowerShell 버전은 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0(Hosted VS2017 Queue)입니다.\n에이전트에서 사용 가능한 최신 버전을 선택하려면 \"설치된 최신 버전\"을 선택합니다.\n\n사용자 에이전트의 경우 \"버전 지정\"을 사용하여 기본 Azure PowerShell 버전을 지정할 수 있습니다.", + "loc.input.label.CustomTargetAzurePs": "기본 Azure PowerShell 버전", + "loc.input.help.CustomTargetAzurePs": "기본 Azure PowerShell 버전은 올바른 의미 체계 버전(예: 1.2.3)이어야 합니다. 2.\\*,2.3.\\*와 같은 Regex는 지원되지 않습니다. Hosted VS2017 풀은 현재 Az 모듈 버전 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0을 지원합니다.", + "loc.input.label.pwsh": "PowerShell Core 사용", + "loc.input.help.pwsh": "true이면, Windows에서 작업이 powershell.exe 대신 PATH의 pwsh.exe를 사용합니다.", + "loc.input.label.validateScriptSignature": "스크립트 서명 유효성 검사", + "loc.input.help.validateScriptSignature": "true이면 작업을 실행하기 전에 먼저 지정한 스크립트가 서명되어 있고 유효한지 확인합니다.", + "loc.input.label.workingDirectory": "작업 디렉터리", + "loc.input.help.workingDirectory": "스크립트가 실행되는 작업 디렉터리입니다.", + "loc.messages.GeneratingScript": "스크립트를 생성 중입니다.", + "loc.messages.JS_FormattedCommand": "형식이 지정된 명령: %s", + "loc.messages.InvalidScriptArguments0": "스크립트 인수 '{0}'이(가) 잘못되었습니다. 줄 바꿈은 허용되지 않습니다.", + "loc.messages.InvalidScriptPath0": "스크립트 경로 '{0}'이(가) 잘못되었습니다. 잘못된 경로 문자를 지정했습니다.", + "loc.messages.InvalidAzurePsVersion": "지정한 Azure PowerShell 버전 '{0}'의 형식이 잘못되었습니다. 형식을 확인하세요. 올바른 형식의 예는 1.0.1입니다.", + "loc.messages.JS_ExitCode": "PowerShell이 코드 '%s'(으)로 종료되었습니다.", + "loc.messages.JS_Stderr": "PowerShell이 표준 오류 스트림에 하나 이상의 줄을 썼습니다.", + "loc.messages.ExpiredServicePrincipal": "Azure의 액세스 토큰을 페치할 수 없습니다. 사용한 서비스 주체가 유효하고 만료되지 않았는지 확인하세요.", + "loc.messages.PS_ExitCode": "PowerShell이 코드 '{0}'(으)로 종료되었습니다." +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Strings/resources.resjson/ru-RU/resources.resjson b/_generated/AzurePowerShellV5/Strings/resources.resjson/ru-RU/resources.resjson new file mode 100644 index 000000000000..0e75c654e99e --- /dev/null +++ b/_generated/AzurePowerShellV5/Strings/resources.resjson/ru-RU/resources.resjson @@ -0,0 +1,42 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[См. дополнительные сведения об этой задаче](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "Выполнение скрипта PowerShell в среде Azure", + "loc.instanceNameFormat": "Сценарий Azure PowerShell: $(ScriptType)", + "loc.releaseNotes": "Добавлена поддержка модуля Az и кроссплатформенных агентов.", + "loc.group.displayName.AzurePowerShellVersionOptions": "Параметры версии Azure PowerShell", + "loc.group.displayName.advanced": "Дополнительно", + "loc.input.label.ConnectedServiceNameARM": "Подписка Azure", + "loc.input.help.ConnectedServiceNameARM": "Подписка на Azure Resource Manager для настройки перед запуском PowerShell", + "loc.input.label.ScriptType": "Тип сценария", + "loc.input.help.ScriptType": "Тип сценария: путь к файлу или встроенный сценарий", + "loc.input.label.ScriptPath": "Путь к скрипту", + "loc.input.help.ScriptPath": "Путь к сценарию. Это должен быть полный путь или путь относительно рабочего каталога по умолчанию.", + "loc.input.label.Inline": "Встроенный сценарий", + "loc.input.help.Inline": "Введите сценарий для выполнения.", + "loc.input.label.ScriptArguments": "Аргументы скрипта", + "loc.input.help.ScriptArguments": "Дополнительные параметры для передачи в PowerShell. Могут быть как порядковыми, так и именованными.", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "Выберите значение переменной ErrorActionPreference для выполнения скрипта.", + "loc.input.label.FailOnStandardError": "Сбой со стандартной ошибкой", + "loc.input.help.FailOnStandardError": "Если задано значение True, задача будет завершаться сбоем при записи любых ошибок в конвейер ошибок или записи любых данных в стандартный поток ошибок.", + "loc.input.label.TargetAzurePs": "Версия Azure PowerShell", + "loc.input.help.TargetAzurePs": "Для размещенных агентов поддерживаются следующие версии Azure PowerShell: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0 (размещенная очередь Visual Studio 2017).\nЧтобы выбрать последнюю версию, доступную в агенте, выберите пункт \"Последняя установленная версия\".\n\nДля частных агентов можно указать предпочтительную версию Azure PowerShell с помощью элемента \"Указать версию\"", + "loc.input.label.CustomTargetAzurePs": "Предпочтительная версия Azure PowerShell", + "loc.input.help.CustomTargetAzurePs": "Предпочтительная версия Azure PowerShell должна быть надлежащей семантической версией, например 1.2.3. Регулярные выражения, например 2.\\*,2.3.\\*, не поддерживаются. Размещенный пул Visual Studio 2017 сейчас поддерживает следующие версии модуля Az: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0", + "loc.input.label.pwsh": "Использовать PowerShell Core", + "loc.input.help.pwsh": "Если задано значение True, в Windows задача будет использовать программу pwsh.exe, указанную в переменной PATH, вместо powershell.exe.", + "loc.input.label.validateScriptSignature": "Проверка подписи сценария", + "loc.input.help.validateScriptSignature": "Если задано значение true, задача сначала проверит, что указанный сценарий подписан и действителен, прежде чем выполнить его.", + "loc.input.label.workingDirectory": "Рабочий каталог", + "loc.input.help.workingDirectory": "Рабочий каталог, в котором выполняется скрипт.", + "loc.messages.GeneratingScript": "Формируется скрипт.", + "loc.messages.JS_FormattedCommand": "Отформатирована команда: %s", + "loc.messages.InvalidScriptArguments0": "Недопустимые аргументы скрипта \"{0}\". Разрывы строк запрещены.", + "loc.messages.InvalidScriptPath0": "Недопустимый путь к скрипту \"{0}\". Указаны символы, недопустимые в пути.", + "loc.messages.InvalidAzurePsVersion": "Указанная версия Azure PowerShell \"{0}\" имеет неправильный формат. Проверьте формат. Пример правильного формата: 1.0.1", + "loc.messages.JS_ExitCode": "Завершение работы PowerShell с кодом \"%s\".", + "loc.messages.JS_Stderr": "Оболочка PowerShell записала одну или несколько строк в стандартный поток ошибок.", + "loc.messages.ExpiredServicePrincipal": "Не удалось получить маркер доступа для Azure. Убедитесь, что используемый субъект-служба является допустимым, а срок его действия не истек.", + "loc.messages.PS_ExitCode": "Завершение работы PowerShell с кодом \"{0}\"." +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Strings/resources.resjson/zh-CN/resources.resjson b/_generated/AzurePowerShellV5/Strings/resources.resjson/zh-CN/resources.resjson new file mode 100644 index 000000000000..5310d72bc283 --- /dev/null +++ b/_generated/AzurePowerShellV5/Strings/resources.resjson/zh-CN/resources.resjson @@ -0,0 +1,42 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[详细了解此任务](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "在 Azure 环境中运行 PowerShell 脚本", + "loc.instanceNameFormat": "Azure PowerShell 脚本: $(ScriptType)", + "loc.releaseNotes": "添加了对 Azure 模块和跨平台代理的支持。", + "loc.group.displayName.AzurePowerShellVersionOptions": "Azure PowerShell 版本选项", + "loc.group.displayName.advanced": "高级", + "loc.input.label.ConnectedServiceNameARM": "Azure 订阅", + "loc.input.help.ConnectedServiceNameARM": "在运行 PowerShell 之前配置的 Azure 资源管理器订阅", + "loc.input.label.ScriptType": "脚本类型", + "loc.input.help.ScriptType": "脚本类型: 文件路径或内联脚本", + "loc.input.label.ScriptPath": "脚本路径", + "loc.input.help.ScriptPath": "脚本的路径。应是完全限定的路径或相对于默认工作目录。", + "loc.input.label.Inline": "内联脚本", + "loc.input.help.Inline": "输入要执行的脚本。", + "loc.input.label.ScriptArguments": "脚本参数", + "loc.input.help.ScriptArguments": "要传递给 PowerShell 的其他参数。可以是序号或命名参数。", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "选择执行脚本的 ErrorActionPreference 变量的值。", + "loc.input.label.FailOnStandardError": "因标准错误失败", + "loc.input.help.FailOnStandardError": "如果为 true,当有错误被写入错误管道或有数据被写入标准错误流时,此任务将失败。", + "loc.input.label.TargetAzurePs": "Azure PowerShell 版本", + "loc.input.help.TargetAzurePs": "对于托管代理,受支持的 Azure PowerShell 版本为: 1.0.0、1.6.0、2.3.2、2.6.0、3.1.0 (托管的 VS2017 队列)。\n若要选择代理上的最新可用版本,请选择“已安装的最新版本”。\n\n对于专用代理,可以使用“指定版本”指定 Azure PowerShell 的首选版本", + "loc.input.label.CustomTargetAzurePs": "首选 Azure PowerShell 版本", + "loc.input.help.CustomTargetAzurePs": "首选 Azure PowerShell 版本需为正确的语义版本,例如 1.2.3。不支持 2.\\*、2.3.\\* 等正则表达式。托管 VS2017 池当前支持 Azure 模块版本: 1.0.0、1.6.0、2.3.2、2.6.0、3.1.0", + "loc.input.label.pwsh": "使用 PowerShell Core", + "loc.input.help.pwsh": "如果为 true,则在 Windows 上,任务将使用来自 PATH 的 pwsh.exe,而不是 powershell.exe。", + "loc.input.label.validateScriptSignature": "验证脚本签名", + "loc.input.help.validateScriptSignature": "如果为 true,则任务将首先检查以确保指定的脚本已签名并且在执行前有效。", + "loc.input.label.workingDirectory": "工作目录", + "loc.input.help.workingDirectory": "在其中运行脚本的工作目录。", + "loc.messages.GeneratingScript": "正在生成脚本。", + "loc.messages.JS_FormattedCommand": "已设置格式的命令: %s", + "loc.messages.InvalidScriptArguments0": "脚本参数“{0}”无效。不允许换行。", + "loc.messages.InvalidScriptPath0": "脚本路径“{0}”无效。指定的路径字符无效。", + "loc.messages.InvalidAzurePsVersion": "指定的 Azure PowerShell 版本“{0}”格式不正确。请检查格式。正确格式的示例为 1.0.1", + "loc.messages.JS_ExitCode": "PowerShell 已退出,代码为“%s”。", + "loc.messages.JS_Stderr": "PowerShell 向标准错误流写入一个或多个行。", + "loc.messages.ExpiredServicePrincipal": "无法提取 Azure 的访问令牌。请确保使用的服务主体有效且未过期。", + "loc.messages.PS_ExitCode": "PowerShell 已退出,代码为“{0}”。" +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Strings/resources.resjson/zh-TW/resources.resjson b/_generated/AzurePowerShellV5/Strings/resources.resjson/zh-TW/resources.resjson new file mode 100644 index 000000000000..1532a782e6fe --- /dev/null +++ b/_generated/AzurePowerShellV5/Strings/resources.resjson/zh-TW/resources.resjson @@ -0,0 +1,42 @@ +{ + "loc.friendlyName": "Azure PowerShell", + "loc.helpMarkDown": "[深入了解此工作](https://go.microsoft.com/fwlink/?LinkID=613749)", + "loc.description": "在 Azure 環境中執行 PowerShell 指令碼", + "loc.instanceNameFormat": "Azure PowerShell 指令碼: $(ScriptType)", + "loc.releaseNotes": "新增了 Az 模組和跨平台代理程式的支援。", + "loc.group.displayName.AzurePowerShellVersionOptions": "Azure PowerShell 版本選項", + "loc.group.displayName.advanced": "進階", + "loc.input.label.ConnectedServiceNameARM": "Azure 訂用帳戶", + "loc.input.help.ConnectedServiceNameARM": "執行 PowerShell 之前要設定的 Azure Resource Manager 訂用帳戶", + "loc.input.label.ScriptType": "指令碼類型", + "loc.input.help.ScriptType": "指令碼類型: 檔案路徑或內嵌指令碼", + "loc.input.label.ScriptPath": "指令碼路徑", + "loc.input.help.ScriptPath": "指令碼的路徑。必須是完整路徑名稱或預設工作目錄的相對路徑。", + "loc.input.label.Inline": "內嵌指令碼", + "loc.input.help.Inline": "請輸入要執行的指令碼。", + "loc.input.label.ScriptArguments": "指令碼引數", + "loc.input.help.ScriptArguments": "傳遞至 PowerShell 的額外引數。可以是序數或具名參數。", + "loc.input.label.errorActionPreference": "ErrorActionPreference", + "loc.input.help.errorActionPreference": "請選取用於執行指令碼的 ErrorActionPreference 變數值。", + "loc.input.label.FailOnStandardError": "發生標準錯誤的失敗", + "loc.input.help.FailOnStandardError": "若此項為 true,如果在錯誤管線中寫入任何錯誤,或在標準錯誤資料流中寫入任何資料,此工作就會失敗。", + "loc.input.label.TargetAzurePs": "Azure PowerShell 版本", + "loc.input.help.TargetAzurePs": "若為裝載的代理程式,則支援的 Azure PowerShell 版本為: 1.0.0、1.6.0、2.3.2、2.6.0、3.1.0 (裝載的 VS2017 佇列)。\n若要挑選代理程式上可用的最新版本,請選取 [最新安裝的版本]。\n\n若為私人代理程式,您可以使用 [指定版本] 指定慣用的 Azure PowerShell 版本", + "loc.input.label.CustomTargetAzurePs": "慣用的 Azure PowerShell 版本", + "loc.input.help.CustomTargetAzurePs": "慣用的 Azure PowerShell 版本必須是正確的語意版本,例如 1.2.3。不支援像 2.\\*,2.3.\\* 這樣的 Regex。裝載的 VS2017 集區目前支援 Az 模組版本: 1.0.0、1.6.0、2.3.2、2.6.0、3.1.0", + "loc.input.label.pwsh": "使用 PowerShell Core", + "loc.input.help.pwsh": "若此為 true,那麼在 Windows 上,工作就會使用 PATH 中的 pwsh.exe 而非 powershell.exe。", + "loc.input.label.validateScriptSignature": "驗證指令碼簽章", + "loc.input.help.validateScriptSignature": "如果此為 true,則工作會先進行檢查,確定指定的指令碼已簽署且有效,然後再執行。", + "loc.input.label.workingDirectory": "工作目錄", + "loc.input.help.workingDirectory": "指令碼執行所在的工作目錄。", + "loc.messages.GeneratingScript": "正在產生指令碼。", + "loc.messages.JS_FormattedCommand": "經過格式化的命令: %s", + "loc.messages.InvalidScriptArguments0": "指令碼引數 '{0}' 無效。不允許分行符號。", + "loc.messages.InvalidScriptPath0": "指令碼路徑 '{0}' 無效。指定的路徑字元無效。", + "loc.messages.InvalidAzurePsVersion": "指定的 Azure PowerShell 版本 '{0}' 格式不正確。請檢查格式。正確格式的範例為 1.0.1", + "loc.messages.JS_ExitCode": "PowerShell 已結束,代碼為 '%s'。", + "loc.messages.JS_Stderr": "PowerShell 已將一或多行寫入標準錯誤資料流。", + "loc.messages.ExpiredServicePrincipal": "無法擷取 Azure 的存取權杖。請驗證使用的服務主體是否有效且未過期。", + "loc.messages.PS_ExitCode": "PowerShell 已結束,代碼為 '{0}'。" +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Tests/ChecksForPowerShell.ps1 b/_generated/AzurePowerShellV5/Tests/ChecksForPowerShell.ps1 new file mode 100644 index 000000000000..7ea294a29d90 --- /dev/null +++ b/_generated/AzurePowerShellV5/Tests/ChecksForPowerShell.ps1 @@ -0,0 +1,32 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +$targetAzurePs = "4.1.0" +Register-Mock Get-VstsInput { "FilePath" } -- -Name ScriptType -Require +Register-Mock Get-VstsInput { "$PSScriptRoot/PerformsBasicFlow_TargetScript.ps1" } -- -Name ScriptPath +Register-Mock Get-VstsInput { $targetAzurePs } -- -Name TargetAzurePs +Register-Mock Get-VstsInput { 'arg1 arg2' } -- -Name ScriptArguments +Register-Mock Get-VstsInput { "continue" } -- -Name errorActionPreference +Register-Mock Get-VstsInput { $true } -- -Name FailOnStandardError +Register-Mock Get-VstsInput { $false } -- -Name pwsh -AsBool +Register-Mock Update-PSModulePathForHostedAgent +Register-Mock Get-Module +Register-Mock Initialize-AzModule +Register-Mock Get-VstsEndpoint { @{auth = @{ scheme = "ServicePrincipal" }} } +Register-Mock Remove-EndpointSecrets +Register-Mock Disconnect-AzureAndClearContext +Register-Mock Assert-VstsPath +Register-Mock Invoke-VstsTool { } +Register-Mock Write-VstsTaskError +Register-Mock Write-VstsSetResult +Register-Mock Expand-ModuleZip +Register-Mock Invoke-RestMethod +Register-Mock Save-Module + +# Act. +$actual = & $PSScriptRoot\..\AzurePowerShell.ps1 + +Assert-WasCalled Invoke-VstsTool -Times 1 +Assert-WasCalled Invoke-VstsTool -ArgumentsEvaluator {($args | ConvertTo-Json) -like '*powershell.exe*'} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Tests/ChecksForPowerShellCore.ps1 b/_generated/AzurePowerShellV5/Tests/ChecksForPowerShellCore.ps1 new file mode 100644 index 000000000000..ebf4f7706981 --- /dev/null +++ b/_generated/AzurePowerShellV5/Tests/ChecksForPowerShellCore.ps1 @@ -0,0 +1,32 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +$targetAzurePs = "4.1.0" +Register-Mock Get-VstsInput { "FilePath" } -- -Name ScriptType -Require +Register-Mock Get-VstsInput { "$PSScriptRoot/PerformsBasicFlow_TargetScript.ps1" } -- -Name ScriptPath +Register-Mock Get-VstsInput { $targetAzurePs } -- -Name TargetAzurePs +Register-Mock Get-VstsInput { 'arg1 arg2' } -- -Name ScriptArguments +Register-Mock Get-VstsInput { "continue" } -- -Name errorActionPreference +Register-Mock Get-VstsInput { $true } -- -Name FailOnStandardError +Register-Mock Get-VstsInput { $true } -- -Name pwsh -AsBool -Default $false +Register-Mock Update-PSModulePathForHostedAgent +Register-Mock Get-Module +Register-Mock Initialize-AzModule +Register-Mock Get-VstsEndpoint { @{auth = @{ scheme = "ServicePrincipal" }} } +Register-Mock Remove-EndpointSecrets +Register-Mock Disconnect-AzureAndClearContext +Register-Mock Assert-VstsPath +Register-Mock Invoke-VstsTool { } +Register-Mock Write-VstsTaskError +Register-Mock Write-VstsSetResult +Register-Mock Expand-ModuleZip +Register-Mock Invoke-RestMethod +Register-Mock Save-Module + +# Act. +$actual = & $PSScriptRoot\..\AzurePowerShell.ps1 + +Assert-WasCalled Invoke-VstsTool -Times 1 +Assert-WasCalled Invoke-VstsTool -ArgumentsEvaluator {($args | ConvertTo-Json) -like '*pwsh.exe*'} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Tests/ChecksForWorkingDirectory.ps1 b/_generated/AzurePowerShellV5/Tests/ChecksForWorkingDirectory.ps1 new file mode 100644 index 000000000000..4747d0181cc4 --- /dev/null +++ b/_generated/AzurePowerShellV5/Tests/ChecksForWorkingDirectory.ps1 @@ -0,0 +1,34 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +$targetAzurePs = "4.1.0" +$input_workingDirectory = "C:\Users" +Register-Mock Get-VstsInput { "FilePath" } -- -Name ScriptType -Require +Register-Mock Get-VstsInput { "$PSScriptRoot/PerformsBasicFlow_TargetScript.ps1" } -- -Name ScriptPath +Register-Mock Get-VstsInput { $targetAzurePs } -- -Name TargetAzurePs +Register-Mock Get-VstsInput { 'arg1 arg2' } -- -Name ScriptArguments +Register-Mock Get-VstsInput { "continue" } -- -Name errorActionPreference +Register-Mock Get-VstsInput { $true } -- -Name FailOnStandardError +Register-Mock Get-VstsInput { $true } -- -Name pwsh -AsBool +Register-Mock Get-VstsInput { $input_workingDirectory } -- -Name workingDirectory -Require +Register-Mock Update-PSModulePathForHostedAgent +Register-Mock Get-Module +Register-Mock Initialize-AzModule +Register-Mock Get-VstsEndpoint { @{auth = @{ scheme = "ServicePrincipal" }} } +Register-Mock Remove-EndpointSecrets +Register-Mock Disconnect-AzureAndClearContext +Register-Mock Assert-VstsPath +Register-Mock Invoke-VstsTool { } +Register-Mock Write-VstsTaskError +Register-Mock Write-VstsSetResult +Register-Mock Expand-ModuleZip +Register-Mock Invoke-RestMethod +Register-Mock Save-Module + +# Act. +$actual = & $PSScriptRoot\..\AzurePowerShell.ps1 + +Assert-WasCalled Invoke-VstsTool -Times 1 +Assert-WasCalled Invoke-VstsTool -ArgumentsEvaluator {($args | ConvertTo-Json) -like '*C:\\Users*'} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Tests/L0.ts b/_generated/AzurePowerShellV5/Tests/L0.ts new file mode 100644 index 000000000000..419e7a10004e --- /dev/null +++ b/_generated/AzurePowerShellV5/Tests/L0.ts @@ -0,0 +1,58 @@ +/// +/// +/// + +import Q = require('q'); +import assert = require('assert'); +import path = require('path'); +var psm = require('../../../Tests/lib/psRunner'); +var psr = null; + +describe('AzurePowerShell Suite', function () { + this.timeout(parseInt(process.env.TASK_TEST_TIMEOUT) || 20000); + + before((done) => { + if (psm.testSupported()) { + psr = new psm.PSRunner(); + psr.start(); + } + + done(); + }); + + after(function () { + if (psr) { + psr.kill(); + } + }); + + if (psm.testSupported()) { + it('checks for powershell core', (done) => { + psr.run(path.join(__dirname, 'ChecksForPowerShellCore.ps1'), done); + }) + it('checks for powershell', (done) => { + psr.run(path.join(__dirname, 'ChecksForPowerShell.ps1'), done); + }) + it('checks for working directory', (done) => { + psr.run(path.join(__dirname, 'ChecksForWorkingDirectory.ps1'), done); + }) + it('performs basic flow', (done) => { + psr.run(path.join(__dirname, 'PerformsBasicFlow.ps1'), done); + }) + it('throws when otherversion is specified in a wrong format', (done) => { + psr.run(path.join(__dirname, 'ThrowsForInvalidVersion.ps1'), done); + }) + it('throws when invalid script arguments', (done) => { + psr.run(path.join(__dirname, 'ThrowsWhenInvalidScriptArguments.ps1'), done); + }) + it('throws when invalid script path', (done) => { + psr.run(path.join(__dirname, 'ThrowsWhenInvalidScriptPath.ps1'), done); + }) + it('Get-LatestModule returns the latest available module', (done) => { + psr.run(path.join(__dirname, 'Utility.Get-LatestModule.ps1'), done); + }) + it('Update-PSModulePathForHostedAgent updated psmodulepath correctly', (done) => { + psr.run(path.join(__dirname, 'Utility.UpdatePSModulePathForHostedAgentWorksCorrectly.ps1'), done); + }) + } +}); \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Tests/PerformsBasicFlow.ps1 b/_generated/AzurePowerShellV5/Tests/PerformsBasicFlow.ps1 new file mode 100644 index 000000000000..7cb63f9cb4c8 --- /dev/null +++ b/_generated/AzurePowerShellV5/Tests/PerformsBasicFlow.ps1 @@ -0,0 +1,35 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +$targetAzurePs = "4.1.0" +Register-Mock Get-VstsInput { "FilePath" } -- -Name ScriptType -Require +Register-Mock Get-VstsInput { "$PSScriptRoot/PerformsBasicFlow_TargetScript.ps1" } -- -Name ScriptPath +Register-Mock Get-VstsInput { $targetAzurePs } -- -Name TargetAzurePs +Register-Mock Get-VstsInput { 'arg1 arg2' } -- -Name ScriptArguments +Register-Mock Get-VstsInput { "continue" } -- -Name errorActionPreference +Register-Mock Get-VstsInput { $true } -- -Name FailOnStandardError +Register-Mock Update-PSModulePathForHostedAgent +Register-Mock Get-Module +Register-Mock Initialize-AzModule +Register-Mock Get-VstsEndpoint { @{auth = @{ scheme = "ServicePrincipal" }} } +Register-Mock Remove-EndpointSecrets +Register-Mock Disconnect-AzureAndClearContext +Register-Mock Assert-VstsPath +Register-Mock Invoke-VstsTool { } +Register-Mock Write-VstsTaskError +Register-Mock Write-VstsSetResult +Register-Mock Expand-ModuleZip +Register-Mock Invoke-RestMethod +Register-Mock Save-Module + +# Act. +$actual = & $PSScriptRoot\..\AzurePowerShell.ps1 + +# Assert the error action preference was set to Continue. +Assert-AreEqual "Continue" $global:ErrorActionPreference +$global:ErrorActionPreference = 'Stop' # Reset to stop. + +# Assert the Azure helpers module was imported and invoked. +Assert-WasCalled Import-Module -- ([System.IO.Path]::GetFullPath("$PSScriptRoot\..\ps_modules\VstsAzureHelpers_")) diff --git a/_generated/AzurePowerShellV5/Tests/PerformsBasicFlow_TargetScript.ps1 b/_generated/AzurePowerShellV5/Tests/PerformsBasicFlow_TargetScript.ps1 new file mode 100644 index 000000000000..53aafdebcdd8 --- /dev/null +++ b/_generated/AzurePowerShellV5/Tests/PerformsBasicFlow_TargetScript.ps1 @@ -0,0 +1,4 @@ +# Return key information. +New-Object psobject -Property @{ + Args = $args +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Tests/ThrowsForInvalidVersion.ps1 b/_generated/AzurePowerShellV5/Tests/ThrowsForInvalidVersion.ps1 new file mode 100644 index 000000000000..5afc27858f1e --- /dev/null +++ b/_generated/AzurePowerShellV5/Tests/ThrowsForInvalidVersion.ps1 @@ -0,0 +1,15 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 + +Register-Mock Get-VstsInput { "FilePath" } -- -Name ScriptType -Require +Register-Mock Get-VstsInput { "foobar.ps1" } -- -Name ScriptPath +Register-Mock Get-VstsInput { "OtherVersion" } -- -Name TargetAzurePs +Register-Mock Get-VstsInput { "x.y.z" } -- -Name CustomTargetAzurePs + +# Act/Assert. +Assert-Throws { + & $PSScriptRoot\..\AzurePowerShell.ps1 +} -MessagePattern "InvalidAzurePsVersion*x.y.z" diff --git a/_generated/AzurePowerShellV5/Tests/ThrowsWhenInvalidScriptArguments.ps1 b/_generated/AzurePowerShellV5/Tests/ThrowsWhenInvalidScriptArguments.ps1 new file mode 100644 index 000000000000..af93358163bc --- /dev/null +++ b/_generated/AzurePowerShellV5/Tests/ThrowsWhenInvalidScriptArguments.ps1 @@ -0,0 +1,14 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +foreach ($arguments in @( "script`rarguments", "script`narguments" )) { + Unregister-Mock Get-VstsInput + Register-Mock Get-VstsInput { $arguments } -- -Name ScriptArguments + + # Act/Assert. + Assert-Throws { + & $PSScriptRoot\..\AzurePowerShell.ps1 + } -MessagePattern "InvalidScriptArguments0*$arguments" +} diff --git a/_generated/AzurePowerShellV5/Tests/ThrowsWhenInvalidScriptPath.ps1 b/_generated/AzurePowerShellV5/Tests/ThrowsWhenInvalidScriptPath.ps1 new file mode 100644 index 000000000000..a1334790ccba --- /dev/null +++ b/_generated/AzurePowerShellV5/Tests/ThrowsWhenInvalidScriptPath.ps1 @@ -0,0 +1,16 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +foreach ($path in @( "script`rpath", "script`npath" )) { + Unregister-Mock Get-VstsInput + Register-Mock Get-VstsInput { "FilePath" } -- -Name ScriptType -Require + Register-Mock Get-VstsInput { $path } -- -Name ScriptPath + Register-Mock Get-VstsInput { "4.1.0" } -- -Name TargetAzurePs + + # Act/Assert. + Assert-Throws { + & $PSScriptRoot\..\AzurePowerShell.ps1 + } -MessagePattern "InvalidScriptPath0*$path" +} diff --git a/_generated/AzurePowerShellV5/Tests/Utility.Get-LatestModule.ps1 b/_generated/AzurePowerShellV5/Tests/Utility.Get-LatestModule.ps1 new file mode 100644 index 000000000000..71609db6ede0 --- /dev/null +++ b/_generated/AzurePowerShellV5/Tests/Utility.Get-LatestModule.ps1 @@ -0,0 +1,30 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +. $PSScriptRoot\..\Utility.ps1 + +$azModulePath = "c:\modules\az_4.1.0" + +$azModulePattern = "^az_[0-9]+\.[0-9]+\.[0-9]+$" +$versionPattern = "[0-9]+\.[0-9]+\.[0-9]+$" + +$mockDirectoryStructure = @( + @{ + Name = "az_4.1.0" + FullName = "C:\Modules\az_4.1.0" + } + @{ + Name = "az_3.6.0" + FullName = "C:\Modules\az_3.6.0" + } +) + +Register-Mock Get-ChildItem { $mockDirectoryStructure } -- -Directory -Path "C:\Modules" +Register-Mock Test-Path { $true } + +# Act +$result = Get-LatestModule -patternToMatch $azModulePattern -patternToExtract $versionPattern +# Assert +Assert-AreEqual $result.toLower() $azModulePath \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/Tests/Utility.UpdatePSModulePathForHostedAgentWorksCorrectly.ps1 b/_generated/AzurePowerShellV5/Tests/Utility.UpdatePSModulePathForHostedAgentWorksCorrectly.ps1 new file mode 100644 index 000000000000..53c9c7875e54 --- /dev/null +++ b/_generated/AzurePowerShellV5/Tests/Utility.UpdatePSModulePathForHostedAgentWorksCorrectly.ps1 @@ -0,0 +1,47 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +. $PSScriptRoot\..\Utility.ps1 + +$azModulePath = "c:\modules\az_3.6.0" + +$azModulePattern = "^az_[0-9]+\.[0-9]+\.[0-9]+$" +$versionPattern = "[0-9]+\.[0-9]+\.[0-9]+$" + +$variableSets = @( + @{ + targetAzurePsVersion = "3.6.0" + azModuleExist = $true + } + @{ + targetAzurePsVersion = "" + azModulePath = $true + } +) + +$temp = $env:PSModulePath + +foreach ($variableSet in $variableSets) { + $env:PSModulePath = $temp + # Arrange + Unregister-Mock Get-LatestModule + if($variableSet.azModuleExist) { + Register-Mock Get-LatestModule { $azModulePath } -- -patternToMatch $azModulePattern -patternToExtract $versionPattern -Classic:$false + } else { + Register-Mock Get-LatestModule { "" } -- -patternToMatch $azModulePattern -patternToExtract $versionPattern -Classic:$false + } + + # Act + Update-PSModulePathForHostedAgent -targetAzurePs $variableSet.targetAzurePsVersion + + # Assert + if($variableSet.azModuleExist) { + Assert-IsGreaterThan -1 $env:PSModulePath.toLower().IndexOf($azModulePath) + } else { + Assert-AreEqual -1 $env:PSModulePath.toLower().IndexOf($azModulePath) + } + + Assert-IsGreaterThan 0 $env:PSModulePath.toLower().IndexOf(";") +} diff --git a/_generated/AzurePowerShellV5/ThirdPartyNotices.txt b/_generated/AzurePowerShellV5/ThirdPartyNotices.txt new file mode 100644 index 000000000000..abc33cfd772f --- /dev/null +++ b/_generated/AzurePowerShellV5/ThirdPartyNotices.txt @@ -0,0 +1,136 @@ + +THIRD-PARTY SOFTWARE NOTICES AND INFORMATION +Do Not Translate or Localize + +Azure PowerShell incorporates third party material from the projects listed below. The original copyright notice and the license under which Microsoft received such third party material are set forth below. Microsoft reserves all other rights not expressly granted, whether by implication, estoppel or otherwise. + +1. OpenSSL (http://www.openssl.org) + +%% OpenSSL NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= + LICENSE ISSUES + ============== + + The OpenSSL toolkit stays under a dual license, i.e. both the conditions of + the OpenSSL License and the original SSLeay license apply to the toolkit. + See below for the actual license texts. Actually both licenses are BSD-style + Open Source licenses. In case of any license issues related to OpenSSL + please contact openssl-core@openssl.org. + + OpenSSL License + --------------- + +/* ==================================================================== + * Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/) + * + * 4. The names OpenSSL Toolkit and OpenSSL Project must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called OpenSSL + * nor may OpenSSL appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/) + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + + Original SSLeay License + ----------------------- + +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com) + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * This product includes software written by Tim Hudson (tjh@cryptsoft.com) + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] +========================================= +END OF OpenSSL NOTICES, INFORMATION, AND LICENSE diff --git a/_generated/AzurePowerShellV5/TryMakingModuleAvailable.ps1 b/_generated/AzurePowerShellV5/TryMakingModuleAvailable.ps1 new file mode 100644 index 000000000000..cf41cc06bfd7 --- /dev/null +++ b/_generated/AzurePowerShellV5/TryMakingModuleAvailable.ps1 @@ -0,0 +1,85 @@ +[CmdletBinding()] +param ( + [string] + $targetVersion, + + [string] [Parameter(Mandatory = $true)] [ValidateSet("Windows", "Linux", "Mac")] + $platform +) + +try { + $isWin = $platform -eq "Windows" + + . (Join-Path $PSScriptRoot "Utility.ps1") + $isHostedAgent = Test-IsHostedAgentPathPresent -isWin $isWin + + if (!$isHostedAgent) { + Write-Verbose "Module path not present as expected in hosted agent, skipping step to make module available." + $moduleSource = "privateAgent" + return + } + + if (!$targetVersion) { + Write-Verbose "Latest selected, will make use of the latest available in agent as folder." + $moduleSource = "hostedAgentFolder" + return + } + + $modulePath = Get-SavedModulePath -azurePowerShellVersion $targetVersion -isWin $isWin + if (Test-Path $modulePath) { + Write-Verbose "Az $targetVersion present at $modulePath as folder." + $moduleSource = "hostedAgentFolder" + return + } + + $moduleContainerPath = Get-SavedModuleContainerPath -isWin $isWin + $moduleZipPath = $modulePath + ".zip"; + if (Test-Path $moduleZipPath) { + Write-Verbose "Az $targetVersion present at $moduleZipPath as zip, expanding it." + Expand-ModuleZip -zipPath $moduleZipPath -destination $moduleContainerPath -isWin $isWin + Write-Verbose "Zip expanded" + $moduleSource = "hostedAgentZip" + return + } + + Write-Host "Az version $targetVersion not avaiable locally on the agent. Downloading dynamically." + + try { + Write-Verbose "Getting versions manifest from GHRelease." + $versionsManifest = Invoke-RestMethod -Method Get ` + -Headers @{ "Accept" = "application/vnd.github.VERSION.raw" } ` + -Uri "https://api.github.com/repos/Azure/az-ps-module-versions/contents/versions-manifest.json" + Write-Verbose "Versions manifest downloaded." + $downloadUrlEntity = $versionsManifest | Where-Object version -eq $targetVersion + if ($downloadUrlEntity) { + $downloadUrl = $downloadUrlEntity.files[0].download_url + Write-Verbose "Downloading Az $targetVersion from GHRelease" + (New-Object System.Net.WebClient).DownloadFile($downloadUrl, $moduleZipPath) + Write-Verbose "Download succeeded" + if (Test-Path $moduleZipPath) { + Write-Verbose "Expanding Az $targetVersion downloaded at $moduleZipPath as zip." + Expand-ModuleZip -zipPath $moduleZipPath -destination $moduleContainerPath -isWin $isWin + Write-Verbose "Zip expanded" + $moduleSource = "hostedAgentGHRelease" + return + } + } else { + Write-Verbose "Az $targetVersion not present in versions manifest from GHRelease" + } + } catch { + Write-Verbose "Failed to download from GHRelease" + Write-Verbose $_ + } + + Write-Verbose "Downloading Az $targetVersion from PSGallery." + Save-Module -Path $modulePath -Name Az -RequiredVersion $targetVersion -Force -ErrorAction Stop + $moduleSource = "hostedAgentPSGallery" +} finally { + # Telemetry + # moduleSource value will be privateAgent(in case of self hosted private agents), hostedAgentFolder(when a version is present as folder or + # when latest is selected we will use the one latest available as folder), hostedAgentZip(when the module is available as a zip locally), + # hostedAgentGHRelease(when the module zip is downloaded from our GitHub releases management), hostedAgentPSGallery(when we download from PSGallery + # using the Save-Module cmdlet). + $telemetryJsonContent = @{ targetAzurePs = $targetVersion; moduleSource = $moduleSource } | ConvertTo-Json -Compress + Write-Host "##vso[telemetry.publish area=TaskHub;feature=AzurePowerShellV5]$telemetryJsonContent" +} diff --git a/_generated/AzurePowerShellV5/Utility.ps1 b/_generated/AzurePowerShellV5/Utility.ps1 new file mode 100644 index 000000000000..8e6804ffe66e --- /dev/null +++ b/_generated/AzurePowerShellV5/Utility.ps1 @@ -0,0 +1,203 @@ +function Get-SavedModuleContainerPath { + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true)] + [bool] + $isWin + ) + + if ($isWin) { + return $env:SystemDrive + "\Modules"; + } else { + return "/usr/share"; + } +} + +function Test-IsHostedAgentPathPresent { + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true)] + [bool] + $isWin + ) + + $containerPath = Get-SavedModuleContainerPath -isWin $isWin + return Test-Path (Join-Path $containerPath "az_*") +} + +function Get-SavedModulePath { + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true)] + [string] + $azurePowerShellVersion, + + [Parameter(Mandatory = $true)] + [bool] + $isWin + ) + + $savedModulePath = Join-Path (Get-SavedModuleContainerPath -isWin $isWin) "az_$azurePowerShellVersion" + Write-Verbose "The value of the module path is: $savedModulePath" + return $savedModulePath +} + +function Expand-ModuleZip { + param ( + [string] [Parameter(Mandatory = $true)] + $zipPath, + + [string] [Parameter(Mandatory = $true)] + $destination, + + [bool] [Parameter(Mandatory=$true)] + $isWin + ) + + if ($isWin) { + $parameter = @("x", "-o$destination", "$zipPath") + $command = "$PSScriptRoot\7zip\7z.exe" + &$command @parameter + } else { + $prevProgressPref = $ProgressPreference + $ProgressPreference = 'SilentlyContinue' + Expand-Archive -Path $zipPath -DestinationPath $destination + $ProgressPreference = $prevProgressPref + } +} + +function Update-PSModulePathForHostedAgent { + [CmdletBinding()] + param([string] $targetAzurePs) + try { + if ($targetAzurePs) { + $hostedAgentAzModulePath = Get-SavedModulePath -azurePowerShellVersion $targetAzurePs -isWin $true + } + else { + $hostedAgentAzModulePath = Get-LatestModule -patternToMatch "^az_[0-9]+\.[0-9]+\.[0-9]+$" -patternToExtract "[0-9]+\.[0-9]+\.[0-9]+$" + } + $env:PSModulePath = $hostedAgentAzModulePath + ";" + $env:PSModulePath + $env:PSModulePath = $env:PSModulePath.TrimStart(';') + } finally { + Write-Verbose "The updated value of the PSModulePath is: $($env:PSModulePath)" + } +} + +function Update-PSModulePathForHostedAgentLinux { + [CmdletBinding()] + param([string] $targetAzurePs) + try { + if ($targetAzurePs) { + $hostedAgentAzModulePath = Get-SavedModulePath -azurePowerShellVersion $targetAzurePs -isWin $false + if(!(Test-Path $hostedAgentAzModulePath)) { + Write-Verbose "No module path found with this name" + throw ("Could not find the module path with given version.") + } + } + else { + $hostedAgentAzModulePath = Get-LatestModuleLinux -patternToMatch "^az_[0-9]+\.[0-9]+\.[0-9]+$" -patternToExtract "[0-9]+\.[0-9]+\.[0-9]+$" + } + $env:PSModulePath = $hostedAgentAzModulePath + ":" + $env:PSModulePath + $env:PSModulePath = $env:PSModulePath.TrimStart(':') + } finally { + Write-Verbose "The updated value of the PSModulePath is: $($env:PSModulePath)" + } +} + +function Get-LatestModule { + [CmdletBinding()] + param([string] $patternToMatch, + [string] $patternToExtract) + + $resultFolder = "" + $regexToMatch = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList $patternToMatch + $regexToExtract = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList $patternToExtract + $maxVersion = [version] "0.0.0" + $modulePath = $env:SystemDrive + "\Modules"; + + try { + if (-not (Test-Path -Path $modulePath)) { + return $resultFolder + } + + $moduleFolders = Get-ChildItem -Directory -Path $modulePath | Where-Object { $regexToMatch.IsMatch($_.Name) } + foreach ($moduleFolder in $moduleFolders) { + $moduleVersion = [version] $($regexToExtract.Match($moduleFolder.Name).Groups[0].Value) + if($moduleVersion -gt $maxVersion) { + $modulePath = [System.IO.Path]::Combine($moduleFolder.FullName,"Az\$moduleVersion\Az.psm1") + + if(Test-Path -LiteralPath $modulePath -PathType Leaf) { + $maxVersion = $moduleVersion + $resultFolder = $moduleFolder.FullName + } else { + Write-Verbose "A folder matching the module folder pattern was found at $($moduleFolder.FullName) but didn't contain a valid module file" + } + } + } + } + catch { + Write-Verbose "Attempting to find the Latest Module Folder failed with the error: $($_.Exception.Message)" + $resultFolder = "" + } + Write-Verbose "Latest module folder detected: $resultFolder" + return $resultFolder +} + +function Get-LatestModuleLinux { + [CmdletBinding()] + param([string] $patternToMatch, + [string] $patternToExtract) + + $resultFolder = "" + $regexToMatch = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList $patternToMatch + $regexToExtract = New-Object -TypeName System.Text.RegularExpressions.Regex -ArgumentList $patternToExtract + $maxVersion = [version] "0.0.0" + + try { + $moduleFolders = Get-ChildItem -Directory -Path $("/usr/share") | Where-Object { $regexToMatch.IsMatch($_.Name) } + foreach ($moduleFolder in $moduleFolders) { + $moduleVersion = [version] $($regexToExtract.Match($moduleFolder.Name).Groups[0].Value) + if($moduleVersion -gt $maxVersion) { + $modulePath = [System.IO.Path]::Combine($moduleFolder.FullName,"Az/$moduleVersion/Az.psm1") + + if(Test-Path -LiteralPath $modulePath -PathType Leaf) { + $maxVersion = $moduleVersion + $resultFolder = $moduleFolder.FullName + } else { + Write-Verbose "A folder matching the module folder pattern was found at $($moduleFolder.FullName) but didn't contain a valid module file" + } + } + } + } + catch { + Write-Verbose "Attempting to find the Latest Module Folder failed with the error: $($_.Exception.Message)" + $resultFolder = "" + } + Write-Verbose "Latest module folder detected: $resultFolder" + return $resultFolder +} + +function CleanUp-PSModulePathForHostedAgent { + # Clean up PSModulePath for hosted agent + $azureRMModulePath = "C:\Modules\azurerm_2.1.0" + $azureModulePath = "C:\Modules\azure_2.1.0" + $azPSModulePath = $env:PSModulePath + + if ($azPSModulePath.split(";") -contains $azureRMModulePath) { + $azPSModulePath = (($azPSModulePath).Split(";") | ? { $_ -ne $azureRMModulePath }) -join ";" + write-verbose "$azureRMModulePath removed. Restart the prompt for the changes to take effect." + } + else { + write-verbose "$azureRMModulePath is not present in $azPSModulePath" + } + + if ($azPSModulePath.split(";") -contains $azureModulePath) { + $azPSModulePath = (($azPSModulePath).Split(";") | ? { $_ -ne $azureModulePath }) -join ";" + write-verbose "$azureModulePath removed. Restart the prompt for the changes to take effect." + } + else { + write-verbose "$azureModulePath is not present in $azPSModulePath" + } + + $env:PSModulePath = $azPSModulePath +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/azurepowershell.ts b/_generated/AzurePowerShellV5/azurepowershell.ts new file mode 100644 index 000000000000..c5378d87d040 --- /dev/null +++ b/_generated/AzurePowerShellV5/azurepowershell.ts @@ -0,0 +1,165 @@ +import fs = require('fs'); +import path = require('path'); +import os = require('os'); +import tl = require('azure-pipelines-task-lib/task'); +import tr = require('azure-pipelines-task-lib/toolrunner'); + +import { AzureRMEndpoint } from 'azure-pipelines-tasks-azure-arm-rest/azure-arm-endpoint'; +var uuidV4 = require('uuid/v4'); + +function convertToNullIfUndefined(arg: T): T|null { + return arg ? arg : null; +} + +async function run() { + try { + tl.setResourcePath(path.join(__dirname, 'task.json')); + + // Get inputs. + let _vsts_input_errorActionPreference: string = tl.getInput('errorActionPreference', false) || 'Stop'; + switch (_vsts_input_errorActionPreference.toUpperCase()) { + case 'STOP': + case 'CONTINUE': + case 'SILENTLYCONTINUE': + break; + default: + throw new Error(tl.loc('JS_InvalidErrorActionPreference', _vsts_input_errorActionPreference)); + } + + let scriptType: string = tl.getInput('ScriptType', /*required*/true); + let scriptPath = convertToNullIfUndefined(tl.getPathInput('ScriptPath', false)); + let scriptInline: string = convertToNullIfUndefined(tl.getInput('Inline', false)); + let scriptArguments: string = convertToNullIfUndefined(tl.getInput('ScriptArguments', false)); + let _vsts_input_failOnStandardError = convertToNullIfUndefined(tl.getBoolInput('FailOnStandardError', false)); + let targetAzurePs: string = convertToNullIfUndefined(tl.getInput('TargetAzurePs', false)); + let customTargetAzurePs: string = convertToNullIfUndefined(tl.getInput('CustomTargetAzurePs', false)); + let serviceName = tl.getInput('ConnectedServiceNameARM',/*required*/true); + let endpointObject= await new AzureRMEndpoint(serviceName).getEndpoint(); + let input_workingDirectory = tl.getPathInput('workingDirectory', /*required*/ true, /*check*/ true); + let isDebugEnabled = (process.env['SYSTEM_DEBUG'] || "").toLowerCase() === "true"; + + // string constants + let otherVersion = "OtherVersion" + + if (targetAzurePs == otherVersion) { + if (customTargetAzurePs != "") { + targetAzurePs = customTargetAzurePs; + } + else { + console.log(tl.loc('InvalidAzurePsVersion',customTargetAzurePs)); + } + } + else { + targetAzurePs = "" + } + + var endpoint = JSON.stringify(endpointObject); + + if (scriptType.toUpperCase() == 'FILEPATH') { + if (!tl.stats(scriptPath).isFile() || !scriptPath.toUpperCase().match(/\.PS1$/)) { + throw new Error(tl.loc('JS_InvalidFilePath', scriptPath)); + } + } + + // Generate the script contents. + console.log(tl.loc('GeneratingScript')); + let contents: string[] = []; + + if (isDebugEnabled) { + contents.push("$VerbosePreference = 'continue'"); + } + + const makeModuleAvailableScriptPath = path.join(path.resolve(__dirname), 'TryMakingModuleAvailable.ps1'); + contents.push(`${makeModuleAvailableScriptPath} -targetVersion '${targetAzurePs}' -platform Linux`); + + contents.push(`$ErrorActionPreference = '${_vsts_input_errorActionPreference}'`); + + let azFilePath = path.join(path.resolve(__dirname), 'InitializeAz.ps1'); + let initAzCommand = `${azFilePath} -endpoint '${endpoint}'` + if (targetAzurePs != "") { + initAzCommand += ` -targetAzurePs ${targetAzurePs}`; + } + if (endpointObject.scheme === 'WorkloadIdentityFederation') { + const oidc_token = await endpointObject.applicationTokenCredentials.getFederatedToken(); + initAzCommand += ` -clientAssertionJwt ${oidc_token}`; + } + contents.push(initAzCommand); + + if (scriptArguments == null) { + scriptArguments = ""; + } + + if (scriptType.toUpperCase() == 'FILEPATH') { + contents.push(`. '${scriptPath.replace(/'/g, "''")}' ${scriptArguments}`.trim()); + console.log(tl.loc('JS_FormattedCommand', contents[contents.length - 1])); + } + else { + contents.push(scriptInline); + } + + // Write the script to disk. + tl.assertAgent('2.115.0'); + let tempDirectory = tl.getVariable('agent.tempDirectory'); + tl.checkPath(tempDirectory, `${tempDirectory} (agent.tempDirectory)`); + let filePath = path.join(tempDirectory, uuidV4() + '.ps1'); + + await fs.writeFile( + filePath, + '\ufeff' + contents.join(os.EOL), // Prepend the Unicode BOM character. + { encoding: 'utf8' }, // Since UTF8 encoding is specified, node will + // encode the BOM into its UTF8 binary sequence. + function (err) { + if (err) throw err; + console.log('File saved!'); + }); + + // Run the script. + // + // Note, prefer "pwsh" over "powershell". At some point we can remove support for "powershell". + // + // Note, use "-Command" instead of "-File" to match the Windows implementation. Refer to + // comment on Windows implementation for an explanation why "-Command" is preferred. + let powershell = tl.tool(tl.which('pwsh') || tl.which('powershell') || tl.which('pwsh', true)) + .arg('-NoLogo') + .arg('-NoProfile') + .arg('-NonInteractive') + .arg('-ExecutionPolicy') + .arg('Unrestricted') + .arg('-Command') + .arg(`. '${filePath.replace(/'/g, "''")}'`); + + let options = { + cwd: input_workingDirectory, + failOnStdErr: false, + errStream: process.stdout, // Direct all output to STDOUT, otherwise the output may appear out + outStream: process.stdout, // of order since Node buffers it's own STDOUT but not STDERR. + ignoreReturnCode: true + }; + + // Listen for stderr. + let stderrFailure = false; + if (_vsts_input_failOnStandardError) { + powershell.on('stderr', (data) => { + stderrFailure = true; + }); + } + + // Run bash. + let exitCode: number = await powershell.exec(options); + + // Fail on exit code. + if (exitCode !== 0) { + tl.setResult(tl.TaskResult.Failed, tl.loc('JS_ExitCode', exitCode)); + } + + // Fail on stderr. + if (stderrFailure) { + tl.setResult(tl.TaskResult.Failed, tl.loc('JS_Stderr')); + } + } + catch (err) { + tl.setResult(tl.TaskResult.Failed, err.message || 'run() failed'); + } +} + +run(); diff --git a/_generated/AzurePowerShellV5/icon.png b/_generated/AzurePowerShellV5/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..039b77995289e8e4627cd9332874ef713e92c1a5 GIT binary patch literal 15348 zcmeI3Yg7|w8pj8(lwI251-b2Mh?kYcWHJc>GAE>k1c9}|1cC)D>M$8#Fv*0>00HHq zRxRLKbx)7BD?(j#SFE_8QnY7RyVZ4DwcSd!R%i<@ZFOa(TF|;~4?B}Uc)2<4o_?I1 z6XxN4|NrNC=l5PRU#7~CoZ#ydmEyi$ zclUQ{At-tgX-a3(_0OX?WtC!PDw~ixt#(!cLF#9nb_`!jFrsWCm$b!*``$h+7Ln!{ z@e4}5OmEi`d1PX#gGen+HsPgfag|y8tj0&}MA-yZg26;itHnm6&KR*PFUrPTGb|Rl zB+S|vaV%F*l&&|3w3LGoDW#DT98pAzqEu2usfw0IED_0NNF*#%!AOKehM+PPDnmp= zAF;-Vjnocv4w|A{I#iDRFGiflFm@D%i;Ih;#R@6q$b}J=N(Ia0uv{)-6%x9{#$Zl~ zjh^pLGMq<8(71!NGbCjbae1+9s*s5hi@8Fc&(M8Y?Vdt5dWaoM5q4sB7?H~0iA-kP zH>6tPh#cXV0S;iq4}ZDe38+v@km-dcCLigyXeZCoD}f@kK0x zA*2&JX;X=vfKv#XDsPa{$V*IoKU!#u)4eWdXH79y5;SP!21` zXh5fdj4PE$((DQ?0ah-%eqE4bE)|!mNfzwT=wS;~cV)|L+94^8@zDYZT`Zw#RKKcPf`^ z@+35s!xUoCH8_8(oL&e5411|3D zbsr0<>|+9p5I?U>M*F_{tQ7&5vi3iv^H z&7-@OeOzFlRAA4e%IGQfY=oaU7`daLI5C(`C<4;pjRjo1h(LjW3#7pt3%Ga@fdT;+ zNP{;PaPcAn1p+RR25&6j;za}s1Y95u-dMoJiwG15xIh}bv4D#g5hxIFfi!qy0T(YK zP$1v}Y4FAZE?z{SK)?mk;Ee@byof-7fD5F-8wcoBgD0T)PvHx_X5A_4^hE|3Oq{8(H*BQO6EHujCbV)oU( z?()EN_O(C}o|vMCpwfj9RJjR)9uBhCTM$$zgP?z{fgp4b1kIy%tv0(XJ z>%F_P66YA_oF9DfLGQ)hrp)dHVp+=0w*xk0WEk&%AOEp-Y5W|M4kk^eHPejnLxX?+ z!g!I%FvqX|^319RLs;8uyG~|ii)&I2bu=AQ98=KiypJ$h#h=x0Rll;EzB5?dr+TnA z@UH>yo{p%lu;365{Wovw>iYq|y~AuNO1mFak`?s3p7xAcUOQ?NZx=m(yfbEBsCs+O zGxFDS+d3tyD?Y`SOz#T%+kvEpe^kp~y3yW#Ze4|MSNvPu*DgQ3{=2N)B)_wR(0lqD z`Hf$96rK0|<|=jVUjC-EvKbe=D&w|Rnl^MXhpYXH^4?GC={#|=wYFex_gAG~8c#<< zmS2Bq&wsu0LNeK4*xf<(gygSyYFki!oBqP!n|o3#R(A}nipA@yrfi))PjSvKw5cd> zy755QZ$1nde6u6HFYQwQwC&ScdXL}DtI534o^hwED@+`F<;CEG8DYugDFv2 zd>n>7I(zd`@Sm^xW!~C(>7sLGV+U1#F?dQsWy_NA#Z@hHzqsx5>iKX@#)7u)U4KG0 zC)B-TZ_C&mcu@5czTekNA-#KqR0sKAYeqJo53k#xQp#V1H8UfOnmAmecJ2?V+P57c``M zuX^#Xrp5)A#u_*F+j4u1!o z{r3lkKy2GPncWqK_xyc(Pwg4M2)G4rNi=-_*_nMyr|ZiW?TxIic}={e=fhdwHZHnf zW~fhSdoehnynM&ry0Bls{fl?cAMmSWfd(*+{7Y^)L z94m?|yR@v~bmrYxpR^7%`=8J$L$|etp37cQed=CFM`P%_H|rB5>pwqo^x^*I<6nHT zj)~N)GFHVk)4F}N&)u%cefgLE+y7bm-nF`q0?t%C^$iYfJAwV)P?g`xy_cI5pR8+& HTeI + + + + + + + + + + + + + + + + + + + diff --git a/_generated/AzurePowerShellV5/make.json b/_generated/AzurePowerShellV5/make.json new file mode 100644 index 000000000000..6f84ab04b3b0 --- /dev/null +++ b/_generated/AzurePowerShellV5/make.json @@ -0,0 +1,50 @@ +{ + "rm": [ + { + "items": [ + "node_modules/https-proxy-agent/node_modules/agent-base", + "node_modules/azure-pipelines-tasks-azure-arm-rest/node_modules/azure-pipelines-task-lib" + ], + "options": "-Rf" + } + ], + "common": [ + { + "module": "../Common/VstsAzureHelpers_", + "type": "ps" + }, + { + "module": "../Common/TlsHelper_", + "type": "ps" + } + ], + "externals": { + "nugetv2": [ + { + "name": "VstsTaskSdk", + "version": "0.11.0", + "repository": "https://www.powershellgallery.com/api/v2/", + "cp": [ + { + "source": [ + "*.dll", + "*.ps1", + "*.psd1", + "*.psm1", + "lib.json", + "Strings" + ], + "dest": "ps_modules/VstsTaskSdk/", + "options": "-R" + } + ] + } + ], + "archivePackages": [ + { + "url": "https://vstsagenttools.blob.core.windows.net/tools/7zip/4/7zip.zip", + "dest": "./" + } + ] + } +} diff --git a/_generated/AzurePowerShellV5/package-lock.json b/_generated/AzurePowerShellV5/package-lock.json new file mode 100644 index 000000000000..ab4ddb83aeb0 --- /dev/null +++ b/_generated/AzurePowerShellV5/package-lock.json @@ -0,0 +1,859 @@ +{ + "name": "azure-powershell-v5", + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@azure/msal-common": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-9.1.1.tgz", + "integrity": "sha512-we9xR8lvu47fF0h+J8KyXoRy9+G/fPzm3QEa2TrdR3jaVS3LKAyE2qyMuUkNdbVkvzl8Zr9f7l+IUSP22HeqXw==" + }, + "@azure/msal-node": { + "version": "1.14.5", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.14.5.tgz", + "integrity": "sha512-NcVdMfn8Z3ogN+9RjOSF7uwf2Gki5DEJl0BdDSL83KUAgVAobtkZi5W8EqxbJLrTO/ET0jv5DregrcR5qg2pEA==", + "requires": { + "@azure/msal-common": "^9.0.1", + "jsonwebtoken": "^8.5.1", + "uuid": "^8.3.0" + }, + "dependencies": { + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + } + } + }, + "@types/concat-stream": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.1.tgz", + "integrity": "sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==", + "requires": { + "@types/node": "*" + } + }, + "@types/form-data": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", + "integrity": "sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==", + "requires": { + "@types/node": "*" + } + }, + "@types/jsonwebtoken": { + "version": "8.5.9", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.9.tgz", + "integrity": "sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg==", + "requires": { + "@types/node": "*" + } + }, + "@types/mocha": { + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", + "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==" + }, + "@types/node": { + "version": "16.18.39", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.39.tgz", + "integrity": "sha512-8q9ZexmdYYyc5/cfujaXb4YOucpQxAV4RMG0himLyDUOEr8Mr79VrqsFI+cQ2M2h89YIuy95lbxuYjxT4Hk4kQ==" + }, + "@types/q": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.0.7.tgz", + "integrity": "sha512-0WS7XU7sXzQ7J1nbnMKKYdjrrFoO3YtZYgUzeV8JFXffPnHfvSJQleR70I8BOAsOm14i4dyaAZ3YzqIl1YhkXQ==" + }, + "@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + }, + "@types/semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ==" + }, + "@types/uuid": { + "version": "3.4.10", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.10.tgz", + "integrity": "sha512-BgeaZuElf7DEYZhWYDTc/XcLZXdVgFkVSTa13BqKvbnmUrxr3TJFKofUxCtDO9UQOdhnV+HPOESdHiHKZOJV1A==" + }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "requires": { + "debug": "4" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==" + }, + "async-mutex": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.4.0.tgz", + "integrity": "sha512-eJFZ1YhRR8UN8eBLoNzcDPcy/jqjsg6I1AP+KvWQX80BqOSW1oJPJXDylPUEeMr2ZQvHgnQ//Lp6f3RQ1zI7HA==", + "requires": { + "tslib": "^2.4.0" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "azure-devops-node-api": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-12.1.0.tgz", + "integrity": "sha512-VY+G45eNKVJfMIO0uyZfbi4PzUR8JHEfsHQjEUAXUGRkYhhBbhGHjy8cpiyYFxLXc3a4PL5cqgqqV/YD1SaCXg==", + "requires": { + "tunnel": "0.0.6", + "typed-rest-client": "^1.8.4" + } + }, + "azure-pipelines-task-lib": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-4.4.0.tgz", + "integrity": "sha512-JgtxfjxjRA+KWY0Q5UC1fo48nkbVxFHgKEuasKdJMSNxHydOyNlB5MNw4UTiTXp9b0nnqKeOQOBn5RN3go3aPg==", + "requires": { + "minimatch": "3.0.5", + "mockery": "^2.1.0", + "q": "^1.5.1", + "semver": "^5.1.0", + "shelljs": "^0.8.5", + "sync-request": "6.1.0", + "uuid": "^3.0.1" + } + }, + "azure-pipelines-tasks-azure-arm-rest": { + "version": "3.225.1", + "resolved": "https://registry.npmjs.org/azure-pipelines-tasks-azure-arm-rest/-/azure-pipelines-tasks-azure-arm-rest-3.225.1.tgz", + "integrity": "sha512-fbRcoYKEbFj2jslocX4wV0hbnN/9ZGepdzcLI+5vdOkGcKNIdOctUNvggrN1KFg9nH+NoxK1pE4+kl316VVpMA==", + "requires": { + "@azure/msal-node": "1.14.5", + "@types/jsonwebtoken": "^8.5.8", + "@types/mocha": "^5.2.7", + "@types/node": "^10.17.0", + "@types/q": "1.5.4", + "async-mutex": "^0.4.0", + "azure-devops-node-api": "^12.0.0", + "azure-pipelines-task-lib": "^3.4.0", + "https-proxy-agent": "^4.0.0", + "jsonwebtoken": "^8.5.1", + "node-fetch": "^2.6.7", + "q": "1.5.1", + "typed-rest-client": "1.8.4", + "xml2js": "0.4.13" + }, + "dependencies": { + "@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + }, + "@types/q": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.4.tgz", + "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==" + }, + "azure-pipelines-task-lib": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-3.4.0.tgz", + "integrity": "sha512-3eC4OTFw+7xD7A2aUhxR/j+jRlTI+vVfS0CGxt1pCLs4c/KmY0tQWgbqjD3157kmiucWxELBvgZHaD2gCBe9fg==", + "requires": { + "minimatch": "3.0.5", + "mockery": "^2.1.0", + "q": "^1.5.1", + "semver": "^5.1.0", + "shelljs": "^0.8.5", + "sync-request": "6.1.0", + "uuid": "^3.0.1" + } + } + } + }, + "azure-pipelines-tasks-utility-common": { + "version": "3.225.0", + "resolved": "https://registry.npmjs.org/azure-pipelines-tasks-utility-common/-/azure-pipelines-tasks-utility-common-3.225.0.tgz", + "integrity": "sha512-Na7g1+zcsQpYogyex457QT6o9EB2+WQYwLUXPiszhTdf83hKJUmDMqvl2qm/mHqYuP1zg5KkRfJaPy4/09M8pA==", + "requires": { + "@types/node": "^16.11.39", + "azure-pipelines-task-lib": "^4.4.0", + "azure-pipelines-tool-lib": "^2.0.0-preview", + "js-yaml": "3.13.1", + "semver": "^5.4.1" + } + }, + "azure-pipelines-tool-lib": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/azure-pipelines-tool-lib/-/azure-pipelines-tool-lib-2.0.4.tgz", + "integrity": "sha512-LgAelZKJe3k/t3NsKSKzjeRviphns0w0p5tgwz8uHN70I9m2TToiOKl+fogrdXcM6+jiLBk5KTqrcRBqPpv/XA==", + "requires": { + "@types/semver": "^5.3.0", + "@types/uuid": "^3.4.5", + "azure-pipelines-task-lib": "^4.1.0", + "semver": "^5.7.0", + "semver-compare": "^1.0.0", + "typed-rest-client": "^1.8.6", + "uuid": "^3.3.2" + }, + "dependencies": { + "typed-rest-client": { + "version": "1.8.11", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.11.tgz", + "integrity": "sha512-5UvfMpd1oelmUPRbbaVnq+rHP7ng2cE4qoQkQeAqxRL6PklkxsM0g32/HL0yfvruK6ojQ5x8EE+HF4YV6DtuCA==", + "requires": { + "qs": "^6.9.1", + "tunnel": "0.0.6", + "underscore": "^1.12.1" + } + } + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" + }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, + "form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + } + }, + "get-port": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", + "integrity": "sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg==" + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "dependencies": { + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==" + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "http-basic": { + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-8.1.3.tgz", + "integrity": "sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw==", + "requires": { + "caseless": "^0.12.0", + "concat-stream": "^1.6.2", + "http-response-object": "^3.0.1", + "parse-cache-control": "^1.0.1" + } + }, + "http-response-object": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz", + "integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==", + "requires": { + "@types/node": "^10.0.3" + }, + "dependencies": { + "@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + } + } + }, + "https-proxy-agent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz", + "integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==", + "requires": { + "agent-base": "5", + "debug": "4" + }, + "dependencies": { + "agent-base": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", + "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==" + } + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" + }, + "is-core-module": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", + "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", + "requires": { + "has": "^1.0.3" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsonwebtoken": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "requires": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + } + }, + "jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, + "minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "mockery": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mockery/-/mockery-2.1.0.tgz", + "integrity": "sha512-9VkOmxKlWXoDO/h1jDZaS4lH33aWfRiJiNT/tKj+8OGzrcFDLo8d0syGdbsc3Bc4GvRXPb+NMMvojotmuGJTvA==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node-fetch": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", + "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "requires": { + "wrappy": "1" + } + }, + "parse-cache-control": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", + "integrity": "sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg==" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "promise": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", + "integrity": "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==", + "requires": { + "asap": "~2.0.6" + } + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==" + }, + "qs": { + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", + "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", + "requires": { + "side-channel": "^1.0.4" + } + }, + "readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "requires": { + "resolve": "^1.1.6" + } + }, + "resolve": { + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "requires": { + "is-core-module": "^2.11.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + }, + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" + }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==" + }, + "shelljs": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + }, + "sync-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-6.1.0.tgz", + "integrity": "sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw==", + "requires": { + "http-response-object": "^3.0.1", + "sync-rpc": "^1.2.1", + "then-request": "^6.0.0" + } + }, + "sync-rpc": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/sync-rpc/-/sync-rpc-1.3.6.tgz", + "integrity": "sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw==", + "requires": { + "get-port": "^3.1.0" + } + }, + "then-request": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/then-request/-/then-request-6.0.2.tgz", + "integrity": "sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA==", + "requires": { + "@types/concat-stream": "^1.6.0", + "@types/form-data": "0.0.33", + "@types/node": "^8.0.0", + "@types/qs": "^6.2.31", + "caseless": "~0.12.0", + "concat-stream": "^1.6.0", + "form-data": "^2.2.0", + "http-basic": "^8.1.1", + "http-response-object": "^3.0.1", + "promise": "^8.0.0", + "qs": "^6.4.0" + }, + "dependencies": { + "@types/node": { + "version": "8.10.66", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz", + "integrity": "sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==" + } + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "tslib": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.1.tgz", + "integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==" + }, + "tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" + }, + "typed-rest-client": { + "version": "1.8.4", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.4.tgz", + "integrity": "sha512-MyfKKYzk3I6/QQp6e1T50py4qg+c+9BzOEl2rBmQIpStwNUoqQ73An+Tkfy9YuV7O+o2mpVVJpe+fH//POZkbg==", + "requires": { + "qs": "^6.9.1", + "tunnel": "0.0.6", + "underscore": "^1.12.1" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + }, + "typescript": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", + "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", + "dev": true + }, + "underscore": { + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", + "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "xml2js": { + "version": "0.4.13", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.13.tgz", + "integrity": "sha512-BoxD65qWA2p4znzbaati/Td19uFEc0X6ydj0bFphJO62RrNaGqOyW6ljLWPo3GKDbvW/6dnxAoRX01BsgEWsMA==", + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": ">=2.4.6" + } + }, + "xmlbuilder": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", + "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==" + } + } +} diff --git a/_generated/AzurePowerShellV5/package.json b/_generated/AzurePowerShellV5/package.json new file mode 100644 index 000000000000..df70454a2343 --- /dev/null +++ b/_generated/AzurePowerShellV5/package.json @@ -0,0 +1,18 @@ +{ + "name": "azure-powershell-v5", + "author": { + "name": "Microsoft Corporation" + }, + "dependencies": { + "@types/mocha": "^5.2.7", + "@types/node": "^16.11.39", + "@types/q": "1.0.7", + "agent-base": "6.0.2", + "azure-pipelines-task-lib": "^4.4.0", + "azure-pipelines-tasks-azure-arm-rest": "^3.225.1", + "azure-pipelines-tasks-utility-common": "^3.225.0" + }, + "devDependencies": { + "typescript": "4.0.2" + } +} diff --git a/_generated/AzurePowerShellV5/task.json b/_generated/AzurePowerShellV5/task.json new file mode 100644 index 000000000000..1c64fbea9257 --- /dev/null +++ b/_generated/AzurePowerShellV5/task.json @@ -0,0 +1,210 @@ +{ + "id": "72A1931B-EFFB-4D2E-8FD8-F8472A07CB62", + "name": "AzurePowerShell", + "friendlyName": "Azure PowerShell", + "description": "Run a PowerShell script within an Azure environment", + "helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?LinkID=613749)", + "helpUrl": "https://aka.ms/azurepowershelltroubleshooting", + "category": "Deploy", + "visibility": [ + "Build", + "Release" + ], + "runsOn": [ + "Agent", + "DeploymentGroup" + ], + "author": "Microsoft Corporation", + "version": { + "Major": 5, + "Minor": 234, + "Patch": 0 + }, + "releaseNotes": "Added support for Az Module and cross platform agents.", + "groups": [ + { + "name": "AzurePowerShellVersionOptions", + "displayName": "Azure PowerShell version options", + "isExpanded": true + }, + { + "name": "advanced", + "displayName": "Advanced", + "isExpanded": false + } + ], + "minimumAgentVersion": "2.115.0", + "inputs": [ + { + "name": "ConnectedServiceNameARM", + "aliases": [ + "azureSubscription" + ], + "type": "connectedService:AzureRM", + "label": "Azure Subscription", + "defaultValue": "", + "required": true, + "helpMarkDown": "Azure Resource Manager subscription to configure before running PowerShell", + "properties": { + "EndpointFilterRule": "ScopeLevel != AzureMLWorkspace" + } + }, + { + "name": "ScriptType", + "type": "radio", + "label": "Script Type", + "required": false, + "helpMarkDown": "Type of the script: File Path or Inline Script", + "defaultValue": "FilePath", + "options": { + "FilePath": "Script File Path", + "InlineScript": "Inline Script" + } + }, + { + "name": "ScriptPath", + "type": "filePath", + "label": "Script Path", + "defaultValue": "", + "required": false, + "helpMarkDown": "Path of the script. Should be fully qualified path or relative to the default working directory.", + "visibleRule": "ScriptType = FilePath" + }, + { + "name": "Inline", + "type": "multiLine", + "label": "Inline Script", + "required": false, + "defaultValue": "# You can write your azure powershell scripts inline here. \n# You can also pass predefined and custom variables to this script using arguments", + "helpMarkDown": "Enter the script to execute.", + "visibleRule": "ScriptType = InlineScript", + "properties": { + "resizable": "true", + "rows": "10", + "maxLength": "5000" + } + }, + { + "name": "ScriptArguments", + "type": "string", + "label": "Script Arguments", + "defaultValue": "", + "visibleRule": "ScriptType = FilePath", + "required": false, + "properties": { + "editorExtension": "ms.vss-services-azure.parameters-grid" + }, + "helpMarkDown": "Additional parameters to pass to PowerShell. Can be either ordinal or named parameters." + }, + { + "name": "errorActionPreference", + "type": "pickList", + "label": "ErrorActionPreference", + "required": false, + "defaultValue": "stop", + "options": { + "stop": "Stop", + "continue": "Continue", + "silentlyContinue": "SilentlyContinue" + }, + "helpMarkDown": "Select the value of the ErrorActionPreference variable for executing the script." + }, + { + "name": "FailOnStandardError", + "type": "boolean", + "label": "Fail on Standard Error", + "required": false, + "defaultValue": "false", + "helpMarkDown": "If this is true, this task will fail if any errors are written to the error pipeline, or if any data is written to the Standard Error stream." + }, + { + "name": "TargetAzurePs", + "aliases": [ + "azurePowerShellVersion" + ], + "type": "radio", + "label": "Azure PowerShell Version", + "defaultValue": "OtherVersion", + "required": false, + "options": { + "LatestVersion": "Latest installed version", + "OtherVersion": "Specify other version" + }, + "groupName": "AzurePowerShellVersionOptions", + "helpMarkDown": "In case of hosted agents, the supported Azure PowerShell Version is: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0 (Hosted VS2017 Queue).\nTo pick the latest version available on the agent, select \"Latest installed version\".\n\nFor private agents you can specify preferred version of Azure PowerShell using \"Specify version\"" + }, + { + "name": "CustomTargetAzurePs", + "aliases": [ + "preferredAzurePowerShellVersion" + ], + "type": "string", + "label": "Preferred Azure PowerShell Version", + "defaultValue": "", + "required": true, + "visibleRule": "TargetAzurePs = OtherVersion", + "groupName": "AzurePowerShellVersionOptions", + "helpMarkDown": "Preferred Azure PowerShell Version needs to be a proper semantic version eg. 1.2.3. Regex like 2.\\*,2.3.\\* is not supported. The Hosted VS2017 Pool currently supports Az module version: 1.0.0, 1.6.0, 2.3.2, 2.6.0, 3.1.0" + }, + { + "name": "pwsh", + "type": "boolean", + "label": "Use PowerShell Core", + "required": false, + "defaultValue": "false", + "helpMarkDown": "If this is true, then on Windows the task will use pwsh.exe from your PATH instead of powershell.exe.", + "groupName": "advanced" + }, + { + "name": "validateScriptSignature", + "type": "boolean", + "label": "Validate script signature", + "required": false, + "defaultValue": "false", + "helpMarkDown": "If this is true, then the task will first check to make sure specified script is signed and valid before executing it.", + "groupName": "advanced", + "visibleRule": "ScriptType = FilePath" + }, + { + "name": "workingDirectory", + "type": "filePath", + "label": "Working Directory", + "required": false, + "defaultValue": "", + "helpMarkDown": "Working directory where the script is run.", + "groupName": "advanced" + } + ], + "instanceNameFormat": "Azure PowerShell script: $(ScriptType)", + "execution": { + "PowerShell3": { + "target": "azurepowershell.ps1", + "platforms": [ + "windows" + ] + }, + "Node10": { + "target": "azurepowershell.js", + "argumentFormat": "" + }, + "Node16": { + "target": "azurepowershell.js", + "argumentFormat": "" + } + }, + "messages": { + "GeneratingScript": "Generating script.", + "JS_FormattedCommand": "Formatted command: %s", + "InvalidScriptArguments0": "Invalid script arguments '{0}'. Line breaks are not allowed.", + "InvalidScriptPath0": "Invalid script path '{0}'. Invalid path characters specified.", + "InvalidAzurePsVersion": "The Azure PowerShell version '{0}' specified is not in the correct format. Please check the format. An example of correct format is 1.0.1", + "JS_ExitCode": "PowerShell exited with code '%s'.", + "JS_Stderr": "PowerShell wrote one or more lines to the standard error stream.", + "ExpiredServicePrincipal": "Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired.", + "PS_ExitCode": "PowerShell exited with code '{0}'." + }, + "_buildConfigMapping": { + "Default": "5.234.0", + "Node20_229_2": "5.234.1" + } +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/task.loc.json b/_generated/AzurePowerShellV5/task.loc.json new file mode 100644 index 000000000000..ba16ddbc27ad --- /dev/null +++ b/_generated/AzurePowerShellV5/task.loc.json @@ -0,0 +1,210 @@ +{ + "id": "72A1931B-EFFB-4D2E-8FD8-F8472A07CB62", + "name": "AzurePowerShell", + "friendlyName": "ms-resource:loc.friendlyName", + "description": "ms-resource:loc.description", + "helpMarkDown": "ms-resource:loc.helpMarkDown", + "helpUrl": "https://aka.ms/azurepowershelltroubleshooting", + "category": "Deploy", + "visibility": [ + "Build", + "Release" + ], + "runsOn": [ + "Agent", + "DeploymentGroup" + ], + "author": "Microsoft Corporation", + "version": { + "Major": 5, + "Minor": 234, + "Patch": 0 + }, + "releaseNotes": "ms-resource:loc.releaseNotes", + "groups": [ + { + "name": "AzurePowerShellVersionOptions", + "displayName": "ms-resource:loc.group.displayName.AzurePowerShellVersionOptions", + "isExpanded": true + }, + { + "name": "advanced", + "displayName": "ms-resource:loc.group.displayName.advanced", + "isExpanded": false + } + ], + "minimumAgentVersion": "2.115.0", + "inputs": [ + { + "name": "ConnectedServiceNameARM", + "aliases": [ + "azureSubscription" + ], + "type": "connectedService:AzureRM", + "label": "ms-resource:loc.input.label.ConnectedServiceNameARM", + "defaultValue": "", + "required": true, + "helpMarkDown": "ms-resource:loc.input.help.ConnectedServiceNameARM", + "properties": { + "EndpointFilterRule": "ScopeLevel != AzureMLWorkspace" + } + }, + { + "name": "ScriptType", + "type": "radio", + "label": "ms-resource:loc.input.label.ScriptType", + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.ScriptType", + "defaultValue": "FilePath", + "options": { + "FilePath": "Script File Path", + "InlineScript": "Inline Script" + } + }, + { + "name": "ScriptPath", + "type": "filePath", + "label": "ms-resource:loc.input.label.ScriptPath", + "defaultValue": "", + "required": false, + "helpMarkDown": "ms-resource:loc.input.help.ScriptPath", + "visibleRule": "ScriptType = FilePath" + }, + { + "name": "Inline", + "type": "multiLine", + "label": "ms-resource:loc.input.label.Inline", + "required": false, + "defaultValue": "# You can write your azure powershell scripts inline here. \n# You can also pass predefined and custom variables to this script using arguments", + "helpMarkDown": "ms-resource:loc.input.help.Inline", + "visibleRule": "ScriptType = InlineScript", + "properties": { + "resizable": "true", + "rows": "10", + "maxLength": "5000" + } + }, + { + "name": "ScriptArguments", + "type": "string", + "label": "ms-resource:loc.input.label.ScriptArguments", + "defaultValue": "", + "visibleRule": "ScriptType = FilePath", + "required": false, + "properties": { + "editorExtension": "ms.vss-services-azure.parameters-grid" + }, + "helpMarkDown": "ms-resource:loc.input.help.ScriptArguments" + }, + { + "name": "errorActionPreference", + "type": "pickList", + "label": "ms-resource:loc.input.label.errorActionPreference", + "required": false, + "defaultValue": "stop", + "options": { + "stop": "Stop", + "continue": "Continue", + "silentlyContinue": "SilentlyContinue" + }, + "helpMarkDown": "ms-resource:loc.input.help.errorActionPreference" + }, + { + "name": "FailOnStandardError", + "type": "boolean", + "label": "ms-resource:loc.input.label.FailOnStandardError", + "required": false, + "defaultValue": "false", + "helpMarkDown": "ms-resource:loc.input.help.FailOnStandardError" + }, + { + "name": "TargetAzurePs", + "aliases": [ + "azurePowerShellVersion" + ], + "type": "radio", + "label": "ms-resource:loc.input.label.TargetAzurePs", + "defaultValue": "OtherVersion", + "required": false, + "options": { + "LatestVersion": "Latest installed version", + "OtherVersion": "Specify other version" + }, + "groupName": "AzurePowerShellVersionOptions", + "helpMarkDown": "ms-resource:loc.input.help.TargetAzurePs" + }, + { + "name": "CustomTargetAzurePs", + "aliases": [ + "preferredAzurePowerShellVersion" + ], + "type": "string", + "label": "ms-resource:loc.input.label.CustomTargetAzurePs", + "defaultValue": "", + "required": true, + "visibleRule": "TargetAzurePs = OtherVersion", + "groupName": "AzurePowerShellVersionOptions", + "helpMarkDown": "ms-resource:loc.input.help.CustomTargetAzurePs" + }, + { + "name": "pwsh", + "type": "boolean", + "label": "ms-resource:loc.input.label.pwsh", + "required": false, + "defaultValue": "false", + "helpMarkDown": "ms-resource:loc.input.help.pwsh", + "groupName": "advanced" + }, + { + "name": "validateScriptSignature", + "type": "boolean", + "label": "ms-resource:loc.input.label.validateScriptSignature", + "required": false, + "defaultValue": "false", + "helpMarkDown": "ms-resource:loc.input.help.validateScriptSignature", + "groupName": "advanced", + "visibleRule": "ScriptType = FilePath" + }, + { + "name": "workingDirectory", + "type": "filePath", + "label": "ms-resource:loc.input.label.workingDirectory", + "required": false, + "defaultValue": "", + "helpMarkDown": "ms-resource:loc.input.help.workingDirectory", + "groupName": "advanced" + } + ], + "instanceNameFormat": "ms-resource:loc.instanceNameFormat", + "execution": { + "PowerShell3": { + "target": "azurepowershell.ps1", + "platforms": [ + "windows" + ] + }, + "Node10": { + "target": "azurepowershell.js", + "argumentFormat": "" + }, + "Node16": { + "target": "azurepowershell.js", + "argumentFormat": "" + } + }, + "messages": { + "GeneratingScript": "ms-resource:loc.messages.GeneratingScript", + "JS_FormattedCommand": "ms-resource:loc.messages.JS_FormattedCommand", + "InvalidScriptArguments0": "ms-resource:loc.messages.InvalidScriptArguments0", + "InvalidScriptPath0": "ms-resource:loc.messages.InvalidScriptPath0", + "InvalidAzurePsVersion": "ms-resource:loc.messages.InvalidAzurePsVersion", + "JS_ExitCode": "ms-resource:loc.messages.JS_ExitCode", + "JS_Stderr": "ms-resource:loc.messages.JS_Stderr", + "ExpiredServicePrincipal": "ms-resource:loc.messages.ExpiredServicePrincipal", + "PS_ExitCode": "ms-resource:loc.messages.PS_ExitCode" + }, + "_buildConfigMapping": { + "Default": "5.234.0", + "Node20_229_2": "5.234.1" + } +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5/tsconfig.json b/_generated/AzurePowerShellV5/tsconfig.json new file mode 100644 index 000000000000..6a07b24acf54 --- /dev/null +++ b/_generated/AzurePowerShellV5/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "target": "ES6", + "module": "commonjs", + "skipLibCheck": true + } +} \ No newline at end of file diff --git a/_generated/AzurePowerShellV5_Node20/task.json b/_generated/AzurePowerShellV5_Node20/task.json index 21c03050df4a..336a3f181f8c 100644 --- a/_generated/AzurePowerShellV5_Node20/task.json +++ b/_generated/AzurePowerShellV5_Node20/task.json @@ -17,8 +17,8 @@ "author": "Microsoft Corporation", "version": { "Major": 5, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 1 }, "releaseNotes": "Added support for Az Module and cross platform agents.", "groups": [ @@ -208,7 +208,7 @@ "PS_ExitCode": "PowerShell exited with code '{0}'." }, "_buildConfigMapping": { - "Default": "5.231.0", - "Node20_229_2": "5.231.2" + "Default": "5.234.0", + "Node20_229_2": "5.234.1" } } \ No newline at end of file diff --git a/_generated/AzurePowerShellV5_Node20/task.loc.json b/_generated/AzurePowerShellV5_Node20/task.loc.json index 602775cf5b7c..0a53c9f811c6 100644 --- a/_generated/AzurePowerShellV5_Node20/task.loc.json +++ b/_generated/AzurePowerShellV5_Node20/task.loc.json @@ -17,8 +17,8 @@ "author": "Microsoft Corporation", "version": { "Major": 5, - "Minor": 231, - "Patch": 2 + "Minor": 234, + "Patch": 1 }, "releaseNotes": "ms-resource:loc.releaseNotes", "groups": [ @@ -208,7 +208,7 @@ "PS_ExitCode": "ms-resource:loc.messages.PS_ExitCode" }, "_buildConfigMapping": { - "Default": "5.231.0", - "Node20_229_2": "5.231.2" + "Default": "5.234.0", + "Node20_229_2": "5.234.1" } } \ No newline at end of file From bd56f6d8ab711f4d83e860a879e12ce02944d6e0 Mon Sep 17 00:00:00 2001 From: Nikita Shkarupa Date: Mon, 22 Jan 2024 05:02:12 +0100 Subject: [PATCH 8/9] Fix typo --- Tasks/AzureFileCopyV4/AzureUtilityARM.ps1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Tasks/AzureFileCopyV4/AzureUtilityARM.ps1 b/Tasks/AzureFileCopyV4/AzureUtilityARM.ps1 index cfb062ca9815..4313603a7bbf 100644 --- a/Tasks/AzureFileCopyV4/AzureUtilityARM.ps1 +++ b/Tasks/AzureFileCopyV4/AzureUtilityARM.ps1 @@ -320,13 +320,12 @@ function Set-AzureMachineCustomScriptExtension Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" if ($featureFlags.retireAzureRM) { - $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose } else { $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose - } - $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { From f73c6d086320f40bc17fde3d8cdb0c282eb1844b Mon Sep 17 00:00:00 2001 From: Nikita Shkarupa Date: Mon, 22 Jan 2024 05:05:45 +0100 Subject: [PATCH 9/9] Update genearated task --- _generated/AzureFileCopyV4/AzureUtilityARM.ps1 | 5 ++--- _generated/AzureFileCopyV4_Node20/AzureUtilityARM.ps1 | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/_generated/AzureFileCopyV4/AzureUtilityARM.ps1 b/_generated/AzureFileCopyV4/AzureUtilityARM.ps1 index cfb062ca9815..4313603a7bbf 100644 --- a/_generated/AzureFileCopyV4/AzureUtilityARM.ps1 +++ b/_generated/AzureFileCopyV4/AzureUtilityARM.ps1 @@ -320,13 +320,12 @@ function Set-AzureMachineCustomScriptExtension Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" if ($featureFlags.retireAzureRM) { - $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose } else { $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose - } - $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) { diff --git a/_generated/AzureFileCopyV4_Node20/AzureUtilityARM.ps1 b/_generated/AzureFileCopyV4_Node20/AzureUtilityARM.ps1 index cfb062ca9815..4313603a7bbf 100644 --- a/_generated/AzureFileCopyV4_Node20/AzureUtilityARM.ps1 +++ b/_generated/AzureFileCopyV4_Node20/AzureUtilityARM.ps1 @@ -320,13 +320,12 @@ function Set-AzureMachineCustomScriptExtension Write-Verbose "Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose" if ($featureFlags.retireAzureRM) { - $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location + $result = Set-AzVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose } else { $result = Set-AzureRmVMCustomScriptExtension -ResourceGroupName $resourceGroupName -VMName $vmName -Name $name -FileUri $fileUri -Run $run -Argument $argument -Location $location -ErrorAction Stop -Verbose - } - $location -ErrorAction Stop -Verbose + } Write-Host (Get-VstsLocString -Key "AFC_SetCustomScriptExtensionComplete" -ArgumentList $name, $vmName) if($result.IsSuccessStatusCode -eq $true) {