Is there a way to get resource definition json files of Azure Data Factory via command line?

Makoto Oda 291 Reputation points
2022-02-07T04:34:41.66+00:00

I read the Stack Overflow's question which seems to relate to my question.

In the above question, REST API was introduced.

However, I think that there are some differences between REST API and downloading support files from Azure Data Factory Studio.

When I use Linked Services - Get, "id" and "etag" properties are contained in the output.
However, the two properties are not contained in downloaded support files from Azure Data Factory Studio.

If I change the output using jq like | jq 'del(.etag) | del(.id)', I can remove the two properties.
However, the order of properties are not the same as a downloaded support file even if I use jq's --sort-keys option.

For example, when I get json of Azure Key Vault linked service from Azure Data Factory Studio, the content are as follows.

   json  
   {  
       "name": "<LinkedService Name>",  
       "type": "Microsoft.DataFactory/factories/linkedservices",  
       "properties": {  
           "type": "AzureKeyVault",  
           "typeProperties": {  
               "baseUrl": "https://<key container name>.vault.azure.net/"  
           },  
           "annotations": []  
       }  
   }  

When I execute REST API, the content are as follows.

  • command text
    curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer <AccessToken>" https://management.azure.com/subscriptions/\<SubscriptionId>/resourceGroups/<ResourceGroupName>/providers/Microsoft.DataFactory/factories/<DataFactoryName>/linkedservices/<LinkedServiceName>?api-version=2018-06-01 | jq --sort-keys 'del(.etag) | del(.id)'
  • output json
    {
    "name": "<LinkedService Name>",
    "properties": {
    "annotations": [],
    "type": "AzureKeyVault",
    "typeProperties": {
    "baseUrl": "https://<key container name>.vault.azure.net/"
    }
    },
    "type": "Microsoft.DataFactory/factories/linkedservices"
    }

Is there a way to get resouce definition json from command line as same as downloading support files from Azure Data Factory Studio?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,084 questions
{count} votes