首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何指向Azure blob存储的代码路径

如何指向Azure blob存储的代码路径
EN

Stack Overflow用户
提问于 2022-06-03 05:34:33
回答 1查看 84关注 0票数 0
代码语言:javascript
复制
from azure.ai.ml import Input, command
from azure.ai.ml.entities import Data, CommandJob
from azure.ai.ml.constants import AssetTypes

# in this example we
my_job_inputs = {
    "input_data": Input(
        path='***',
        type=AssetTypes.URI_FOLDER
    )
}

job = command(
    code="****", # local path where the code is stored
    command='python main.py --input_folder ${{inputs.input_data}}',
    inputs=my_job_inputs,
    environment="test-env2",
    compute="compute-instance"                                                      
)

#submit the command job
returned_job = ml_client.create_or_update(job)
#get a URL for the status of the job
returned_job.services["Studio"].endpoint

对于代码路径,我希望将其指向Azure blob存储区,因为我的代码被上传到那里,但是如果我使用blob存储的位置,则会得到:

代码语言:javascript
复制
ValidationException: /home/xmask/azure/azureml-blobstore-88acaeac-5f0c-40d5-852a-b152622f94b6/UI/wITP/05-26-2022_34567_UTC not found, local path must point to a file or directory. Path must follow proper formatting for datastore, job or run uri's.

有什么想法可以指出代码路径到Azure blob存储吗?

EN

回答 1

Stack Overflow用户

发布于 2022-06-03 07:56:56

做这件事有几种方法。

  1. 创建一个容器&上传blob。将其访问级别保持为

然后点击blob,就会有一个URL。使用它访问图像/文件。

如果您想采用安全的方式,则使用

  1. ,而不将容器公开为公共的。使用SAS只能在指定的token.We长期有效性的情况下为相应的blob启用SAS令牌。因此,图像URL + SAS令牌将创建一个有效的图像URL。为指定的长期/短期生成它。使用Blob 作为图像URL.

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72485118

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档