Azure / Azure/MachineLearningNotebooks

Model Loading in Azure Databricks Failing even after Service Principal Authentication

未關閉
#1,266 8 則留言 1 個 reaction 已指派 1 人 在 GitHub 檢視

@shbijlan 已經在處理了。

開始於 2020年12月16日。

ADO bug Pipelines
主要語言
Jupyter Notebook
星號
4.4k
分支
2.6k
PR 合併指標
30 天內沒有已合併 PR

描述

I am trying to run a DatabricksStep. I have used ServicePrincipalAuthentication to authenticate the run:

appId = dbutils.secrets.get(<secret-scope-name>, <client-id>)
tenant = dbutils.secrets.get(<secret-scope-name>, <directory-id>)
clientSecret = dbutils.secrets.get(<secret-scope-name>, <client-secret>)
subscription_id = dbutils.secrets.get(<secret-scope-name>, <subscription-id>)
resource_group = <aml-rgp-name>
workspace_name = <aml-ws-name>

svc_pr = ServicePrincipalAuthentication(
       tenant_id=tenant,
       service_principal_id=appId,
       service_principal_password=clientSecret)

ws = Workspace(
       subscription_id=subscription_id,
       resource_group=resource_group,
       workspace_name=workspace_name,
       auth=svc_pr
       )

The authentication is successful since running the following block of code gives the desired output:

subscription_id = ws.subscription_id
resource_group = ws.resource_group
workspace_name = ws.name
workspace_region = ws.location
print(subscription_id, resource_group, workspace_name, workspace_region, sep='\n')

However, the following block of codes gives an error:

model_name=<registered-model-name>
model_path = Model.get_model_path(model_name=model_name, _workspace=ws)
loaded_model = joblib.load(model_path)
print('model loaded!')

This is giving an error:

UserErrorException:
	Message: 
Operation returned an invalid status code 'Forbidden'. The possible reason could be:
1. You are not authorized to access this resource, or directory listing denied.
2. you may not login your azure service, or use other subscription, you can check your
default account by running azure cli commend:
'az account list -o table'.
3. You have multiple objects/login session opened, please close all session and try again.
                
	InnerException None
	ErrorResponse 
{
    "error": {
        "message": "\nOperation returned an invalid status code 'Forbidden'. The possible reason could be:\n1. You are not authorized to access this resource, or directory listing denied.\n2. you may not login your azure service, or use other subscription, you can check your\ndefault account by running azure cli commend:\n'az account list -o table'.\n3. You have multiple objects/login session opened, please close all session and try again.\n                ",
        "code": "UserError"
    }
}

Why is there a Forbidden Error when Authentication was successful?

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。