Azure / Azure/azure-powershell

[Feature]: Get-AzDataFactoryV2Dataset (and similar): add -OutputFile consistent with Set-AzDataFactoryV2Dataset

Open
#19,683 7 comments 0 reactions 0 assignees View on GitHub
act-codegen-extensibility-squad customer-reported Data Factory feature-request Service Attention
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.