Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{AzureML} 'SASCredentialDto' object is not subscriptable #30395

Closed
wants to merge 2 commits into from

Conversation

navba-MSFT
Copy link
Contributor

@navba-MSFT navba-MSFT commented May 15, 2023

fixes Azure/azure-cli-extensions#6268

Whil;e running the Azure CLi command: az ml model download we get the below error:

cli: Traceback (most recent call last):
  File "/root/.azure/cliextensions/ml/azext_mlv2/manual/custom/model.py", line 112, in ml_model_download
    ml_client.models.download(name=name, version=version, download_path=download_path)
  File "/root/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/_telemetry/activity.py", line 263, in wrapper
    return f(*args, **kwargs)
  File "/root/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/operations/_model_operations.py", line 320, in download
    sas_uri, auth_type = get_storage_details_for_registry_assets(
  File "/root/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/_utils/_registry_utils.py", line 173, in get_storage_details_for_registry_assets
    if sas_uri.blob_reference_for_consumption.credential["credentialType"] == "NoCredentials":
TypeError: 'SASCredentialDto' object is not subscriptable

From the above error, it seems like we are trying to access a dictionary-like item using square brackets ([ ]) on an object of type 'SASCredentialDto', which does not support subscripting, since it is not a dictionary.

As per this documentation, the 'credentialType' and 'sasUri' properties are directly accessible within the 'SASCredentialDto' object.

Name Type Description
credentialType string:SAS [Required] Credential type used to authentication with storage.
sasUri string Full SAS Uri, including the storage, container/blob path and SAS token

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@banibrata
Copy link

would you like to add an E2E test....?

@navba-MSFT navba-MSFT requested a review from banibrata May 18, 2023 04:00
@github-actions
Copy link

Hi @navba-MSFT. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days.

@github-actions github-actions bot added the no-recent-activity There has been no recent activity on this issue. label Jul 21, 2023
@github-actions
Copy link

Hi @navba-MSFT. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing /reopen if you'd like to continue working on these changes. Please be sure to use the command to reopen or remove the no-recent-activity label; otherwise, this is likely to be closed again with the next cleanup pass.

@uberj
Copy link

uberj commented Sep 22, 2023

/reopen

@github-actions
Copy link

Sorry, @uberj, only the original author can reopen this pull request.

@gazelle51
Copy link

Has this been fixed? I am still getting 'SasCredentialDto' object is not subscriptable error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Machine Learning no-recent-activity There has been no recent activity on this issue.
Projects
None yet
5 participants