azure / azure-cli-extensions Goto Github PK
View Code? Open in Web Editor NEWPublic Repository for Extensions of Azure CLI.
Home Page: https://docs.microsoft.com/en-us/cli/azure
License: MIT License
Public Repository for Extensions of Azure CLI.
Home Page: https://docs.microsoft.com/en-us/cli/azure
License: MIT License
az>> group delete -n MyRG --progress
az>> Are you sure you want to perform this operation? (y/n):
At this point, you cannot perform any action exit to exit.
Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version
) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)
All extensions
The auto generating reference docs for extensions is a fantastic feature and alleviates extension teams having to build their own system for it.
However it is difficult to tell the extension version used. Theoretically the latest version should be used but given delays in syncing it would be nice to have the version somewhere obvious on the page so there is no second guessing. Not to mention having a version to point at for customers.
e.g.
docker run -it microsoft/azure-cli:latest
pip install --upgrade --target ~/.azure/cliextensions/servicebus "git+https://github.com/v-Ajnava/azure-cli-extensions@SBmasterExt#subdirectory=src/servicebus&egg=servicebus"
Add this to the PR template.
We do it for the CLI, it should be possible to do it for an extension as well.
A few things to consider:
azure-ml-admin-cli
New Windows 2016 DSVM comes with ML Server 9.3.0 preinstalled. However, running Administration Utils immediately after installation results in an error:
C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin>cd "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin" && az ml admin --help
az: error: argument _command_package: invalid choice: ml
usage: az [-h] [--verbose] [--debug] [--output {json,jsonc,table,tsv}]
[--query JMESPATH]
{acr,acs,aks,advisor,webapp,appservice,functionapp,backup,batch,batchai,billing,cdn,cloud,cognitiveservices,configure,consumption,container,cosmosdb,dla,dls,eventgrid,extension,feedback,find,interactive,iot,keyvault,lab,monitor,network,login,logout,account,mysql,postgres,redis,reservations,group,resource,provider,feature,tag,policy,lock,managedapp,role,ad,sf,sql,storage,disk,identity,image,snapshot,vm,vmss}
...
VM version: microsoft-ads:windows-data-science-vm:windows2016:18.02.00
C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin>az --version
azure-cli (2.0.27)
acr (2.0.21)
acs (2.0.26)
advisor (0.1.2)
appservice (0.1.26)
backup (1.0.6)
batch (3.1.10)
batchai (0.1.5)
billing (0.1.7)
cdn (0.0.13)
cloud (2.0.12)
cognitiveservices (0.1.10)
command-modules-nspkg (2.0.1)
configure (2.0.14)
consumption (0.2.1)
container (0.1.18)
core (2.0.27)
cosmosdb (0.1.19)
dla (0.0.18)
dls (0.0.19)
eventgrid (0.1.10)
extension (0.0.9)
feedback (2.1.0)
find (0.2.8)
interactive (0.3.16)
iot (0.1.17)
keyvault (2.0.18)
lab (0.0.17)
monitor (0.1.2)
network (2.0.23)
nspkg (3.0.1)
profile (2.0.19)
rdbms (0.0.12)
redis (0.2.11)
reservations (0.1.1)
resource (2.0.23)
role (2.0.19)
servicefabric (0.0.10)
sql (2.0.21)
storage (2.0.25)
vm (2.0.26)
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\labdsvm-admin.azure\cliextensions'
Python (Windows) 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)]
Legal docs and information: aka.ms/AzureCliLegal
scripts/ci/test_integration.py
no longer exists but it is still referenced in https://github.com/Azure/azure-cli-extensions/blob/master/.github/PULL_REQUEST_TEMPLATE.md
webapp
az webapp new
currently only looks for *.csproj
to determine if it's a .NET project. It should also look for *.vbproj
and *.fsproj
.
Consider adding support for extension aliases.
Currently, CI verifies that the name in the index matches the name of the extension as defined by the .whl file.
Tracking Azure/azure-cli#5130
Linux UbuntuDesktop01 4.13.0-32-generic #35~16.04.1-Ubuntu SMP Thu Jan 25 10:13:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
https://docs.microsoft.com/en-us/azure/machine-learning/preview/deployment-setup-configuration
sudo -i
pip install azure-cli
pip install azure-cli-ml
Following instructions at https://docs.microsoft.com/en-us/azure/machine-learning/preview/deployment-setup-configuration
-----------------------------------
Step: Environment Setup - To start the setup process, you need to register a few environment providers by entering the following commands:
az provider register -n Microsoft.MachineLearningCompute
Result of above command: Error loading command module 'ml'
------------------------------------
Command: az --debug
Result of above command:
Error loading command module 'ml'
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/azure/cli/core/__init__.py", line 129, in _update_command_table_from_modules
module_command_table = _load_module_command_loader(self, args, mod)
File "/usr/local/lib/python2.7/dist-packages/azure/cli/core/commands/__init__.py", line 549, in _load_module_command_loader
return _load_command_loader(loader, args, mod, 'azure.cli.command_modules.')
File "/usr/local/lib/python2.7/dist-packages/azure/cli/core/commands/__init__.py", line 523, in _load_command_loader
module = import_module(prefix + name)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/azure/cli/command_modules/ml/__init__.py", line 8, in <module>
import azure.cli.command_modules.ml._help #pylint: disable=unused-import
File "/usr/local/lib/python2.7/dist-packages/azure/cli/command_modules/ml/_help.py", line 6, in <module>
from azure.cli.core.help_files import helps
ImportError: No module named help_files
------------------------------
/usr/local/lib/python2.7/dist-packages/azure/cli/command_modules/ml/_help.py
Line 6: from azure.cli.core.help_files import helps
After using az interactive
users find they now have a ~/.azure-shell
directory, which is confusing to Azure Cloud Shell users who expect this directory to relate to the cloud-shell feature in portal.
$ ls -A
.azure .bash_history .bash_logout .bashrc .cache clouddrive .profile temp.azcli
$ az interactive
$ la -A
.azure .azure-shell .bash_history .bash_logout .bashrc .cache clouddrive .config .profile temp.azcli
Getting os disk id of the source vm/image
'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 194, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 342, in execute
six.reraise(*sys.exc_info())
File "/opt/az/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 315, in execute
result = cmd(params)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 175, in call
return super(AzCliCommand, self).call(*args, **kwargs)
File "/opt/az/lib/python3.6/site-packages/knack/commands.py", line 109, in call
return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/init.py", line 349, in default_command_handler
result = op(**command_args)
File "/home/Wolfthorne/.azure/cliextensions/image-copy-extension/azext_imagecopy/custom.py", line 27, in imagecopy
source_os_disk_id = json_cmd_output['storageProfile']['osDisk']['managedDisk']['id']
TypeError: 'NoneType' object is not subscriptable
When errors happen with --progress
set, errors cause the output to become corrupted.
az>> az vm create -g MyRG -n MyVM --image UbuntuLTS --progress
az>> Exception in thread Thread-120:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inn
self.run()
File "/Users/jasonsha/lib/azure-cli/lib/python2.7/site-packages/azclishell/app.py", line 736, in run
self.func(self.args)
File "/Users/jasonsha/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/application.py", line 211, in execute
result = expanded_arg.func(params)
File "/Users/jasonsha/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 346, in __cal
return self.handler(*args, **kwargs) *--image:
File "/Users/jasonsha/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 542, in _exec
exception_handler(ex) *URN, Custom Image name or ID, or VHD Blob URI).
File "/Users/jasonsha/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/arm.py", line 66, in handle_long
raise cli_error *be replaced by others (for example, `--attach-os-disk`).
CLIError: Deployment failed. { *
"error": {--------------------------------------------------------------------------------------------------------------
"code": "Conflict",ntu VM with automatic SSH authentication.
"message": "The request failed due to conflict with a concurrent request. "
}
}2] Create a simple Windows Server VM with a private IP address.
az vm create -n MyVm -g MyResourceGroup
az>>
Using interactive mode should feel fluid, but when exploring the command structure for a service, I don't find the terse nature of the argument exception usage being helpful.
$ az interactive
az>> monitor
az monitor: error: the following arguments are required: subcommand
usage: az monitor [-h]
{alert,metrics,log-profiles,diagnostic-settings,autoscale-settings,activity-log}
...
az>> monitor
interactive-mode showing help:
az monitor: Commands to manage Azure Monitor service.
Subgroups:
activity-log : Commands to manage activity log.
alert : Commands to manage metric-based alert rules.
autoscale-settings : Commands to manage autoscale settings.
diagnostic-settings: Commands to manage service diagnostic settings.
log-profiles : Commands to manage the log profiles assigned to Azure subscription.
metrics : Commands to view Azure resource metrics.
Install Method: apt-get
CLI Version:
azure-cli (2.0.24)
acr (2.0.18)
acs (2.0.23)
advisor (0.1.1)
appservice (0.1.23)
backup (1.0.4)
batch (3.1.8)
batchai (0.1.4)
billing (0.1.7)
cdn (0.0.11)
cloud (2.0.11)
cognitiveservices (0.1.10)
command-modules-nspkg (2.0.1)
configure (2.0.13)
consumption (0.2.1)
container (0.1.16)
core (2.0.24)
cosmosdb (0.1.16)
dla (0.0.16)
dls (0.0.19)
eventgrid (0.1.7)
extension (0.0.7)
feedback (2.0.7)
find (0.2.8)
interactive (0.3.12)
iot (0.1.16)
keyvault (2.0.16)
lab (0.0.14)
monitor (0.0.14)
network (2.0.20)
nspkg (3.0.1)
profile (2.0.17)
rdbms (0.0.10)
redis (0.2.11)
reservations (0.1.1)
resource (2.0.20)
role (2.0.16)
servicefabric (0.0.8)
sql (2.0.18)
storage (2.0.22)
vm (2.0.23)
Python location '/opt/az/bin/python3'
Extensions directory '/home/tda/.azure/cliextensions'
Python (Linux) 3.6.1 (default, Jan 5 2018, 21:18:08)
[GCC 4.8.4]
OS Version:
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
Shell: bash
Issue:
az interactive
. Output:az>> Command: provider list not in Command Table
Command: sql db op cancel not in Command Table
Command: storage account generate-sas not in Command Table
az>> group create -n test -l westeurope -o json
az>> group delete -n test -y
'NoneType' object has no attribute 'init_progress'
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 193, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 319, in execute
six.reraise(*sys.exc_info())
File "/opt/az/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 303, in execute
result = LongRunningOperation(self.cli_ctx, 'Starting {}'.format(cmd.name))(result)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 438, in __call__
self.cli_ctx.get_progress_controller().begin()
File "/opt/az/lib/python3.6/site-packages/azclishell/app.py", line 679, in progress_patch
self.cli_ctx.progress_controller.init_progress(ShellProgressView())
AttributeError: 'NoneType' object has no attribute 'init_progress'
'int' object has no attribute 'result'
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/azclishell/app.py", line 660, in cli_execute
if result and result.result is not None:
AttributeError: 'int' object has no attribute 'result'
az>>
Additional Information:
The group is deleted but the it exits immediately without waiting for the completion (without --no-wait
)
The intellisence / autocompletion does not seem to work either
webapp
Looks like the new support for .NET may have caused Node.js projects to no longer work. Repro:
bash-4.3# git clone https://github.com/scotch-io/node-todo.git
Cloning into 'node-todo'...
remote: Counting objects: 464, done.
remote: Total 464 (delta 0), reused 0 (delta 0), pack-reused 464
Receiving objects: 100% (464/464), 61.07 KiB | 0 bytes/s, done.
Resolving deltas: 100% (163/163), done.
Checking connectivity... done.
bash-4.3# cd node-todo/
bash-4.3# ls
README.md README_es.md app config license package.json public server.js
bash-4.3# az webapp new -n test-node-todo
list index out of range
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/knack/cli.py", line 194, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 331, in execute
six.reraise(*sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 304, in execute
result = cmd(params)
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 168, in __call__
return super(AzCliCommand, self).__call__(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/knack/commands.py", line 109, in __call__
return self.handler(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 348, in default_command_handler
result = op(**command_args)
File "/root/.azure/cliextensions/webapp/azext_webapp/custom.py", line 50, in create_deploy_webapp
lang_details = get_lang_from_content(src_dir)
File "/root/.azure/cliextensions/webapp/azext_webapp/create_util.py", line 113, in get_lang_from_content
package_netcore_file = os.path.join(src_path, glob.glob("*.csproj")[0])
IndexError: list index out of range
bash-4.3#
I ran az interactive --debug
to get debugging output for each of my calls. However, when I do that, any kind of dynamic tab completion (which occurs on basically every command because of resource group) causes the screen to be overrun with tons of debugging text related to the tab completion REST API calls. Thus you can't even see what you were typing. There doesn't seem to be a way to turn this off.
I can't even run select calls with --debug. This just does nothing at all and prints normal output.
I can't even paste from Notepad (for example) INTO az interactive, which would at least let me get around the tab completion calls that pollute my screen. This might be a shell thing.
Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here: dev_setup.py
CLI Version: What version of the CLI and modules are installed? (Use az --version
)
Answer here: azure-cli (2.0.7+dev)
acr (2.0.5+dev)
acs (2.0.7+dev)
appservice (0.1.7+dev)
batch (3.0.0+dev)
billing (0.1.0+dev)
cdn (0.0.3+dev)
cloud (2.0.3+dev)
cognitiveservices (0.1.3+dev)
component (2.0.5+dev)
configure (2.0.7+dev)
consumption (0.1.0+dev)
core (2.0.7+dev)
cosmosdb (0.1.7+dev)
dla (0.0.7+dev)
dls (0.0.7+dev)
feedback (2.0.3+dev)
find (0.2.3+dev)
interactive (0.3.3+dev)
iot (0.1.6+dev)
keyvault (2.0.5+dev)
lab (0.0.5+dev)
monitor (0.0.5+dev)
network (2.0.7+dev)
nspkg (3.0.0+dev)
profile (2.0.5+dev)
rdbms (0.0.2+dev)
redis (0.2.4+dev)
resource (2.0.7+dev)
role (2.0.5+dev)
sf (1.0.2+dev)
sql (2.0.4+dev)
storage (2.0.7+dev)
taskhelp (0.1.2+dev)
testsdk (0.1.0+dev)
utility-automation (0.1.1)
vm (2.0.7+dev)
Python (Windows) 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)]
OS Version: What OS and version are you using?
Answer here: Win10 CU
Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here: cmd.exe
Implement a more generic solution for this.
webapp
Currently, az webapp new
does not include the website's URL as part of its output. The URL should be added to its output so the user can easily test it out.
Is there a way from the azure interactive window to save the command JSON output redirect to a file?
ie.
az>> account list --all
returns JSON output, I want to redirect the output to a file.
Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version
) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)
-this will allow the completers, which rely on the command_table, to kick in right from the get-go.
-parameter completers will not have to wait for full command table dump.
Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version
) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)
The list-available command is quite informative in its current form.
However it may be information overload for a casual user looking to see what extensions are available.
Consider a simple view by default when running list-available which shows bare minimum key properties of information (such as alias/id, name + summary, extension version(s) available with respective minCliCoreVersion, Python compatibility etc) and then an optional switch such as '--extended' which shows the full index detail.
webapp
Currently, the user needs to specify the name (az webapp new -n <name>
) to redeploy a folder. It would be great if the original deployment settings can be saved in a config file locally so that the user can simply run az webapp new
to redeploy.
2 advantages:
Planned Languages (no particular order of execution):
az interactive
vm create -n MyVM31 --image UbuntuLTS --progress
vm list
You should see the help content stays on VM create.
Seems like things break a lot in interactive and we don't realize it until people try it. Interactive needs unique, thorough test, that test the flow of information and function calls, not just tests for specific function calls.
Things to test more thoroughly:
This is not an exhaustive list and will be ongoing work
Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version
) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)
"extensionType": "whl",
"name": "image-copy-extension",
"version": "0.0.5"
Dear all,
I just write a shell based automation script to copy images from a source region in multiple target regions. I would like to change the existing tags of the source image for the target images.
I just think about to tag the target images later on, but that´s also not supported with the az cli.
Does someone know a workaround? Or it´s planned to implement tags for the extension?
Because the workaround which I use for now is like:
In addition, I don´t want to use powershell scipts because all our automations are based on Perl or shell.
Regards Sandro
Here is a list of features
--verbose
mode, output start and total time of the deploymentaz interactive -h
--progress
tasks and provide a progress history
they can look at (create a vm with --progress, but get the IP address when it is done)webapp
currently the help information for the command return the
Command
az webapp new: Create and deploy a node web app.
Requested changes:
Starting interactive mode with az interactive --verbose
and running LRO commands with --progress
causes bad outputs, no heartbeat, and the interactive UX is shown, but empty.
az>> az vm create -g MyRG -n MyVM --image UbuntuLTS --progress az>> Use existing SSH public key file: /Users/jasonsha/.ssh/id_rsa.pub Accepted: vm_deploy_YgbnsvjnymWhASelFeLWFIUfZTHpAfZZ (Microsoft.Resources/deployments) Succeeded: MyVMVMNic (Microsoft.Network/networkInterfaces) Succeeded: MyVMPublicIP (Microsoft.Network/publicIPAddresses) Succeeded: MyVMNSG (Microsoft.Network/networkSecurityGroups)
Sometimes, the source tests will fail due to 'az login' even though the recordings are correct.
This could possibly be due to the change in folder structure for recordings in Azure/azure-cli.
See also https://github.com/Azure/azure-cli/blob/dev/src/azure-cli-testsdk/azure/cli/testsdk/patches.py#L38
azure-ml-admin-cli (0.0.1)
az login no longer works to login interactively after installing ML Server 9.3.0 with its CLI extension
PS C:\> az login
The behavior of this command has been altered by the following extension: azure-ml-admin-cli
login() missing 1 required positional argument: 'cmd'
Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\knack\cli.py", line 197, in invoke
cmd_result = self.invocation.execute(args)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\commands\__init__.py", line 347, in execute
six.reraise(*sys.exc_info())
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\commands\__init__.py", line 319, in execute
result = cmd(params)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\commands\__init__.py", line 180, in __call__
return super(AzCliCommand, self).__call__(*args, **kwargs)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\knack\commands.py", line 109, in __call__
return self.handler(*args, **kwargs)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\site-packages\azure\cli\core\__init__.py", line 420, in default_command_handler
result = op(**command_args)
File "C:\Users\labdsvm-admin\.azure\cliextensions\azure-ml-admin-cli\azext_admin\custom.py", line 88, in mls_login
msi_port=msi_port)
TypeError: login() missing 1 required positional argument: 'cmd'
Install Method: MSI
OS version: Windows Server 2016 Datacenter (DSVM)
Shell Type: Powershell
PS C:\> az --version
azure-cli (2.0.30)
acr (2.0.22)
acs (2.0.30)
advisor (0.5.0)
appservice (0.1.30)
backup (1.1.0)
batch (3.1.11)
batchai (0.1.6)
billing (0.1.7)
cdn (0.0.13)
cloud (2.0.12)
cognitiveservices (0.1.11)
command-modules-nspkg (2.0.1)
configure (2.0.14)
consumption (0.2.2)
container (0.1.20)
core (2.0.30)
cosmosdb (0.1.19)
dla (0.0.18)
dls (0.0.20)
eventgrid (0.1.11)
eventhubs (0.1.1)
extension (0.0.11)
feedback (2.1.0)
find (0.2.8)
interactive (0.3.18)
iot (0.1.18)
keyvault (2.0.20)
lab (0.0.20)
monitor (0.1.4)
network (2.0.26)
nspkg (3.0.2)
profile (2.0.21)
rdbms (0.2.0)
redis (0.2.11)
reservations (0.1.1)
resource (2.0.26)
role (2.0.21)
servicebus (0.1.1)
servicefabric (0.0.11)
sql (2.0.24)
storage (2.0.30)
vm (2.0.29)
Extensions:
azure-ml-admin-cli (0.0.1)
dns (0.0.2)
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\labdsvm-admin\.azure\cliextensions'
Python (Windows) 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)]
Reopened here based on comment in Azure/azure-cli#5991
Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here:
CLI Version: What version of the CLI and modules are installed? (Use az --version
)
Answer here:
OS Version: What OS and version are you using?
Answer here:
Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here:
webapp
Many package.json files do not specify a node engine version. This value needs to have a default.
Repro:
bash-4.3# git clone https://github.com/scotch-io/node-todo.git
Cloning into 'node-todo'...
remote: Counting objects: 464, done.
remote: Total 464 (delta 0), reused 0 (delta 0), pack-reused 464
Receiving objects: 100% (464/464), 61.07 KiB | 0 bytes/s, done.
Resolving deltas: 100% (163/163), done.
Checking connectivity... done.
bash-4.3# cd node-todo/
bash-4.3# ls
README.md README_es.md app config license package.json public server.js
bash-4.3# az webapp new -n test-node-todo
list index out of range
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/knack/cli.py", line 194, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 331, in execute
six.reraise(*sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 304, in execute
result = cmd(params)
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 168, in __call__
return super(AzCliCommand, self).__call__(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/knack/commands.py", line 109, in __call__
return self.handler(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 348, in default_command_handler
result = op(**command_args)
File "/root/.azure/cliextensions/webapp/azext_webapp/custom.py", line 64, in create_deploy_webapp
data = get_runtime_version_details(lang_details.get('file_loc'), language)
File "/root/.azure/cliextensions/webapp/azext_webapp/create_util.py", line 61, in get_runtime_version_details
version_detected = parse_node_version(file_path)[0]
IndexError: list index out of range
bash-4.3#
webapp
This should fail gracefully:
bash-4.3# cd /
bash-4.3# ls
appp bin etc lib media proc run srv tmp var
azure-cli dev home linuxrc mnt root sbin sys usr
bash-4.3# az webapp new -n foo
list index out of range
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/knack/cli.py", line 194, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 331, in execute
six.reraise(*sys.exc_info())
File "/usr/local/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 304, in execute
result = cmd(params)
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 168, in __call__
return super(AzCliCommand, self).__call__(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/knack/commands.py", line 109, in __call__
return self.handler(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 348, in default_command_handler
result = op(**command_args)
File "/root/.azure/cliextensions/webapp/azext_webapp/custom.py", line 50, in create_deploy_webapp
lang_details = get_lang_from_content(src_dir)
File "/root/.azure/cliextensions/webapp/azext_webapp/create_util.py", line 113, in get_lang_from_content
package_netcore_file = os.path.join(src_path, glob.glob("*.csproj")[0])
IndexError: list index out of range
bash-4.3#
Steps to reproduce: run az webapp new -n foo
in a non-empty directory that does not contain a package.json
or a *.csproj
file.
image-copy
australiasoutheast + subscription_hash[:7]
is longer as the limit for storage accountsdirty work around in the create-target.py
subscription_hash = hashlib.sha1(subscription_id.encode("UTF-8")).hexdigest()
location_hash = hashlib.sha1(location.encode("UTF-8")).hexdigest()
unique_storage_account_string = location_hash[:11] + subscription_hash[:11]
# create the target storage account
logger.warn(
"%s - %s - Creating target storage account (can be slow sometimes)", location, unique_storage_account_string)
target_storage_account_name = unique_storage_account_string
should be uniqe enough, while still under the limit of 24 chars
In wheel (0.31.0)
(released Apr 1, 2018), the metadata.json file was removed and the CLI uses this to get metadata.
Until the CLI is fixed, build extension wheels with wheel (0.30.0)
See pypa/wheel#195
Currently, one has to actively change scope to run a different command
-similar to using a ls ~
or ls ..
on shell while in current scope.
Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version
) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)
$ az interactive
****** F1 ********
Do you want command descriptions (y/n): ********ctrl+c***********
az>>
az>>
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/azure/cli/main.py", line 36, in main
cmd_result = APPLICATION.execute(args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/application.py", line 211, in execute
result = expanded_arg.func(params)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 346, in __call__
return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 545, in _execute_command
reraise(*sys.exc_info())
File "/opt/az/lib/python3.6/site-packages/six.py", line 686, in reraise
raise value
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 522, in _execute_command
result = op(client, **kwargs) if client else op(**kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/interactive/custom.py", line 14, in start_shell
main(style=style)
File "/opt/az/lib/python3.6/site-packages/azclishell/__main__.py", line 71, in main
shell_app.run()
File "/opt/az/lib/python3.6/site-packages/azclishell/app.py", line 691, in run
document = self.cli.run(reset_current_buffer=True)
File "/opt/az/lib/python3.6/site-packages/prompt_toolkit/interface.py", line 415, in run
self.eventloop.run(self.input, self.create_eventloop_callbacks())
File "/opt/az/lib/python3.6/site-packages/prompt_toolkit/eventloop/posix.py", line 56, in run
assert not self._running
AssertionError
webapp
Running az extension add --name webapp
results in an error. "An error occurred. Pip failed with status code 1. Use --debug for more information." When run with --debug the problem seems to be related to importing libffi.so.5.
I am running WSL on Windows 10 (1709) with latest version of CLI (2.0.27)
Full output of command with --debug (click to expand)
$ az extension add --name webapp --debug
Command arguments: ['extension', 'add', '--name', 'webapp', '--debug']
Event: Cli.PreExecute []
Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f56a70142f0>, <function OutputProducer.on_global_arguments at 0x7f56a6b21ea0>, <function CLIQuery.on_global_arguments at 0x7f56a66b09d8>]
Event: CommandInvoker.OnPreCommandTableCreate [<function CLILogging.remove_logger_flags at 0x7f56a7014378>]
Installed command modules ['acr', 'acs', 'advisor', 'appservice', 'backup', 'batch', 'batchai', 'billing', 'cdn', 'cloud', 'cognitiveservices', 'configure', 'consumption', 'container', 'cosmosdb', 'dla', 'dls', 'eventgrid', 'extension', 'feedback', 'find', 'interactive', 'iot', 'keyvault', 'lab', 'monitor', 'network', 'profile', 'rdbms', 'redis', 'reservations', 'resource', 'role', 'servicefabric', 'sql', 'storage', 'vm']
Loaded module 'acr' in 0.016 seconds.
Loaded module 'acs' in 0.012 seconds.
Loaded module 'advisor' in 0.011 seconds.
Loaded module 'appservice' in 0.016 seconds.
Loaded module 'backup' in 0.011 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'batch' in 0.031 seconds.
Loaded module 'batchai' in 0.012 seconds.
Loaded module 'billing' in 0.011 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'cdn' in 0.013 seconds.
Loaded module 'cloud' in 0.012 seconds.
Loaded module 'cognitiveservices' in 0.009 seconds.
Loaded module 'configure' in 0.007 seconds.
Loaded module 'consumption' in 0.018 seconds.
Loaded module 'container' in 0.012 seconds.
Loaded module 'cosmosdb' in 0.015 seconds.
Loaded module 'dla' in 0.015 seconds.
Loaded module 'dls' in 0.011 seconds.
Loaded module 'eventgrid' in 0.012 seconds.
Loaded module 'extension' in 0.006 seconds.
Loaded module 'feedback' in 0.007 seconds.
Loaded module 'find' in 0.008 seconds.
Loaded module 'interactive' in 0.002 seconds.
Loaded module 'iot' in 0.015 seconds.
Loaded module 'keyvault' in 0.018 seconds.
Loaded module 'lab' in 0.017 seconds.
Loaded module 'monitor' in 0.020 seconds.
Loaded module 'network' in 0.037 seconds.
Loaded module 'profile' in 0.013 seconds.
Loaded module 'rdbms' in 0.014 seconds.
Loaded module 'redis' in 0.012 seconds.
Loaded module 'reservations' in 0.013 seconds.
Loaded module 'resource' in 0.015 seconds.
Loaded module 'role' in 0.012 seconds.
Loaded module 'servicefabric' in 0.009 seconds.
Loaded module 'sql' in 0.015 seconds.
Event: CommandLoader.OnLoadCommandTable []
Loaded module 'storage' in 0.044 seconds.
Loaded module 'vm' in 0.025 seconds.
Loaded all modules in 0.544 seconds. (note: there's always an overhead with the first module loaded)
Extensions directory: '/home/ben/.azure/cliextensions'
Event: CommandInvoker.OnPreCommandTableTruncate []
Event: CommandInvoker.OnPostCommandTableCreate [<function add_id_parameters at 0x7f56a48569d8>]
Event: CommandInvoker.OnCommandTableLoaded []
Event: CommandInvoker.OnPreParseArgs [<function _documentdb_deprecate at 0x7f56a4695268>]
Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f56a6b21f28>, <function CLIQuery.handle_query_parameter at 0x7f56a66b0a60>]
Extensions directory: '/home/ben/.azure/cliextensions'
urllib3.connectionpool : Starting new HTTPS connection (1): aka.ms
urllib3.connectionpool : https://aka.ms:443 "GET /azure-cli-extension-index-v1 HTTP/1.1" 301 186
urllib3.connectionpool : Starting new HTTPS connection (1): azurecliextensionsync.blob.core.windows.net
urllib3.connectionpool : https://azurecliextensionsync.blob.core.windows.net:443 "GET /index1/index.json HTTP/1.1" 200 22317
Candidates ['webapp-0.0.8-py2.py3-none-any.whl']
Candidates ['webapp-0.0.8-py2.py3-none-any.whl']
Candidates ['webapp-0.0.8-py2.py3-none-any.whl']
Candidates ['webapp-0.0.8-py2.py3-none-any.whl']
Choosing the latest of the remaining candidates.
Chosen {'filename': 'webapp-0.0.8-py2.py3-none-any.whl', 'sha256Digest': '4800c51978f7801b613f93afc62367c6646839dc4fd99c7673f4e217ba96cc58', 'downloadUrl': 'https://github.com/panchagnula/azure-cli-extensions/raw/sisirap-extensions-whl/dist/webapp-0.0.8-py2.py3-none-any.whl', 'metadata': {'classifiers': ['Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'License :: OSI Approved :: MIT License'], 'extensions': {'python.details': {'contacts': [{'email': '[email protected]', 'name': 'Sisira Panchagnula', 'role': 'author'}], 'document_names': {'description': 'DESCRIPTION.rst'}, 'project_urls': {'Home': 'https://github.com/Azure/azure-cli-extensions'}}}, 'generator': 'bdist_wheel (0.29.0)', 'license': 'MIT', 'metadata_version': '2.0', 'name': 'webapp', 'summary': 'An Azure CLI Extension to manage appservice resources', 'version': '0.0.8'}}
Extension source is url? True
Extensions directory: '/home/ben/.azure/cliextensions'
Downloading https://github.com/panchagnula/azure-cli-extensions/raw/sisirap-extensions-whl/dist/webapp-0.0.8-py2.py3-none-any.whl to /tmp/tmp4ly546cw/webapp-0.0.8-py2.py3-none-any.whl
urllib3.connectionpool : Starting new HTTPS connection (1): github.com
urllib3.connectionpool : https://github.com:443 "GET /panchagnula/azure-cli-extensions/raw/sisirap-extensions-whl/dist/webapp-0.0.8-py2.py3-none-any.whl HTTP/1.1" 302 194
urllib3.connectionpool : Starting new HTTPS connection (1): raw.githubusercontent.com
urllib3.connectionpool : https://raw.githubusercontent.com:443 "GET /panchagnula/azure-cli-extensions/sisirap-extensions-whl/dist/webapp-0.0.8-py2.py3-none-any.whl HTTP/1.1" 200 8686
Downloaded to /tmp/tmp4ly546cw/webapp-0.0.8-py2.py3-none-any.whl
Validating the extension /tmp/tmp4ly546cw/webapp-0.0.8-py2.py3-none-any.whl
Checksum of /tmp/tmp4ly546cw/webapp-0.0.8-py2.py3-none-any.whl is OK
Extension compatibility result: is_compatible=True cli_core_version=2.0.27 min_required=None max_required=None
Validation successful on /tmp/tmp4ly546cw/webapp-0.0.8-py2.py3-none-any.whl
Executing pip with args: ['install', '--target', '/home/ben/.azure/cliextensions/webapp', '/tmp/tmp4ly546cw/webapp-0.0.8-py2.py3-none-any.whl']
Running: ['/opt/az/bin/python3', '-m', 'pip', 'install', '--target', '/home/ben/.azure/cliextensions/webapp', '/tmp/tmp4ly546cw/webapp-0.0.8-py2.py3-none-any.whl', '-vv', '--disable-pip-version-check', '--no-cache-dir']
Traceback (most recent call last):
File "/opt/az/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/opt/az/lib/python3.6/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/opt/az/lib/python3.6/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/opt/az/lib/python3.6/site-packages/pip/__init__.py", line 28, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/opt/az/lib/python3.6/site-packages/pip/vcs/mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "/opt/az/lib/python3.6/site-packages/pip/download.py", line 36, in <module>
from pip.utils.glibc import libc_ver
File "/opt/az/lib/python3.6/site-packages/pip/utils/glibc.py", line 4, in <module>
import ctypes
File "/opt/az/lib/python3.6/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ImportError: libffi.so.5: cannot open shared object file: No such file or directory
Command '['/opt/az/bin/python3', '-m', 'pip', 'install', '--target', '/home/ben/.azure/cliextensions/webapp', '/tmp/tmp4ly546cw/webapp-0.0.8-py2.py3-none-any.whl', '-vv', '--disable-pip-version-check', '--no-cache-dir']' returned non-zero exit status 1.
Pip failed so deleting anything we might have installed at /home/ben/.azure/cliextensions/webapp
An error occurred. Pip failed with status code 1. Use --debug for more information.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.