azure-cli: Not able to run az ml folder attach
az feedback
auto-generates most of the information requested below, as of CLI version 2.0.62
Describe the bug
az ml folder attach
was working with the previous az cli version 2.29.1
vs 2.30.0
.
To Reproduce
az ml folder attach
Expected behavior Instead of a success, we get:
2021-11-02T13:36:50.8211470Z [command]/bin/bash /agent/_work/_temp/azureclitaskscript1635860209071.sh
2021-11-02T13:36:51.8133956Z ERROR: __init__() got an unexpected keyword argument 'async_persist'
Environment summary Use azure-cli-ml from Azure DevOps agents
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 8
- Comments: 30 (3 by maintainers)
Commits related to this issue
- fix: https://github.com/Azure/azure-cli/issues/20150 — committed to santiagxf/aml-modules by santiagxf 2 years ago
Update:
sudo apt-get install azure-cli=2.29.1-1~bionic
won’t work in Azure Cli Task in Azure Pipelines.Now Azure CLI task is running with v2.30.0 in all the pipelines, I am getting the same error everywhere.
Please help me find the fix or rollback to the previous version in Azure CLI Task.
Thanks to this suggestion, I monkey-patched
azure.cli.core._profile.Profile.__init__
to accept the oldasync_persist
argument:we were able to fix the issue in DevOps using the following (installing 2.29.2)
@ranikamadurawe I have managed to workaround this by editing authentication.py in .Azure\cliextensions\azure-cli-ml\azureml\core. Removing the ‘async_persist=False’ parameter seems to have done thr trick.
I had the same issue with version 2.30.
It did work with 2.29.
I used the command below to change from 2.30 to 2.29.
python -m pip install -U --force-reinstall pip pip install azure-cli==2.29
Yes, Thanks. It solves that error by using
sudo apt-get install azure-cli=2.29.2-1~focal;
but it asks for az login again.I guess I need to write that step manually again.
Update:
Finally it works!!
Access service principal details in script
did you add the cli software repo by running AZ_REPO=$(lsb_release -cs) echo “deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main” | sudo tee /etc/apt/sources.list.d/azure-cli.list
if sudo apt-get install azure-cli=2.29.2-1~bionic is not working for you try with
sudo apt-get install azure-cli=2.29.2-1~focus
hope you are following all the commands including the removal of the current version from the Agent
apt-cache policy azure-cli running this will list all available versions for your distribution. you can pick the right 2.29.2 version from there if your agent is ubuntu 20.4 bionic may not be the right version mine was 18.04 and bionic worked
Thanks, @Jerry1309 this works great as a work-around, thanks for posting/sharing so we can all get temporarily unblocked!
Silly comment, but could you edit your formatting so that the first/initial line is also included in the code block region? This initially didn’t work for me b/c the COPY CODE feature of the site doesn’t include the first line of your script and I missed porting it in my first-pass attempt at duplicating your success for our own pipeline 😛
(just a suggestion to save others some time troubleshooting if/when they also attempt to repro based on your post, thanks again!)
Getting the same error here, any news on updates or quick fixes?
im having the same error, any updates? please
I tried @jhliberis method but was not working for me and then i tried downgrading az cli to 2.29.1 as suggested by @Mossaka , and downgrading worked for me. I am using self hosted agent and i ran below command for downgrading: sudo apt-get install azure-cli=2.29.1-1~bionic