azure-sdk-for-python
azure-sdk-for-python copied to clipboard
error in Authenticate the client
[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.
- ID: c4bd3893-7980-57f3-c1a7-28b5ddc6931b
- Version Independent ID: 70e9f892-5b42-b888-1881-5ba039c260b1
- Content: Azure ML Package client library for Python
- Content Source: docs-ref-services/preview/ai-ml-readme.md
- Service: ml
- GitHub Login: @azureml-github
- Microsoft Alias: azureml-github
Label prediction was below confidence level 0.6
for Model:ServiceLabels
: 'Machine Learning:0.2790271,Azure.Identity:0.25511017,Docs:0.22482444'
@JingchaoZhang Thx for reporting this. Are you referencing a block of sample code somewhere? Can you share a link to the sample code?
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 thx for your feedback. subscription_id, resource_group, workspace are refereeing to local variables one should define in advance.
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.