Package: azure-purview-workflow
Azure Purview Workflow Service client library for PythonWorkflows are automated, repeatable business processes that users can create within Microsoft Purview to validate and orchestrate CUD (create, update, delete) operations on their data entities. Enabling these processes allow organizations to track changes, enforce policy compliance, and ensure quality data across their data landscape.Use the client library for Purview Workflow to:Manage workflowsSubmit user requests and monitor workflow runsView and respond to workflow tasksFor more details about how to use workflow, please refer to theservice documentationGetting startedPrequisitesPython 3.7 or later is required to use this package.You need anAzure subscriptionto use this package.An existing AzurePurview account.AuthenticationTo authenticate with AAD, you must firstpipinstallazure-identityAfter setup, you can choose which type ofcredentialfrom azure.identity to use.
For Workflow service, it is recommended that use theUsernamePasswordCredentialto authenticate the client:Set the values of  client ID and tenant ID of the AAD application, set the values username and password of the AAD user as environment variables:AZURE_CLIENT_ID,AZURE_TENANT_ID,USERNAMEandPASSWORDUse the returned token credential to authenticate the client:fromazure.purview.workflowimportPurviewWorkflowClientfromazure.identityimportUsernamePasswordCredentialusername=os.getenv("USERNAME")password=os.getenv("PASSWORD")client_id=os.getenv("AZURE_CLIENT_ID")tenant_id=os.getenv("AZURE_TENANT_ID")credential=UsernamePasswordCredential(client_id=client_id,username=username,password=password,tenant_id=tenant_id)client=PurviewWorkflowClient(endpoint='<endpoint>',credential=credential)ExamplesThe following section shows you how to initialize and authenticate your client, then list all workflows.List All WorkflowsList All Workflowsfromazure.purview.workflowimportPurviewWorkflowClientfromazure.identityimportUsernamePasswordCredentialusername=os.getenv("USERNAME")password=os.getenv("PASSWORD")client_id=os.getenv("AZURE_CLIENT_ID")tenant_id=os.getenv("AZURE_TENANT_ID")credential=UsernamePasswordCredential(client_id=client_id,username=username,password=password,tenant_id=tenant_id)client=PurviewWorkflowClient(endpoint='<endpoint>',credential=credential)try:response=client.workflows.list()foriteminresponse:print(item)exceptHttpResponseErrorase:print('service responds error:{}'.format(e.response.json()))Key conceptsTroubleshootingContributingNext stepsThis project welcomes contributions and suggestions. Most contributions require
you to agree to a Contributor License Agreement (CLA) declaring that you have
the right to, and actually do, grant us the rights to use your contribution.
For details, visithttps://cla.microsoft.com.When you submit a pull request, a CLA-bot will automatically determine whether
you need to provide a CLA and decorate the PR appropriately (e.g., label,
comment). Simply follow the instructions provided by the bot. You will only
need to do this once across all repos using our CLA.This project has adopted theMicrosoft Open Source Code of Conduct. For more information,
see the Code of Conduct FAQ or contactopencode@microsoft.comwith any
additional questions or comments.