I am running following AWS CLI command on Windows powershell. It is reporting that I have not specified ParameterValue for ParameterKey KeyName but I have. Why is this command isn't working?
PS C:\Users\Manu> aws cloudformation create-stack --stack-name vpn --template-url https://s3.amazonaws.com/awsinaction/chapter5/vpn-cloudformation.json --para
meters ParameterKey=KeyName, ParameterValue=mykey ParameterKey=VPC, ParameterValue=$VpcId ParameterKey=Subnet, ParameterValue=$SubnetId ParameterKey=IPSecShar
edSecret, ParameterValue=$SharedSecret ParameterKey=VPNUser, ParameterValue=vpn ParameterKey=VPNPassword, ParameterValue=$Password
An error occurred (ValidationError) when calling the CreateStack operation: ParameterValue for ParameterKey KeyName is required
Powershell is having difficulty parsing that comma and thereby loses the ParameterValue afterwards. Wrap the complete section after --parameter in double-quotes, so that it would be able to resolve it.
I would still suggest you to use AWS Tools for Powershell which is far more easier to deal all these.
Hope it helps.
Related
"commandToExecute": "powershell.exe -executionpolicy Unrestricted -File "./Add-WVDHostToHostpoolSpringORG4T.ps1" "
fails with the below error
Error: Code="VMExtensionProvisioningError" Message="VM has reported a failure when processing extension 'CustomScriptExtension'. Error message: "Command execution finished, but failed because it returned a non-zero exit code of: '1'. The command had an error output of: 'At \r\nC:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.10.12\Downloads\0\Add-WVDHostToHostpoolSpringORG4T.ps1:1 \r\nchar:1\r\n+ <#\r\n+ ~~\r\nThe terminator '#>' is missing from the multiline comment.\r\n + CategoryInfo : ParserError: (:) [],...' For more information, check the instance view by executing Get-AzVmssVm or Get-AzVm (https://aka.ms/GetAzVm). These commands can be executed using CloudShell (https://aka.ms/CloudShell)"\r\n\r\nMore information on troubleshooting is available at https://aka.ms/VMExtensionCSEWindowsTroubleshoot "
│
• I would suggest you to please try executing the powershell script on a separate test VM first to ensure that the desired results are being achieved through the script. Also, would suggest you to please refer the below community thread for the appropriate usage of parameters to be used in custom script extension while deploying powershell script through it.
Install applications or software on Azure VM with ARM Template
Also, according to the error that you have encountered, it seems that you have missed adding a ‘#’ mark before as a prefix to the supposed comment remark in the script due to which the powershell script when executed is giving out an error stating the same. Or else that you might have added an extra ‘#’ mark before a supposed legit powershell command in the script due to which the script didn’t get executed and is giving out this error.
Kindly refer the below community thread also for more details into this: -
powershell is missing the terminator: "
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 have a function in my Lambda named my-s3-function. I need to add this dependency to my Lambda Node.JS. I have followed this part to update the script with dependency included (though, I didn't follow the step wherein I need to zip the folder using zip -r function.zip . but instead I zip the folder by right-clicking it on my PC).
The zip file's structured like this inside:
|node_modules
|<folders>
|<folders>
|<folders>
... // the list goes on
|index.js
|package_lock.json
Upon typing the code aws lambda update-function-code --function-name my-s3-function --zip-file fileb://function.zip to the terminal, I get the following response:
An error occurred (MissingAuthenticationTokenException) when calling the UpdateFunctionCode operation: Missing Authentication Token
What should I do to resolve this?
Based on the comments , this got resolved by configuring the credentials as described in the documentation.
Try first with exporting the credentials as described Environment variables to configure the AWS CLI. Once you are sure your credentials are correct then you can follow this Configuration and credential file
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)