Skip to content

[DataFactory] Add Integration Runtime Cmdlets. #5060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Dec 5, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add integration runtime cmdlets.
  • Loading branch information
zhangyd2015 committed Nov 29, 2017
commit c15c1fca01e3d595342a2919d1125404e705a6df
4 changes: 4 additions & 0 deletions src/ResourceManager/DataFactories/AzureRM.DataFactoryV2.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ CmdletsToExport =
'Stop-AzureRmDataFactoryV2IntegrationRuntime',
'Get-AzureRmDataFactoryV2IntegrationRuntimeMetric',
'Remove-AzureRmDataFactoryV2IntegrationRuntimeNode',
'Update-AzureRmDataFactoryV2IntegrationRuntimeNode',
'Get-AzureRmDataFactoryV2IntegrationRuntimeNodeIp',
'Invoke-AzureRmDataFactoryV2IntegrationRuntimeUpgrade',
'Sync-AzureRmDataFactoryV2IntegrationRuntimeCredential',
'Update-AzureRmDataFactoryV2IntegrationRuntime',
'Get-AzureRmDataFactoryV2TriggerRun'

# Variables to export from this module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,16 @@ public void TestSelfHosedIntegrationRuntime()

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestManagedElasticIntegrationRuntime()
public void TestSsisAzureIntegrationRuntime()
{
RunPowerShellTest("Test-ManagedElastic-IntegrationRuntime");
RunPowerShellTest("Test-SsisAzure-IntegrationRuntime");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestAzureIntegrationRuntime()
{
RunPowerShellTest("Test-Azure-IntegrationRuntime");
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------------

<#
.SYNOPSIS
Creates a self-hosted integration runtime and then does operations.
Expand Down Expand Up @@ -50,21 +49,6 @@ function Test-SelfHosted-IntegrationRuntime
$expected = Get-AzureRmDataFactoryV2IntegrationRuntime -ResourceId $actual.Id
Assert-AreEqual $actual.Name $expected.Name

$key = Get-AzureRmDataFactoryV2IntegrationRuntimeKey -ResourceGroupName $rgname `
-DataFactoryName $dfname `
-Name $irname
Assert-NotNull $key
Assert-NotNull $key.AuthKey1
Assert-NotNull $key.AuthKey2

$key = New-AzureRmDataFactoryV2IntegrationRuntimeKey -ResourceGroupName $rgname `
-DataFactoryName $dfname `
-Name $irname `
-KeyName authKey1 `
-Force
Assert-NotNull $key
Assert-NotNull $key.AuthKey1

$metric = Get-AzureRmDataFactoryV2IntegrationRuntimeMetric -ResourceGroupName $rgname `
-DataFactoryName $dfname `
-Name $irname
Expand All @@ -87,10 +71,73 @@ function Test-SelfHosted-IntegrationRuntime

<#
.SYNOPSIS
Creates a managed elastic integration runtime and then does operations.
Creates a SSIS-Azure integration runtime and then does operations.
Deletes the created integration runtime at the end.

Before running this test, make sure setting the following environment variables:
CatalogServerEndpoint: The catalog server endpoint for catalog database
CatalogAdminUsername: The admin user name on this server
CatalogAdminPassword: The password of the admin user.
#>
function Test-SsisAzure-IntegrationRuntime
{
$dfname = Get-DataFactoryName
$rgname = Get-ResourceGroupName
$rglocation = Get-ProviderLocation ResourceManagement
$dflocation = Get-ProviderLocation DataFactoryManagement

New-AzureRmResourceGroup -Name $rgname -Location $rglocation -Force

try
{
Set-AzureRmDataFactoryV2 -ResourceGroupName $rgname `
-Name $dfname `
-Location $dflocation `
-Force

$irname = "ssis-azure-ir"
$description = "SSIS-Azure integration runtime"

$secpasswd = ConvertTo-SecureString $Env:CatalogAdminPassword -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential($Env:CatalogAdminUsername, $secpasswd)
$actual = Set-AzureRmDataFactoryV2IntegrationRuntime -ResourceGroupName $rgname `
-DataFactoryName $dfname `
-Name $irname `
-Description $description `
-Type Managed `
-Location 'East US' `
-NodeSize Standard_A4_v2 `
-NodeCount 1 `
-CatalogServerEndpoint $Env:CatalogServerEndpoint `
-CatalogAdminCredential $mycreds `
-CatalogPricingTier 'S1' `
-MaxParallelExecutionsPerNode 1 `
-Force

$expected = Get-AzureRmDataFactoryV2IntegrationRuntime -ResourceGroupName $rgname `
-DataFactoryName $dfname `
-Name $irname
Assert-AreEqual $actual.Name $expected.Name

Start-AzureRmDataFactoryV2IntegrationRuntime -ResourceId $actual.Id -Force
$status = Get-AzureRmDataFactoryV2IntegrationRuntime -ResourceId $actual.Id -Status
Stop-AzureRmDataFactoryV2IntegrationRuntime -ResourceId $actual.Id -Force

Start-Sleep -Seconds 15
Remove-AzureRmDataFactoryV2IntegrationRuntime -ResourceGroupName $rgname -DataFactoryName $dfname -Name $irname -Force
}
finally
{
CleanUp $rgname $dfname
}
}

<#
.SYNOPSIS
Creates an azure integration runtime and then does operations.
Deletes the created integration runtime at the end.
#>
function Test-ManagedElastic-IntegrationRuntime
function Test-Azure-IntegrationRuntime
{
$dfname = Get-DataFactoryName
$rgname = Get-ResourceGroupName
Expand Down
Loading