Azure / bicep

Bicep is a declarative language for describing and deploying Azure resources
MIT License
3.2k stars 742 forks source link

Datafactory - Integration runtime/managed network issue. #6499

Closed rhysduck closed 1 year ago

rhysduck commented 2 years ago

Bicep version Bicep CLI version 0.4.1272

Describe the bug Issue deploying a managed network in datafactory. When trying to deploy a managed network in datafactory the deployment succeeds but on closer inspection the integration runtime that's been stood up doesn't appear to be using a managed network and shows as sub-type "public" susecunetly failing the managed private endpoint.

To Reproduce I tried a number of scenarios.

  1. Deployed datafactory with Bicep then added the IR, managed vnet & private endpoints manually (works).
  2. Ran another Bicep deployment on the existing datafactory with the IR, managed vnet & private endpoints uncommented out (Deployment succeeds but within datafactory the resources are in a failed state).
  3. Deployed datafactory, IR, managed vnet & private endpoints with Bicep (deployment succeeds but within datafactory the resources are in a failed state).
  4. Manually added the name of the vnet and commented out the existing (makes no difference)

I replicated the answer I found on stackoverflow in my script. https://stackoverflow.com/questions/69897155/error-in-bicep-deployment-of-managedvnet-ir-for-azure-datafactory

param datafactoryname string
param virtualNetworkName string
param vnetname string = 'vnet-spoke-one'
param subnetName string
param kvResourceId string

//resource virtualNetwork 'Microsoft.Network/virtualNetworks@2020-06-01' existing = {
//  name: virtualNetworkName

//}

resource dataFactory 'Microsoft.DataFactory/factories@2018-06-01' = {
  name: datafactoryname
  location: location
  identity: {
    type: 'SystemAssigned'
  }
  properties: {}
}

resource integrationRuntime 'Microsoft.DataFactory/factories/integrationRuntimes@2018-06-01' = {
  parent: dataFactory
  name: '${datafactoryname}-managedVnetIr' 
  properties: {
    type: 'Managed'
    typeProperties: {
      computeProperties: {
        location: 'AutoResolve'
        dataFlowProperties: {
          computeType: 'General'
          coreCount: 8
          timeToLive: 0

        }
        }
      }
    }
  }

resource managedVnet 'Microsoft.DataFactory/factories/managedVirtualNetworks@2018-06-01' = {
  parent:dataFactory
  name: vnetname
  properties: { 
  }
  dependsOn: [
    integrationRuntime
  ]
}

resource managedPrivateEndpoint 'Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints@2018-06-01' = {
  parent:managedVnet
  name: kvprivateConnection
  properties: {
    privateLinkResourceId: kvResourceId
    fqdns: [
  ]
    groupId: 'vault'
  }
  dependsOn: [
    integrationRuntime
  ]
}

Thanks,

Rhys

alex-frankel commented 2 years ago

At first glance, this does not look like a bicep issue. Are you able to open a support case so that the Data Factory support team can take a look?

tyconsulting commented 2 years ago

@rhysduck your Integration Runtime is missing a property value to point it to the managed VNet:

managedVirtualNetworkName: vnetname. here's the reference: https://docs.microsoft.com/en-us/azure/templates/microsoft.datafactory/factories/integrationruntimes?pivots=deployment-language-bicep#managedintegrationruntime

ghost commented 1 year ago

Hi rhysduck, this issue has been marked as stale because it was labeled as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thanks for contributing to bicep! :smile: :mechanical_arm: