Azure / Azure/MachineLearningNotebooks

Model Loading in Azure Databricks Failing even after Service Principal Authentication

Abierto
#1,266 8 comentarios 1 reacción 1 asignado Reclamado por @shbijlan Ver en GitHub
ADO bug Pipelines
Lenguaje dominante
Jupyter Notebook
Estrellas
4.4k
Forks
2.6k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

appId = dbutils.secrets.get(, )
tenant = dbutils.secrets.get(, )
clientSecret = dbutils.secrets.get(, )
subscription_id = dbutils.secrets.get(, )
resource_group =
workspace_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=
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?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.