azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

error in Authenticate the client

Open JingchaoZhang opened this issue 2 years ago • 3 comments

[Enter feedback here]

This code block ml_client = MLClient( DefaultAzureCredential(), subscription_id, resource_group, workspace ) should be revised to ml_client = MLClient( DefaultAzureCredential(), subscription_id, resource_group_name, workspace_name )

The original code gives the error below: TypeError: init() missing 1 required positional argument: 'resource_group_name


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

JingchaoZhang avatar Sep 22 '22 18:09 JingchaoZhang

Label prediction was below confidence level 0.6 for Model:ServiceLabels: 'Machine Learning:0.2790271,Azure.Identity:0.25511017,Docs:0.22482444'

azure-sdk avatar Sep 22 '22 18:09 azure-sdk

@JingchaoZhang Thx for reporting this. Are you referencing a block of sample code somewhere? Can you share a link to the sample code?

luigiw avatar Sep 22 '22 22:09 luigiw

I was referring to the code block on this page: Azure ML Package client library for Python | Microsoft Learnhttps://learn.microsoft.com/en-us/python/api/overview/azure/ai-ml-readme?view=azure-python-preview

Here is a screenshot: [cid:745e0788-84c2-4d31-a00b-63e612834368]

According to the MLClient Class page, the correct parameter name should be resource_group_name and workspace_name. azure.ai.ml.MLClient class | Microsoft Learnhttps://learn.microsoft.com/en-us/python/api/azure-ai-ml/azure.ai.ml.mlclient?view=azure-python-preview [cid:1d284530-6e98-4589-bfec-9c5d6c5f1f6a]

Jingchao


Jingchao Zhang

Sr. TPM | Azure HPC & AI CSI

Azure Engineering | Microsoft Corporation


From: Hanchi Wang @.> Sent: Thursday, September 22, 2022 6:13 PM To: Azure/azure-sdk-for-python @.> Cc: Jingchao Zhang @.>; Mention @.> Subject: Re: [Azure/azure-sdk-for-python] error in Authenticate the client (Issue #26394)

@JingchaoZhanghttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FJingchaoZhang&data=05%7C01%7Cjingczhang%40microsoft.com%7Cf095eab03d464b7d5baf08da9ce79c7a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637994815833651514%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=f67L5RQfovp9Z7kOaCqPM3PE6%2BAXiHnpsuTZoLtxbk0%3D&reserved=0 Thx for reporting this. Are you referencing a block of sample code somewhere? Can you share a link to the sample code?

— Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-sdk-for-python%2Fissues%2F26394%23issuecomment-1255609065&data=05%7C01%7Cjingczhang%40microsoft.com%7Cf095eab03d464b7d5baf08da9ce79c7a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637994815833651514%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Ou3qz0%2FfKOyS4fTWg8Qts3Ul93qc3u44voj7I%2BknBaM%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABQPCYWG5AQTMHS3WRLGRCLV7TKWZANCNFSM6AAAAAAQTJUMPY&data=05%7C01%7Cjingczhang%40microsoft.com%7Cf095eab03d464b7d5baf08da9ce79c7a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637994815833651514%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=odY4jcxMs%2FbPzoL3DhE03FfZHC3X0B9dniu8TbKsO0k%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

JingchaoZhang avatar Sep 23 '22 01:09 JingchaoZhang

@JingchaoZhang thx for your feedback. subscription_id, resource_group, workspace are refereeing to local variables one should define in advance.

luigiw avatar Nov 22 '22 01:11 luigiw

Hi @JingchaoZhang, since you haven’t asked that we “/unresolve” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve” to reopen the issue.

ghost avatar Nov 29 '22 04:11 ghost