Advertisement
Guest User

Untitled

a guest
Oct 6th, 2017
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.06 KB | None | 0 0
  1. $SubscriptionName = "<Azure subscription name>"
  2. $ResourceGroupName = "<Azure resource group name>"
  3. # Data factory name. Must be globally unique
  4. $DataFactoryName = "<Data factory name>"
  5. # In public preview, only EastUS amd EastUS2 are supported.
  6. $DataFactoryLocation = "EastUS"
  7.  
  8. # Azure-SSIS integration runtime information. This is a Data Factory compute resource for running SSIS packages
  9. $AzureSSISName = "<Specify a name for your Azure-SSIS (IR)>"
  10. $AzureSSISDescription = "<Specify description for your Azure-SSIS IR"
  11. # In public preview, only EastUS and NorthEurope are supported.
  12. $AzureSSISLocation = "EastUS"
  13. # In public preview, only Standard_A4_v2, Standard_A8_v2, Standard_D1_v2, Standard_D2_v2, Standard_D3_v2, Standard_D4_v2 are supported
  14. $AzureSSISNodeSize = "Standard_A4_v2"
  15. # In public preview, only 1-10 nodes are supported.
  16. $AzureSSISNodeNumber = 2
  17. # In public preview, only 1-8 parallel executions per node are supported.
  18. $AzureSSISMaxParallelExecutionsPerNode = 2
  19.  
  20. # SSISDB info
  21. $SSISDBServerEndpoint = "<Azure SQL server name>.database.windows.net"
  22. $SSISDBServerAdminUserName = "<Azure SQL server - user name>"
  23. $SSISDBServerAdminPassword = "<Azure SQL server - user password>"
  24. # Remove the SSISDBPricingTier variable if you are using Azure SQL Managed Instance (private preview)
  25. # 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.
  26. $SSISDBPricingTier = "<pricing tier of your Azure SQL server. Examples: Basic, S0, S1, S2, S3, etc.>"
  27.  
  28. $SSISDBConnectionString = "Data Source=" + $SSISDBServerEndpoint + ";User ID="+ $SSISDBServerAdminUserName +";Password="+ $SSISDBServerAdminPassword
  29. $sqlConnection = New-Object System.Data.SqlClient.SqlConnection $SSISDBConnectionString;
  30. Try
  31. {
  32. $sqlConnection.Open();
  33. }
  34. Catch [System.Data.SqlClient.SqlException]
  35. {
  36. Write-Warning "Cannot connect to your Azure SQL DB logical server/Azure SQL MI server, exception: $_" ;
  37. Write-Warning "Please make sure the server you specified has already been created. Do you want to proceed? [Y/N]"
  38. $yn = Read-Host
  39. if(!($yn -ieq "Y"))
  40. {
  41. Return;
  42. }
  43. }
  44.  
  45. Login-AzureRmAccount
  46. Select-AzureRmSubscription -SubscriptionName $SubscriptionName
  47.  
  48. Set-AzureRmDataFactoryV2 -ResourceGroupName $ResourceGroupName `
  49. -Location $DataFactoryLocation `
  50. -Name $DataFactoryName
  51.  
  52. $secpasswd = ConvertTo-SecureString $SSISDBServerAdminPassword -AsPlainText -Force
  53. $serverCreds = New-Object System.Management.Automation.PSCredential($SSISDBServerAdminUserName, $secpasswd)
  54. Set-AzureRmDataFactoryV2IntegrationRuntime -ResourceGroupName $ResourceGroupName `
  55. -DataFactoryName $DataFactoryName `
  56. -Name $AzureSSISName `
  57. -Type Managed `
  58. -CatalogServerEndpoint $SSISDBServerEndpoint `
  59. -CatalogAdminCredential $serverCreds `
  60. -CatalogPricingTier $SSISDBPricingTier `
  61. -Description $AzureSSISDescription `
  62. -Location $AzureSSISLocation `
  63. -NodeSize $AzureSSISNodeSize `
  64. -NodeCount $AzureSSISNodeNumber `
  65. -MaxParallelExecutionsPerNode $AzureSSISMaxParallelExecutionsPerNode
  66.  
  67. write-host("##### Starting your Azure-SSIS integration runtime. This command takes 20 to 30 minutes to complete. #####")
  68. Start-AzureRmDataFactoryV2IntegrationRuntime -ResourceGroupName $ResourceGroupName `
  69. -DataFactoryName $DataFactoryName `
  70. -Name $AzureSSISName `
  71. -Force
  72.  
  73. write-host("##### Completed #####")
  74. write-host("If any cmdlet is unsuccessful, please consider using -Debug option for diagnostics.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement