Platform: MacOS Sierra
Version: Azure CLI 2.0
Mode: ARM
I'm trying to access file storage with below command:
az storage file list --share-name $SHARE_NAME --account-name $ACCT_NAME --account-key $ACCT_KEY
But I always get ConnectionError. I also tried other file storage command, same error all the time. Tried to search online, didn't find anything.
Can anyone help?
Edit
Answers to those who asked for the "full message" of the error. "ConnectionError" is ALL the error message the Azure CLI gave me. nothing more.
You can run the command with the --debug flag to get additional diagnostics information. Furthermore, you can add an issue at https://github.com/azure-azure-cli/issues to see if the product team/contributors can further help out...
Please note that some of the information displayed in the --debug trace output contains secrets (in your case, the account key), so don't blindly include it in a post on a public forum (i.e. stackoverflow or in the github issue)
Related
got a folder called data-asset which contains a yaml file with the following
type: uri_folder
name: <name_of_data>
description: <description goes here>
path: <path>
In a pipeline am referencing this using azure cli inline script using the following command az ml data create -f .yml but getting error
full error-D:\a\1\s\ETL\data-asset>az ml data create -f data-asset.yml
ERROR: 'ml' is misspelled or not recognized by the system.
Examples from AI knowledge base:
az extension add --name anextension
Add extension by name
trying to implement this https://learn.microsoft.com/en-us/azure/machine-learning/how-to-create-register-data-assets?tabs=CLI
how can a resolve this?
One of the workaround you can follow to resolve the above issue;
Based on this GitHub issue as suggested by #adba-msft .
Please make sure that you have upgraded your azure cli to latest and
Azure CLI ML extension v2 is being used.
To check and upgrade the cli we can use the below cmdlts:
az version
az upgrade
For more information please refer this similar SO THREAD|'create' is misspelled or not recognized by the system on az ml dataset create .
I did observe the same issue after trying the aforementioned suggestion by #Dor Lugasi-Gal it works for me with (in my case az ml -h) after installed the extension with az extension add -n ml -y can able to get the result of az ml -h without any error.
SCREENSHOT FOR REFERENCE:-
The azcopy to remove files failed when I tried to remove a folder with subfolders and files from a fileshare with azcopy v10.
My az copy command was as follows
azcopy rm https://<storage-account-name>.file.core.windows.net/<file-share-name>/SystemScheduledJobs-22-06-01?<sas-token> --recursive=true
The error which I was getting is
panic: inconsistent path separators. Some are forward, some are back. This is not supported.
and the stack trace
goroutine 565 [running]:
github.com/Azure/azure-storage-azcopy/v10/common.DeterminePathSeparator({0xc0071c6d00, 0x3e})
/home/vsts/work/1/s/common/extensions.go:140 +0x97
github.com/Azure/azure-storage-azcopy/v10/common.GenerateFullPath({0x0, 0x0}, {0xc0071c6d00, 0x3e})
/home/vsts/work/1/s/common/extensions.go:155 +0xe5
github.com/Azure/azure-storage-azcopy/v10/common.GenerateFullPathWithQuery({0x0, 0x248f909e0be}, {0xc0071c6d00, 0xb85c3d}, {0x0, 0x0})
/home/vsts/work/1/s/common/extensions.go:172 +0x34
github.com/Azure/azure-storage-azcopy/v10/ste.(*JobPartPlanHeader).TransferSrcDstStrings(0x248f8ec0000, 0x1853)
/home/vsts/work/1/s/ste/JobPartPlan.go:181 +0x28f
github.com/Azure/azure-storage-azcopy/v10/ste.(*jobPartMgr).ScheduleTransfers(0xc000029500, {0x17c3190, 0xc0005b2000})
/home/vsts/work/1/s/ste/mgr-JobPartMgr.go:418 +0x692
github.com/Azure/azure-storage-azcopy/v10/ste.(*jobMgr).scheduleJobParts(0xc0007a3880)
/home/vsts/work/1/s/ste/mgr-JobMgr.go:851 +0x3e
created by github.com/Azure/azure-storage-azcopy/v10/ste.NewJobMgr
/home/vsts/work/1/s/ste/mgr-JobMgr.go:180 +0x9a6
I would be really grateful if anyone could provide more insight into this issue.
I tried to reproduce in my environment using the powershell command I got result successfully.
Powershell command
azcopy rm https://<storage-account-name>.file.core.windows.net/<file-share-name>/<path>?<sas-token> --recursive=true
Output:
*FileShare Url (https://<storage-account-name>.file.core.windows.net/<file-share-name>/<path>)
SAS Token at Storage Account level..
kindly check once with path in your url and try to reproduce once again.
Reference:
azcopy remove | Microsoft Docs
I've learned how to deploy .sh scripts to Azure with Azure CLI. But it seems like I have no clear understanding of how they work.
I'm creating the script that simply unarchives a .tgz archive in a current directory of Azure Web App, and then just deletes it. Quite simple:
New-Item ./startup.sh
Set-Content ./startup.sh '#!/bin/sh'
Add-Content ./startup.sh 'tar zxvf archive.tgz; rm-rf ./archive.tgz'
And then I deploy the script like this:
az webapp deploy --resource-group Group
--name Name
--src-path ./startup.sh
--target-path /home/site/wwwroot/startup.sh
--type=startup
Supposedly, it should appear in /home/site/wwwroot/, but for some reason it never does. No matter how I try. I thought it just gets executed and then deleted automatically (since I specified it as a startup script), but the archive is there, not unarchived at all.
My stack is .NET Core.
What am I doing wrong, and what's the right way to do what I need to do? Thank you.
I don't know if it makes sense, but I think the problem might be that you're using the target-path parameter while you should be using path instead.
From the documentation you cited, when describing the Azure CLI functionality, they state:
The CLI command uses the Kudu publish API to deploy the package and can be
fully customized.
The Kudu publish API reference indicates, when describing the different values for type and especially startup:
type=startup: Deploy a script that App Service automatically uses as the
startup script for your app. By default, the script is deployed to
D:\home\site\scripts\<name-of-source> for Windows and
home/site/wwwroot/startup.sh for Linux. The target path can be specified
with path.
Note the use of path:
The absolute path to deploy the artifact to. For example,
"/home/site/deployments/tools/driver.jar", "/home/site/scripts/helper.sh".
I never tested it, I am aware that the option is not described when taking about the az webapp deploy command itself, and it may be just an error in the documentation, but it may work:
az webapp deploy --resource-group Group
--name Name
--src-path ./startup.sh
--path /home/site/wwwroot/startup.sh
--type=startup
Note that the path you are providing is the default one; as a consequence, you could safely delete it if required:
az webapp deploy --resource-group Group
--name Name
--src-path ./startup.sh
--type=startup
Finally, try including some debug or echo commands in your script: perhaps the problem can be motivated for any permissions issue and having some traces in the logs could be helpful as well.
I'm trying to deploy a new version of an already existing Azure Function using the cli using the following command:
az functionapp deployment source config-zip -g "resourcegroupeok" -n "function-app" --src MyNewFunction.zip
But I only get an error:
BadRequestError: Operation returned an invalid status code 'Bad Request'
Is there a way to increase verbosity or to have more infos on what to check?
MyNewFunction.zip contains a JAR and a host.json file.
NB: When I try to put a wrong resourge group name of a wrong function app name, I have a precise error telling me to check theses values.
Example:
The function app 'Bad-Function-App' was not found in resource group 'resourcegroupeok'. Please make sure these values are correct.
As suggested in the comment by #Marco, the correct option is --debug
I just started learning Azure by following Pluralsight course. I'm following Author's video and doing the same in my system.
To create App service, used the following command.
>az webapp create -p MahaAppServicePlan -g MAHAResourceGroup -n datingapp -l
I have already created MahaAppServicePlan app service plan, and MAHAResourceGroup resource group. Now, I am trying to create datingapp webapp. Hence, issued the command like above. But, I am getting below error.
ResourceNotFound - The Resource 'Microsoft.Web/sites/datingapp' under resource group 'MAHAResourceGroup' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
I followed the above link with the hope that some suggestion could be helpful to me, but no luck.
When googled, I've got some resources, but with my existing knowledge, I am unable to tune it to my requirement. Can anyone please suggest me how to fix the above error!
I'm not use to work with powershell but I have recreated your problem and I get this:
If you explore the log info you will see something like this:
I confirm that the error its that the app Name it's invalid, I have manually created the app service and see this:
I can see in this last image that the Runtime its mandatory which in the documentation does not say(https://learn.microsoft.com/en-us/cli/azure/webapp?view=azure-cli-latest#az-webapp-create). But if you add the -r "your choose runtime" you will execute the command with succed:
az webapp create -g MAHAResourceGroup -p MahaAppServicePlan -n webappteststackoverflow -r "DOTNETCORE|3.1"
You can see the available runtimes with this command:
az webapp list-runtimes