title: How to use secret keys in Azure Machine Learning Service pipelines
body: <p>I am using Azure Machine Learning services and the <a href="https://docs.microsoft.com/en-us/azure/machine-learning/service/concept-ml-pipelines" rel="nofollow noreferrer">pipeline functionality</a> for data preparation, training and testing of my Machine Learning models. However, during my data preparation step, I need to connect to a database and I want to find a way to pass my secret passwords or keys without writing them in plain text in my script files.</p>
  
  <p>Locally, I make use of environment variables for using secret passwords and keys, but to my best knowledge, this is impossible in the pipeline infrastructure, since Conda doesn't support passing environment variables. If anyone can confirm or deny this, it would be helpful.</p>
  
  <p>In the Azure Machine Learning services in the Azure Portal, I have found a 'key vault' resource, that is created automatically when I create a 'Machine Learning service workspace' resource. This seems to be exactly what I need. Is it? And if so, how do I use it?</p>
  
  <p>If neither of the above solves my issue, is there any other way to safely use secret passwords and keys in my scripts, without writing them in plain text in the scripts?</p>
  
  <p>EDIT: I realize my question have a strong focus on database connections. However, the question is really about any kinds of secrets or passwords, not just database credentials. As have been pointed out in an answer, that could be worth mentioning here, is that Azure SQL database connections can (and should) be solved using the <a href="https://docs.microsoft.com/en-us/python/api/azureml-pipeline-steps/azureml.pipeline.steps.data_transfer_step.datatransferstep?view=azure-ml-py" rel="nofollow noreferrer">DataTransferStep</a>.</p>