none
Retrieve data factory object json from https:/management.azure.com/ endpoint.

    Question

  • Hello 

    I'm trying to get the azure data factory dataset definition using the following API endpoint but I get the error message below using powershell & via Try it on https://docs.microsoft.com/en-us/rest/api/datafactory/datasets/get

    https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/datasets/{datasetName}

    Can someone please help? I'm looking to generate the json definition for the datafactory pipelines/datasets & linkedservices.

    Powershell:

    Invoke-RestMethod : {"error":{"code":"ResourceNotFound","message":"The Resource 'Microsoft.DataFactory/factories/{datafactoryname}' under resource group 'ResourceGroup' was not found."}}
    At line:64 char:1
    + Invoke-RestMethod @params
    + ~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
        + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

    when I use the Try it button on to get the definition I run into the similar error. 

    {
      "error": {
        "code": "ResourceNotFound",
        "message": "The Resource 'Microsoft.DataFactory/factories/datafactoryname' under resource group 'ResourceGroup' was not found."
      }
    }

    • Moved by Zahid Faroq Wednesday, June 20, 2018 5:25 AM Data Factory related
    Wednesday, June 20, 2018 12:56 AM

Answers

  • I was making a call to ADF V2.0 while I should be using ADF V1 call. Passing the appropriate version information resolved my issue. Thanks!
    • Marked as answer by nihcas7713 Wednesday, June 27, 2018 5:09 AM
    Wednesday, June 27, 2018 5:09 AM

All replies

  • Hi,https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/datasets/{datasetName}?api-version=2017-09-01-preview

    It should be the right endpoint.

    Are you sure you are using the right data factory name and resource group name? 

    Wednesday, June 20, 2018 9:09 AM
  • yes, all the parameters are correct. I do see the RG,DF, Pipeline on Azure portal.
    Wednesday, June 20, 2018 5:14 PM
  • I tried the same. But my cmdlets can return the right payload.

    Something I think you could have a try.

    1. Check whether you login in Powsershell with the right subscription. You could get the current subscription with  Get-AzureRmContext. If not, try to switch to your right subscription.

    2. Try to upgrade azure rm data factory module with

    Update-Module -Name AzureRm.DataFactoryV2

    But I don't think this is related. Just have a try.

    Thursday, June 21, 2018 2:17 AM
  • I was making a call to ADF V2.0 while I should be using ADF V1 call. Passing the appropriate version information resolved my issue. Thanks!
    • Marked as answer by nihcas7713 Wednesday, June 27, 2018 5:09 AM
    Wednesday, June 27, 2018 5:09 AM