Azure-Player / azure.datafactory.devops

Azure DevOps Deployment Tasks for Azure Data Factory objects
MIT License
39 stars 21 forks source link

Invalid resource request. Resource type: 'ManagedVirtualNetwork', Resource name: 'default' 'Error: Invalid payload' #70

Closed jaimeamesti closed 2 years ago

jaimeamesti commented 2 years ago

Hi,

I'm using the tools version "1.10.1041 (Latest)". I'm trying to deploy an ADF that has a Managed Virtual Network and a private endpoint. This is yaml task configuration:

          - task: PublishADFTask@1
            inputs:
              azureSubscription: '*********'
              ResourceGroupName: '**************'
              DataFactoryName: 'testCdPipeline'
              DataFactoryCodePath: '$(Pipeline.Workspace)/ADF'
              Location: 'West Europe'
              DeleteNotInSource: true
              StageType: FilePath
              StageConfigFile: '$(Pipeline.Workspace)/ADF/pipelineSettings.csv'
              PublishMethod: AzResource
              DoNotDeleteExcludedObjects: false

I'm getting this error:

9eb7a59fb8b8\1.10.1041\ps_modules\azure.datafactory.tools\private\Deploy-AdfObject.ps1: line 37

[debug]at Deploy-AdfObject, D:\a_tasks\PublishADFTask_1af843b5-35a0-411f-9a18-9eb7a59fb8b8\1.10.1041\ps_modules\azure.datafactory.tools\private\Deploy-AdfObject.ps1: line 24

[debug]at , D:\a_tasks\PublishADFTask_1af843b5-35a0-411f-9a18-9eb7a59fb8b8\1.10.1041\ps_modules\azure.datafactory.tools\public\Publish-AdfV2FromJson.ps1: line 215

[debug]at Publish-AdfV2FromJson, D:\a_tasks\PublishADFTask_1af843b5-35a0-411f-9a18-9eb7a59fb8b8\1.10.1041\ps_modules\azure.datafactory.tools\public\Publish-AdfV2FromJson.ps1: line 214

[debug]at , D:\a_tasks\PublishADFTask_1af843b5-35a0-411f-9a18-9eb7a59fb8b8\1.10.1041\PublishADF.ps1: line 128

[debug]at , : line 1

[debug]at , : line 22

[debug]at , : line 18

[debug]at , : line 1

[debug]Exception:

[debug]Microsoft.Azure.Commands.ResourceManager.Cmdlets.Entities.ErrorResponses.ErrorResponseMessageException: InvalidResourceRequest : Invalid resource request. Resource type: 'ManagedVirtualNetwork', Resource name: 'default' 'Error: Invalid payload'.

[debug]CorrelationId: 3b47d0b7-f105-4ff3-a40b-83b80082431b

[debug] at Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.ResourceManagerCmdletBase.HandleException(ExceptionDispatchInfo capturedException)

[debug] at Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.ResourceManagerCmdletBase.ExecuteCmdlet()

[debug] at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()

##[error]InvalidResourceRequest : Invalid resource request. Resource type: 'ManagedVirtualNetwork', Resource name: 'default' 'Error: Invalid payload'.

I've not modified the original ADF JSON files. Do I have to do something special before deploying a Managed virtual network?

NowinskiK commented 2 years ago

There is a bug within a deployment of that kind of object via New-AzResource. It was described and discussed here: https://github.com/SQLPlayer/azure.datafactory.tools/issues/149 However, I released a workaround to the issue in ver. 0.93 and ver.1.10.1041 of Azure DevOps already consist of the patch (up to v.0.95). From that point of view it's weird you're getting this error. Potentially it may be something else. Please check out whether adding properties element to JSON file (manually) resolve the problem (as described in issue 149 above).

jaimeamesti commented 2 years ago

Hi,

Thanks for your response. After adding the properties element to the JSON file manually, it works. Are you going to check why the fix of ver.1.10.1041 is not working?

NowinskiK commented 2 years ago

Thanks for letting me know. Please send me your file, version before adding a new element. I'd like to test it and make sure there is nothing in code missed.