Azure / Azure/azure-sdk-for-python

How to provide environment variables to command components (SDK V2)

Open
#44,187 5 comments 0 reactions 0 assignees View on GitHub
customer-reported needs-team-attention question
Dominant language
Python
Stars
5.6k
Forks
3.4k
Avg merge
1d 21h
Merged PRs (30d)
193

Description

Hey!

We're migrating from SDK V1 to V2.
I have to say it's been a headache.

We use yaml command components to run/deploy our scripts with SDK v2.
The yaml command components are loaded into a pipeline_component, and then the pipeline_component runs in a job, using the Python V2 SDK.
The above works, the job and its components execute.

**But**, how do we set environment variables for these (yaml) components so that they are reachable at runtime?
Can we set it in the command component yaml? In the loaded component? In the pipeline? In the Environment? I've searched and tried almost everything by now, but to no avail.

There's even a forum question about it, where the mods are suggesting the commandComponent.schema.json supports it, which it doesn't:
https://learn.microsoft.com/en-us/answers/questions/2237919/how-to-pass-environment-variable-into-azureml-comp?comment=answer-2015022&page=1#comment-2360727

Side comment is that a lot of the documentaton on SDK V2 references the _mldesigner_ package, which has dependencies to SDK v1 (azureml.core) - and from what I gather this is contraproductive since SDK v1 is out or support next summer? And not even supporting above Python 3.9?
At least when I've tried to use mldesigner, I get errors that I need to add azureml.core as well.

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.