Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $SubscriptionName = "<Azure subscription name>"
- $ResourceGroupName = "<Azure resource group name>"
- # Data factory name. Must be globally unique
- $DataFactoryName = "<Data factory name>"
- # In public preview, only EastUS amd EastUS2 are supported.
- $DataFactoryLocation = "EastUS"
- # Azure-SSIS integration runtime information. This is a Data Factory compute resource for running SSIS packages
- $AzureSSISName = "<Specify a name for your Azure-SSIS (IR)>"
- $AzureSSISDescription = "<Specify description for your Azure-SSIS IR"
- # In public preview, only EastUS and NorthEurope are supported.
- $AzureSSISLocation = "EastUS"
- # In public preview, only Standard_A4_v2, Standard_A8_v2, Standard_D1_v2, Standard_D2_v2, Standard_D3_v2, Standard_D4_v2 are supported
- $AzureSSISNodeSize = "Standard_A4_v2"
- # In public preview, only 1-10 nodes are supported.
- $AzureSSISNodeNumber = 2
- # In public preview, only 1-8 parallel executions per node are supported.
- $AzureSSISMaxParallelExecutionsPerNode = 2
- # SSISDB info
- $SSISDBServerEndpoint = "<Azure SQL server name>.database.windows.net"
- $SSISDBServerAdminUserName = "<Azure SQL server - user name>"
- $SSISDBServerAdminPassword = "<Azure SQL server - user password>"
- # Remove the SSISDBPricingTier variable if you are using Azure SQL Managed Instance (private preview)
- # This parameter applies only to Azure SQL Database. For the basic pricing tier, specify "Basic", not "B". For standard tiers, specify "S0", "S1", "S2", 'S3", etc.
- $SSISDBPricingTier = "<pricing tier of your Azure SQL server. Examples: Basic, S0, S1, S2, S3, etc.>"
- $SSISDBConnectionString = "Data Source=" + $SSISDBServerEndpoint + ";User ID="+ $SSISDBServerAdminUserName +";Password="+ $SSISDBServerAdminPassword
- $sqlConnection = New-Object System.Data.SqlClient.SqlConnection $SSISDBConnectionString;
- Try
- {
- $sqlConnection.Open();
- }
- Catch [System.Data.SqlClient.SqlException]
- {
- Write-Warning "Cannot connect to your Azure SQL DB logical server/Azure SQL MI server, exception: $_" ;
- Write-Warning "Please make sure the server you specified has already been created. Do you want to proceed? [Y/N]"
- $yn = Read-Host
- if(!($yn -ieq "Y"))
- {
- Return;
- }
- }
- Login-AzureRmAccount
- Select-AzureRmSubscription -SubscriptionName $SubscriptionName
- Set-AzureRmDataFactoryV2 -ResourceGroupName $ResourceGroupName `
- -Location $DataFactoryLocation `
- -Name $DataFactoryName
- $secpasswd = ConvertTo-SecureString $SSISDBServerAdminPassword -AsPlainText -Force
- $serverCreds = New-Object System.Management.Automation.PSCredential($SSISDBServerAdminUserName, $secpasswd)
- Set-AzureRmDataFactoryV2IntegrationRuntime -ResourceGroupName $ResourceGroupName `
- -DataFactoryName $DataFactoryName `
- -Name $AzureSSISName `
- -Type Managed `
- -CatalogServerEndpoint $SSISDBServerEndpoint `
- -CatalogAdminCredential $serverCreds `
- -CatalogPricingTier $SSISDBPricingTier `
- -Description $AzureSSISDescription `
- -Location $AzureSSISLocation `
- -NodeSize $AzureSSISNodeSize `
- -NodeCount $AzureSSISNodeNumber `
- -MaxParallelExecutionsPerNode $AzureSSISMaxParallelExecutionsPerNode
- write-host("##### Starting your Azure-SSIS integration runtime. This command takes 20 to 30 minutes to complete. #####")
- Start-AzureRmDataFactoryV2IntegrationRuntime -ResourceGroupName $ResourceGroupName `
- -DataFactoryName $DataFactoryName `
- -Name $AzureSSISName `
- -Force
- write-host("##### Completed #####")
- write-host("If any cmdlet is unsuccessful, please consider using -Debug option for diagnostics.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement