Unir runtime de integração do Azure-SSIS a uma rede virtual com o Azure PowerShell

APLICA-SE A: Azure Data Factory Azure Synapse Analytics

Dica

Data Factory no Microsoft Fabric é a próxima geração de Azure Data Factory, com uma arquitetura mais simples, IA interna e novos recursos. Se você não estiver familiarizado com a integração de dados, comece com Fabric Data Factory. As cargas de trabalho existentes do ADF podem ser atualizadas para Fabric para acessar novos recursos em ciência de dados, análise em tempo real e relatórios.

Este artigo mostra como unir seu IR (runtime de integração) do SSIS (SQL Server Integration Services) existente do Azure no Azure Data Factory a uma rede virtual via Azure PowerShell.

Observação

Para Azure-SSIS IR no Azure Synapse Analytics, substitua pelas interfaces do PowerShell do Azure Synapse Analytics correspondentes: Set-AzSynapseIntegrationRuntime (Az.Synapse), Start-AzSynapseIntegrationRuntime e Stop-AzSynapseIntegrationRuntime.

Criar variáveis

$ResourceGroupName = "[your Azure resource group name]"
$DataFactoryName = "[your data factory name]"
$AzureSSISName = "[your Azure-SSIS IR name]"
# Virtual network info: Azure Resource Manager or Classic
$VnetId = "[your virtual network resource ID or leave it empty]" # REQUIRED if you use Azure SQL Database server configured with a private endpoint/IP firewall rule/virtual network service endpoint or Azure SQL Managed Instance that joins a virtual network to host SSISDB, or if you require access to on-premises data without configuring a self-hosted IR. We recommend Azure Resource Manager virtual network, because classic virtual network will be deprecated soon.
$SubnetName = "[your subnet name or leave it empty]" # WARNING: Use the same subnet as the one used for Azure SQL Database server configured with a virtual network service endpoint or a different subnet from the one used for Azure SQL Managed Instance that joins a virtual network
$SubnetId = $VnetId + '/subnets/' + $SubnetName 
# Virtual network injection method: Standard or Express. For comparison, see https://learn.microsoft.com/azure/data-factory/azure-ssis-integration-runtime-virtual-network-configuration.
$VnetInjectionMethod = "Standard" # Standard by default, whereas Express lets you use the express virtual network injection method
# Public IP address info: OPTIONAL to provide two standard static public IP addresses with DNS name under the same subscription and in the same region as your virtual network
$FirstPublicIP = "[your first public IP address resource ID or leave it empty]"
$SecondPublicIP = "[your second public IP address resource ID or leave it empty]"

Obter a ID da aplicação Batch do Azure

  1. Navegue até o portal do Azure.
  2. Na barra de pesquisa, digite Microsoft Azure Batch e selecione-o na lista suspensa, em Microsoft Entra ID.
  3. Na página Lote do Microsoft Azure, anote ou copie a ID do Aplicativo para a área de transferência.
  4. No script a seguir, defina a variável $BatchApplicationId para esse valor antes de executá-la.

Configurar uma rede virtual

Para ingressar o Azure-SSIS IR em uma rede virtual, você precisará configurar a rede virtual. Para definir automaticamente as permissões e as configurações de rede virtual do Azure-SSIS IR que ingressará na rede virtual, adicione o seguinte script:

# Make sure to run this script against the subscription to which the virtual network belongs.

$BatchApplicationId = "[REPLACE_WITH_AZURE_BATCH_APP_ID]"

if(![string]::IsNullOrEmpty($VnetId) -and ![string]::IsNullOrEmpty($SubnetName))
{
    # Register to the Azure Batch resource provider
    $BatchObjectId = (Get-AzADServicePrincipal -ServicePrincipalName $BatchApplicationId).Id
    Register-AzResourceProvider -ProviderNamespace Microsoft.Batch
    while(!(Get-AzResourceProvider -ProviderNamespace "Microsoft.Batch").RegistrationState.Contains("Registered"))
    {
    Start-Sleep -s 10
    }
    if($VnetId -match "/providers/Microsoft.ClassicNetwork/")
    {
        # Assign the VM contributor role to Microsoft.Batch
        New-AzRoleAssignment -ObjectId $BatchObjectId -RoleDefinitionName "Classic Virtual Machine Contributor" -Scope $VnetId
    }
}

