Skip to content

Instantly share code, notes, and snippets.

@Gorgoras
Gorgoras / ADF_Pipeline_Parameters.py
Created September 6, 2019 13:58
Call ADF pipeline with parameters, authenticating with a user or with a service principal.
from azure.mgmt.datafactory import DataFactoryManagementClient
from azure.common.credentials import UserPassCredentials #To login with user and pass, use this.
from azure.common.credentials import ServicePrincipalCredentials #To login with service principal (appid and client secret) use this
subscription_id = "subsID"
#Use only one of these, depending on how you want to login.
credentials = UserPassCredentials(username="user@yourdomain.com", password="yourpass") #To login with user and pass
credentials = ServicePrincipalCredentials(client_id='appid', secret='client secret', tenant='tenantid') #To login with serv ppal