Skip to content
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

AzureML | SDKv2 | MLClient | Pass proxy variables #36381

Open
IliasAarab opened this issue Jul 8, 2024 · 11 comments
Open

AzureML | SDKv2 | MLClient | Pass proxy variables #36381

IliasAarab opened this issue Jul 8, 2024 · 11 comments
Assignees
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Machine Learning needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.

Comments

@IliasAarab
Copy link

Is it possible to add proxy/ssl config to the MLClient?

from azure.ai.ml import MLClient
from azure.identity import DefaultAzureCredential

ml_client = MLClient(
subscription_id=subscription_id,
resource_group_name=resource_group,
credential=DefaultAzureCredential(),
)
@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Machine Learning needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team. labels Jul 8, 2024
Copy link

github-actions bot commented Jul 8, 2024

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-ml-sdk @azureml-github.

@mccoyp
Copy link
Member

mccoyp commented Jul 8, 2024

Hi @IliasAarab, thank you for opening an issue. Proxy and pipeline configuration can be set in SDK clients through the mechanisms described in our Core client library developer reference documentation.

For proxies specifically, you can either use the HTTP_PROXY and HTTPS_PROXY environment variables or pass a azure.core.pipeline.policies.ProxyPolicy instance to your client constructor in a proxy_policy keyword argument.

@mccoyp mccoyp added Azure.Core and removed Service Attention This issue is responsible by Azure service team. labels Jul 8, 2024
@xiangyan99 xiangyan99 added the issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. label Jul 8, 2024
@github-actions github-actions bot removed the needs-team-attention This issue needs attention from Azure service team or SDK team label Jul 8, 2024
Copy link

github-actions bot commented Jul 8, 2024

Hi @IliasAarab. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

@IliasAarab
Copy link
Author

@mccoyp thank you for the guidance! I'm still having an issue when trying to initialize an MLClient instance when passing a credential object to the constructor:

from azure.ai.ml import MLClient
from azure.identity import InteractiveBrowserCredential
from azure.core.pipeline.policies import ProxyPolicy

proxies = {"http": "myproxy", "https":  "myproxy"}
proxy_policy = ProxyPolicy()
proxy_policy.proxies = proxies

credential = InteractiveBrowserCredential()
client = MLClient.from_config(
    credential=credential,
    proxy_policy=proxy_policy
)
client.compute.get("is-cpu")
InteractiveBrowserCredential.get_token failed: Authentication failed: <urllib3.connection.HTTPSConnection object at 0x000001F13531D810>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed

ClientAuthenticationError: Authentication failed: <urllib3.connection.HTTPSConnection object at 0x000001F13531D810>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed

Everything works fine when I set my proxies as global env variables. (but that's not a viable option for all use cases).

When I first set global env variables for the initial interactive authentication, and then continue work with the client (having passed proxy_policy) with global env variables deleted, everything still works fine. So the current problem resides with the initial auth.

Also, wondering how to pass requests_ca_bundle to the ProxyPolicy or to disable ssl verification (e.g., verify=False.


/unresolve

@github-actions github-actions bot added needs-team-attention This issue needs attention from Azure service team or SDK team and removed issue-addressed The Azure SDK team member assisting with this issue believes it to be addressed and ready to close. labels Jul 8, 2024
@mccoyp
Copy link
Member

mccoyp commented Jul 9, 2024

@IliasAarab thank you for the information. @xiangyan99, would you be able to take a look?

@IliasAarab
Copy link
Author

Hi @xiangyan99, any updates on this ?

@xiangyan99
Copy link
Member

Could you help to clarify your request?

In your case, it failed because InteractiveBrowserCredential does not support proxy.

Do you ask to add proxy support for InteractiveBrowserCredential?

@xiangyan99 xiangyan99 added the needs-author-feedback More information is needed from author to address the issue. label Jul 17, 2024
Copy link

Hi @IliasAarab. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@github-actions github-actions bot removed the needs-team-attention This issue needs attention from Azure service team or SDK team label Jul 17, 2024
@IliasAarab
Copy link
Author

@xiangyan99 yes I guess that's what it boils down to. Or alternatively, whether there is another Credential object similar to InteractiveBrowserCredential that supports proxies? Otherwise, I am confused as what the added value is of the proxy_policy arg into MLClient as the client also needs a Credential instance.

@github-actions github-actions bot added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels Jul 17, 2024
@IliasAarab
Copy link
Author

@xiangyan99 let me know if there is an update please.

@lmazuel lmazuel added the Service Attention This issue is responsible by Azure service team. label Aug 5, 2024
Copy link

github-actions bot commented Aug 5, 2024

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-ml-sdk @azureml-github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Machine Learning needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

6 participants