I have created a VMSS (VM scaleset) with the Azure portal, and I want to add a custom script extension to it to install some software on it. How do I do this? I have tried using azure vmss config extensions set with a json file, but that doesn't seem to work. My json file looks like
{
"extensionProfile":{
"extensions": [
{
"name": "bigstream spark",
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [<some files....>
],
"commandToExecute": "./installspark2.sh"
},
"protectedSettings": {
"storageAccountName": <accountname>,
"storageAccountKey": <secret>
}
}
}]
}
}
Azure CLI 1.x does not have great extension support - the 'config' usage is confusing and I wouldn't recommend it. Fortunately the new CLI 2.0 based on Python does have a sensible add extension command for scale sets. When you create one I wouldn't put a space in the extension name though.
One more thing, take a look at this tool: https://github.com/gbowerman/vmsstools/tree/master/vmssextn -
It helps out with basic extension CRUD (though shouldn't be needed so much after CLI 2.0).
Related
I have got the path of log file stored in my machine but i need the location to be changed how can it be possible to change the path
I have tried getting the log files..1st and now I want to change the path location of log file
In the host.json file, add the following code to specify the path for log files:
{
"logger": {
"fileLoggingMode": "always",
"logLevel": {
"default": "Information"
}
}
}
Firstly go to run, then paste %temp%\LogFiles\Application\Functions. , then click on Host file in the location then click on log file then you will get output:
References taken from:
Azure Function App Dependency Inject Logger not logging - Stack Overflow
I have a settings block in terraform, right now it refers a .zip file and uses the url field to refer to it. How can I refer to the .zip file locally?
PS the module is in GitHub and also available locally
Thanks
code example: (Settings block is from terraform azure vm extension)
settings = <<SETTINGS
{
"Wmfversion": "latest",
"Configuration":
{
"url": "https://....github/CreateADRootDC1.ps1.zip"
"script": "CreateADRootDC1.ps1",
"function": "CreateADRootDC1"
},
}
can I refer to the file with this syntax "source:" = "./modules/addsvms/DSC/CreateADRootDC1.ps1.zip",
I used a blob storage to achieve this:
"url" = "https://foo.blob.core.windows.net/dsc.zip" <<< get zip from this url and unzip it to a special folder on the vm
"script" = "configure.ps1" <<< load this file into memory
"function" = "AzureDscDemo" <<< call this function from inside the file
I'm running my code using the extension "Code Runner" and would like the output to be displayed word-wrapped. Currently when I run it, it displays the output all in a single line even if it's a long line.
I tried the setting "editor.wordWrap": "on".
This is how the output and editor look like:
Try adding this to your settings:
"[Log]": {
"editor.wordWrap": "on"
}
You can instead use the built-in debugger configuration for Python and set in launch configuration to use the "internalConsole"
{
"name": "run-test-py",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/myfile.py",
"console": "internalConsole"
},
so that the output appears in the Debug Console panel. The word wrapping for that panel is controlled by the Debug > Console: Word Wrap setting:
Set it to true:
"debug.console.wordWrap": false,
For the Debug Console you can use "debug.console.wordWrap": false,//default:true which was added in June 2019 with issue 72210
I have heard that Dot net core only generates dll file and the only way to run them is using the command
dotnet myapp.dll
I have a chrome extension and i am trying to do some operations . For example, on chrome extension i enter two numbers and then click send button. this triggers the native messaging and a windows executable/dll is called which takes these 2 numbers as stdin and returns the sum as stdout which would be displayed on chrome extension .
Earlier it was an exe file which was working fine. Now i have migrated the code to dotnet core 2.0 . My unit tests work fine but the dll is unable to execute . i dont see any logs as well . my best guess is that the dll is not getting called at all. somehow i have no idea how to check if the app is getting called from chrome extension
{
"name": "myapp",
"description": "myapp",
"path": "C:\\Program Files (x86)\\myapp.dll",
"type": "stdio",
"allowed_origins": [
"chrome-extension://lpfjfcebobk**************/"
]
}
UPDATE -1
I was able to solve this by creating a bat file which in turn calls the dll file by the following command
dotnet my_app.dll
Also my bat file looks like this
#echo off
:: Copyright (c) 2013 The Chromium Authors. All rights reserved.
:: Use of this source code is governed by a BSD-style license that can be
:: found in the LICENSE file.
dotnet "my_app.dll" %*
and my app_manifest looks like this
{
"name": "myapp",
"description": "myapp",
"path": "C:\\Program Files (x86)\\myapp.bat",
"type": "stdio",
"allowed_origins": [
"chrome-extension://lpfjfcebobk**************/"
]
}
So I have this issue wherein my puppet master generates a catalog, this catalog is sent to the server which then runs it, but then nothing happens.
I did a printout with:
puppet master --verbose --compile billyjean > derp
{
"tags": ["class","file","authorized_keys","node","billyjean"],
"type": "File",
"parameters": {
"source": "puppet:///modules/basetoolkit/ssh/authorized_keys",
"ensure": "file",
"path": "/home/ubuntu/.ssh/authorized_keys",
"require": "File[sshfolder]"
},
"exported": false,
"file": "/etc/puppet/manifests/site.pp",
"title": "authorized_keys",
"line": 122
},
So I am expecting it to copy my authkeys to the machine from location "modules/files/basetoolkit/ssh/authorized_keys" to the server, but nothing happens. It also seems there are other things that are not being run, but for now I am testing with this as it is the most non-critical.
On the client check
/var/lib/puppet/state/last_run_report.yaml
There is probably some problem with the code you are attempting to apply on the client
By carefully reading this quite verbose file you should see a clue to what the problem is
Seems to have worked to remove inheritances and other stuff that is deprecated or marked as "don't use", but for some reason still in most of the manual:
http://docs.puppetlabs.com/puppet/latest/reference/lang_node_definitions.html#inheritance