Skip to content

[Data Factory] Add data flow and debug session cmdlets #10177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Oct 8, 2019
Merged

[Data Factory] Add data flow and debug session cmdlets #10177

merged 7 commits into from
Oct 8, 2019

Conversation

jackmagic313
Copy link
Contributor

@jackmagic313 jackmagic313 commented Oct 3, 2019

Description

Design review tickets:
https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/388
https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/390

Changes:

  • Adding CRUD commands for ADF V2 data flow: Set-AzDataFactoryV2DataFlow, Remove-AzDataFactoryV2DataFlow, and Get-AzDataFactoryV2DataFlow.
  • Adding action commands for ADF V2 data flow debug Session: Start-AzDataFactoryV2DataFlowDebugSession, Get-AzDataFactoryV2DataFlowDebugSession, Add-AzDataFactoryV2DataFlowDebugSessionPackage, Invoke-AzDataFactoryV2DataFlowDebugSessionCommand and Stop-AzDataFactoryV2DataFlowDebugSession.
  • Update ADF .Net SDK version to 4.2.0

Checklist

  • I have read the Submitting Changes section of CONTRIBUTING.md
  • The title of the PR is clear and informative
  • The appropriate ChangeLog.md file(s) has been updated:
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header -- no new version header should be added
  • The PR does not introduce breaking changes
  • If applicable, the changes made in the PR have proper test coverage
  • For public API changes to cmdlets:
    • a cmdlet design review was approved for the changes in this repository (Microsoft internal only)
    • the markdown help files have been regenerated using the commands listed here

package.SessionId = SessionId;
}

DataFactoryClient.AddDataFlowToDebugSession(ResourceGroupName, DataFactoryName, package);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HelpMessage = Constants.HelpDataFlowDebugRowLimits)]
[Parameter(ParameterSetName = ParameterSetNames.ByResourceId, Position = 4, Mandatory = false,
HelpMessage = Constants.HelpDataFlowDebugRowLimits)]
public int? RowLimits { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plural

HelpMessage = Constants.HelpDataFlowDebugColumns)]
[Parameter(ParameterSetName = ParameterSetNames.ByResourceId, Position = 6, Mandatory = false,
HelpMessage = Constants.HelpDataFlowDebugColumns)]
public List<string> Columns { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plural

}

};
WriteObject(DataFactoryClient.InvokeDataFlowDebugSessionCommand(ResourceGroupName, DataFactoryName, request));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to actually implement ShouldProcess

request.IntegrationRuntime = integrationRuntimeResource;
}

WriteObject(DataFactoryClient.StartDebugSession(ResourceGroupName, DataFactoryName, request));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ShouldProcess implementation required

---
external help file: Microsoft.Azure.PowerShell.Cmdlets.DataFactoryV2.dll-Help.xml
Module Name: Az.DataFactory
online version:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

---
external help file: Microsoft.Azure.PowerShell.Cmdlets.DataFactoryV2.dll-Help.xml
Module Name: Az.DataFactory
online version:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

```powershell
PS C:\> Set-AzDataFactoryV2DataFlow -ResourceGroupName "ADF" -DataFactoryName "UncycloADF" -Name "TaxiDemo1" -DefinitionFile "C:\\samples\\UncycloSample\\TaxiDemo1.json"

DataFlowName : TaxiDemo1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

table format?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is list format

---
external help file: Microsoft.Azure.PowerShell.Cmdlets.DataFactoryV2.dll-Help.xml
Module Name: Az.DataFactory
online version:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need online version

---
external help file: Microsoft.Azure.PowerShell.Cmdlets.DataFactoryV2.dll-Help.xml
Module Name: Az.DataFactory
online version:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

online version

@jackmagic313
Copy link
Contributor Author

Thanks @markcowl for the quick review! I just addressed the feedbacks.

@jackmagic313 jackmagic313 requested a review from markcowl October 4, 2019 00:33
{
[Cmdlet("Stop", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "DataFactoryV2DataFlowDebugSession", DefaultParameterSetName = ParameterSetNames.ByFactoryName, SupportsShouldProcess = true)]
[OutputType(typeof(void))]
[OutputType(typeof(string))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It outputs bool

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what I did :P it's fixed.

namespace Microsoft.Azure.Commands.DataFactoryV2
{
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "DataFactoryV2DataFlow", DefaultParameterSetName = ParameterSetNames.ByFactoryName,SupportsShouldProcess = true), OutputType(typeof(void))]
public class RemoveAzureDataFactoryDataFlowCommand : DataFactoryContextActionBaseCmdlet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this returning string?

```powershell
PS C:\> Get-AzDataFactoryV2DataFlow -ResourceGroupName "ADF" -DataFactoryName "UncycloADF"

DataFlowName : TaxiDemo1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is list format

```powershell
PS C:\> Get-AzDataFactoryV2DataFlow -ResourceGroupName "ADF" -DataFactoryName "UncycloADF" -Name "dataflow1"

DataFlowName : dataflow1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list format. You will need to have a format entry for this in order to have a table format, see: https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/generate-format.ps1xml-file.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. I thought I need to include a example to show how to convert to a table format result 😅, will update my pr soon

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generation tool doesn't work with "Could not load file or assembly 'System.Runtime.Loader, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified." error (I tried to change the version to 4.0.0 in csproj and I got a different error with something about assembly context). For now I just added manually into format file instead and it should still work if someone uses the script to generate the file in the future.

```powershell
PS C:\WINDOWS\system32> Get-AzDataFactoryV2DataFlowDebugSession -ResourceGroupName adf -DataFactoryName UncycloADF

DataFlowName : DebugSession-0a7e0d6e-f2b7-48cc-8cd8-618326f5662f
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still lidt format


Id Name PSJobTypeName State HasMoreData Location Command
-- ---- ------------- ----- ----------- -------- -------
3 Long Running... AzureLongRun... Running True localhost Invoke-AzDataFactoryV2...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this is table format)

```powershell
PS C:\> Set-AzDataFactoryV2DataFlow -ResourceGroupName "ADF" -DataFactoryName "UncycloADF" -Name "TaxiDemo1" -DefinitionFile "C:\\samples\\UncycloSample\\TaxiDemo1.json"

DataFlowName : TaxiDemo1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is list format

@jackmagic313 jackmagic313 requested a review from markcowl October 4, 2019 20:25
markcowl
markcowl previously approved these changes Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants