Azure / Azure/azure-powershell
[Feature]: Get-AzDataFactoryV2Dataset (and similar): add -OutputFile consistent with Set-AzDataFactoryV2Dataset
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
### Description of the new feature
`Get-AzDataFactoryV2Dataset`'s ouput (`PSDataset`) seems to contain everything necessary to generate a json file that would be fit to feed to `Set-AzDataFactoryV2Dataset`'s -DefinitionFile parameter.
Simple attempts like
```
$DS = Get-AzDataFactoryV2Dataset -ResourceGroupName $resourceGroupName -DataFactoryName $dataFactoryName -Name $datasetName
ConvertTo-Json $DS | Out-File $jsonfile
```Generate something that is close to what is needed, but it makes more sense to just provide it.
This addition would provide an easy way to clone/copy objects within or between Data Factories.
### Proposed implementation details (optional)
Least impacting implementation (it seems):
- Add (optional) parameter `-OutputFile` to all `Get-Az...` methods that does the correct export (conforming to the matching `Set-Az...` method and /or the "view the JSON code representation" in the portal)
- Somewhat more impact (probably): provide a method on `PSDataset` (and similar) that exports it to json fit for use in `Set-Az...`
Alternatively (depending on current code thuis may be easier still), you could provide a way to
- alter properties of the `PSDataset` (e.g. change the name)
- pass this to `Set-AzDataFactoryV2Dataset`
Contributor guide
Assessment
This issue has not been assessed yet.