Criar um IR do Azure-SSIS e uni-lo a uma rede virtual

Você pode criar um IR do Azure-SSIS e uni-lo a uma rede virtual ao mesmo tempo. Para obter as instruções e o script completo, confira Criar um Azure-SSIS IR.

Unir um IR do Azure-SSIS existente a uma rede virtual

O artigo Criar um Azure-SSIS IR mostra como criar um Azure-SSIS IR e ingressá-lo em uma rede virtual no mesmo script. Se você já tem um Azure-SSIS IR, siga estas etapas para ingressá-lo em uma rede virtual:

  1. Interrompa seu Azure-SSIS IR.
  2. Configure seu Azure-SSIS IR para ingressar em uma rede virtual.
  3. Inicie seu Azure-SSIS IR.

Interrompa seu Azure-SSIS IR

Você precisará parar seu Azure-SSIS IR antes de adicioná-lo a uma rede virtual. Este comando libera todos os seus nós e interrompe a cobrança.

Stop-AzDataFactoryV2IntegrationRuntime -ResourceGroupName $ResourceGroupName `
    -DataFactoryName $DataFactoryName `
    -Name $AzureSSISName `
    -Force 

Configure seu Azure-SSIS IR para ingressar em uma rede virtual

Para ingressar o Azure-SSIS IR em uma rede virtual, execute o comando Set-AzDataFactoryV2IntegrationRuntime:

Set-AzDataFactoryV2IntegrationRuntime -ResourceGroupName $ResourceGroupName `
    -DataFactoryName $DataFactoryName `
    -Name $AzureSSISName `
    -SubnetId $SubnetId `
    -VNetInjectionMethod $VnetInjectionMethod

# Add public IP address parameters if you use the standard virtual network injection method and bring your own static public IP addresses
if($VnetInjectionMethod -eq "Standard")
{
    if(![string]::IsNullOrEmpty($FirstPublicIP) -and ![string]::IsNullOrEmpty($SecondPublicIP))
    {
        $publicIPs = @($FirstPublicIP, $SecondPublicIP)
        Set-AzDataFactoryV2IntegrationRuntime -ResourceGroupName $ResourceGroupName `
            -DataFactoryName $DataFactoryName `
            -Name $AzureSSISName `
            -PublicIPs $publicIPs
    }
}

Inicie seu Azure-SSIS IR

Para iniciar seu Azure-SSIS IR, execute os seguintes comandos:

Start-AzDataFactoryV2IntegrationRuntime -ResourceGroupName $ResourceGroupName `
    -DataFactoryName $DataFactoryName `
    -Name $AzureSSISName `
    -Force

Se você usar o método de injeção de rede virtual expressa/padrão, esse comando levará 5/20-30 minutos para ser concluído, respectivamente.

Para obter mais informações sobre o Azure-SSIS IR, confira os seguintes artigos:

  • Azure-SSIS IR. Este artigo fornece informações conceituais gerais sobre IRs, incluindo o Azure-SSIS IR.
  • Tutorial: Implantar pacotes SSIS no Azure. Este tutorial fornece instruções passo a passo sobre como criar o Azure-SSIS IR. Ele usa o servidor do Banco de Dados SQL do Azure para hospedar o SSISDB.
  • Criar um Azure-SSIS IR. Este artigo expande o tutorial. Ele fornece instruções sobre como usar o servidor do Banco de Dados SQL do Azure configurado com um ponto de extremidade de serviço de rede virtual/regra de firewall IP/ponto de extremidade privado ou uma Instância Gerenciada de SQL do Azure que se une a uma rede virtual para hospedar o SSISDB. Também mostra como unir o seu Azure-SSIS IR a uma rede virtual.
  • Monitorar um Azure-SSIS IR. Este artigo mostra como recuperar e entender as informações sobre seu Azure-SSIS IR.
  • Gerencie um Runtime de Integração (IR) do Azure-SSIS. Este artigo mostra como interromper, iniciar ou excluir um Azure-SSIS IR. Ele também mostra como escalar horizontalmente o IR do Azure-SSIS adicionando mais nós.