Skip to content

az ml batch-endpoint invoke wants an AccountKey or SasToken for registered Datastores for output #25846

@neilmca-inc

Description

@neilmca-inc

From here https://learn.microsoft.com/en-us/cli/azure/ml/batch-endpoint?view=azure-cli-latest#az-ml-batch-endpoint-invoke

This command works as the output is to the registered internal Azure Machine Learning Default Datastore...

az ml batch-endpoint invoke --name mybatchendpoint --input https://azuremlexampledata.blob.core.windows.net/data/mnist/sample --input-type uri_folder --output-path azureml://datastores/workspaceblobstore/paths/mybatchendpoint --set output_file_name=predictions.csv --query name -o tsv --resource-group myrg --workspace-name myamlworkspace

When I want my output to go to another Storage Account location - I have pre-registered it in AML Studio as follows...(under Data > Datastores)

Datastore name: data_mystorageaccount
Datastore type: Azure Blob Storage
Subscription ID: {redactedmyAzureSub}
Storage account: mystorageaccount
Blob container: output
Save credentials with the datastore for data access - enabled
Authentication type: Account key
Account key: {the account key from the storage account mystorageaccount}
Clicked Create

From looking in the Studio it can browse to that output location - see image - it can see a file already called ServiceTags_Public_20230306.json in the right hand pane...

invoke

This proves connection to the Storage Account via the AccountKey as successful.

When I run the following command...

az ml batch-endpoint invoke --name mybatchendpoint --input https://azuremlexampledata.blob.core.windows.net/data/mnist/sample --input-type uri_folder --output-path azureml://datastores/data_mystorageaccount/paths/mybatchendpoint --set output_file_name=predictions.csv --query name -o tsv --resource-group myrg --workspace-name myamlworkspace

...it fails with the following output error Missing AccountKey or SasToken

ERROR: {
  "error": {
    "code": "UserError",
    "severity": null,
    "message": "Missing AccountKey or SasToken",
    "messageFormat": null,
    "messageParameters": null,
    "referenceCode": null,
    "detailsUri": null,
    "target": null,
    "details": [],
    "innerError": null,
    "debugInfo": null,
    "additionalInfo": null
  },
  "correlation": {
    "operation": "{redacted}",
    "request": "{redacted}"
  },
  "environment": "{redacted}",
  "location": "{redacted}",
  "time": "2023-03-16T13:41:12.1918203+00:00",
  "componentName": "managementfrontend"
}

It states on the Datastores screen in AML Studio the following...

Datastores securely connect to a storage service on Azure by storing connection information. With datastores, you no longer need to provide credential information in your scripts to access your data

...so I'm not sure why this invoke command fails? Why does it need a AccountKey or SasToken passed to it as part of the az ml batch-endpoint invoke command?

Even if I did need to pass a AccountKey or SasToken as part of this command, is it supported here? There are no examples listed in the documentation for output types


Document Details

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions