Skip to content

az ml online-deployment create --file deployment-config.yaml --debug ## resolving to windows path #8438

Closed
@Anilalkg

Description

Describe the bug

az ml online-deployment create --file deployment-config.yaml --debug

my - deployment-config.yaml
############
$schema: https://azuremlschemas.azureedge.net/latest/managedOnlineDeployment.schema.json
type: deployment

name: shonty-deployment
endpoint_name: shonty-endpoint-for-innovation
model:
path: azureml:shonty-prod-innovation:1 ## this exists in my azure portal
environment:
name: azureml-promptflow-environment
version: 1
instance_type: Standard_DS3_v2
instance_count: 1
##########

Error

File "C:\Users\kesava01.azure\cliextensions\ml\azext_mlv2\manual\vendored_curated_sdk\azure\ai\ml_utils_asset_utils.py", line 259, in _get_file_hash
with open(str(filename), "rb") as f:
^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument: 'C:\PromptFlow\github\promptflow\azureml:shonty-prod-innovation:1'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 666, in execute
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 734, in _run_jobs_serially
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 703, in _run_job
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 336, in call
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 120, in handler
File "C:\Users\kesava01.azure\cliextensions\ml\azext_mlv2\manual\custom\online_deployment.py", line 132, in ml_online_deployment_create
log_and_raise_error(err, debug, yaml_operation=yaml_operation)
^^^^^
UnboundLocalError: cannot access local variable 'debug' where it is not associated with a value

Related command

$ az ml online-deployment create --file deployment-config.yaml --debug

Errors

Traceback (most recent call last):
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 666, in execute
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 734, in _run_jobs_serially
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 703, in _run_job
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 336, in call
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 120, in handler
File "C:\Users\kesava01.azure\cliextensions\ml\azext_mlv2\manual\custom\online_deployment.py", line 132, in ml_online_deployment_create
log_and_raise_error(err, debug, yaml_operation=yaml_operation)
^^^^^
UnboundLocalError: cannot access local variable 'debug' where it is not associated with a value

Issue script & Debug output

create online deployment with 100% traffic

az ml online-deployment create --file deployment.yaml --all-traffic

Expected behavior

should resolve the model path correctly to azure portal

Environment Summary

(base) PS C:\Users\kesava> python --version
Python 3.12.8

Additional context

referred CLI- azureml-examples\cli\generative-ai\promptflow\deploy-flow

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botMachine LearningService AttentionThis issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.extension/mlquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions