azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

az ml online-endpoint create / online-deployment create fails if it already exists

Open bachlean opened this issue 3 years ago • 3 comments

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Related command az ml online-endpoint create ... az ml online-deployment create ...

Describe the bug Command fails (and with it, corresponding Tasks in AzureDevops Pipelines) despite the documentation stating:

[online-endpoint] To create an endpoint, provide a YAML file with batch endpoint configuration. If the endpoint already exists, it will be over-written with the new settings. [online-deployment] Create a deployment. If the deployment already exists, it will be over-written with the new settings.

This is extremely annoying, because it forces you to include a separate check and an if/else construct for create/update when trying to automate.

To Reproduce create the same endpoint/deployment twice in a row az ml online-endpoint create -w <MLWS_NAME> -g <RG_NAME> -n dummy-endpoint az ml online-endpoint create -w <MLWS_NAME> -g <RG_NAME> -n dummy-endpoint => cli.azure.cli.core.azclierror: Met error <class 'Exception'>:Endpoint already exists

Expected behavior I expect the command to overwrite the existing endpoint (with potentially new settings) if it already exists (as would be the intended behavior according to the documentation)

Environment summary Cloudshell bash in azure portal azure-cli 2.39.0 core 2.39.0 telemetry 1.0.6 * Extensions: ml 2.6.1 ai-examples 0.2.5 ssh 1.1.2

Dependencies: msal 1.18.0b1 azure-mgmt-resource 21.1.0b1

bachlean avatar Aug 10 '22 14:08 bachlean

route to CXP team

yonzhan avatar Aug 10 '22 14:08 yonzhan

@bachlean Thank you for reaching out, we are looking into it.

RakeshMohanMSFT avatar Aug 12 '22 03:08 RakeshMohanMSFT

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureml-github.

Issue Details

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Related command az ml online-endpoint create ... az ml online-deployment create ...

Describe the bug Command fails (and with it, corresponding Tasks in AzureDevops Pipelines) despite the documentation stating:

[online-endpoint] To create an endpoint, provide a YAML file with batch endpoint configuration. If the endpoint already exists, it will be over-written with the new settings. [online-deployment] Create a deployment. If the deployment already exists, it will be over-written with the new settings.

This is extremely annoying, because it forces you to include a separate check and an if/else construct for create/update when trying to automate.

To Reproduce create the same endpoint/deployment twice in a row az ml online-endpoint create -w <MLWS_NAME> -g <RG_NAME> -n dummy-endpoint az ml online-endpoint create -w <MLWS_NAME> -g <RG_NAME> -n dummy-endpoint => cli.azure.cli.core.azclierror: Met error <class 'Exception'>:Endpoint already exists

Expected behavior I expect the command to overwrite the existing endpoint (with potentially new settings) if it already exists (as would be the intended behavior according to the documentation)

Environment summary Cloudshell bash in azure portal azure-cli 2.39.0 core 2.39.0 telemetry 1.0.6 * Extensions: ml 2.6.1 ai-examples 0.2.5 ssh 1.1.2

Dependencies: msal 1.18.0b1 azure-mgmt-resource 21.1.0b1

Author: bachlean
Assignees: RakeshMohanMSFT
Labels:

Service Attention, Machine Learning, customer-reported, Auto-Assign

Milestone: -

ghost avatar Aug 12 '22 08:08 ghost

Hello @bachlean, thanks for your feedback. Sorry for the confusion, we had chosen to use create only for new endpoints/deployments, and we're guiding to use update for existing ones. Intent of using create is to have complete set of information needed to create one (using YAML), so that this YAML can be used as the single file representing the endpoint/deployment. This way you can fully leverage GitOps - you can do diff/compare and manage versions of YAML configuration and trigger automatic update if/when needed.

The confusion is on the documentation - sorry for your inconvenience. We're currently fixing the documentation issue.

dem108 avatar Aug 19 '22 18:08 dem108

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Aug 27 '22 14:08 ghost

Hello @bachlean, thanks for your feedback. Sorry for the confusion, we had chosen to use create only for new endpoints/deployments, and we're guiding to use update for existing ones. Intent of using create is to have complete set of information needed to create one (using YAML), so that this YAML can be used as the single file representing the endpoint/deployment. This way you can fully leverage GitOps - you can do diff/compare and manage versions of YAML configuration and trigger automatic update if/when needed.

The confusion is on the documentation - sorry for your inconvenience. We're currently fixing the documentation issue.

Hello @dem108 , thanks for the reply. I understand. although, i have to say i find this kind of inconvenient and definitely inconsistent with the other "az ml XXX create" commands for workspace and compute. For workspace and compute, the "create" command does not fail and abort the pipeline run if the workspace/compute already exists.

bachlean avatar Aug 29 '22 06:08 bachlean

+1 for this please - I raised this also at the Q+A as I was initially directed there. Idempotency across the az ml v2 command set needs a review

https://learn.microsoft.com/en-us/answers/questions/1135983/azure-cli-ml-commands-should-be-idempotent

neilmca-inc avatar Feb 03 '23 12:02 neilmca-inc