The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Azure Virtual Machines!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
VMSS - Custom Script Error RRS feed

  • Question

  • Hey All!     

    I'm trying to deploy a VMSS environment to our customer and they need to update their app with a powershell script. 
    This script works with to files (update.ps1 and server.ini). I tried this way:

    $customConfig = @{
        "fileUris" = (,"https://stggpv2asrpda.blob.core.windows.net/vhds/Server.ini",
                       "https://stggpv2asrpda.blob.core.windows.net/vhds/Update-Product.ps1");
        "commandToExecute" = "powershell -ExecutionPolicy Unrestricted -File Update-Product.ps1 portaldeassinaturas -step app -skipStartServices Y -skipPackageSelect y"
    }

    And

    Add-AzureRmVmssExtension -VirtualMachineScaleSet $vmss `
        -Name "PDA_Update" `
        -Publisher "Microsoft.Compute" `
        -Type "CustomScriptExtension" `
        -TypeHandlerVersion 1.9 `
        -Setting $CustomConfig

    But isn't working....

    In Microsoft official doc, when a file is storgae blob, we need use paraments like:

    "protectedSettings": {
                "commandToExecute": "myExecutionCommand",
                "storageAccountName": "myStorageAccountName",
                "storageAccountKey": "myStorageAccountKey"

    But how could I do this on my powershell (on $custom config)?

    Thanks!


    • Edited by RDrummond Wednesday, April 4, 2018 5:47 PM
    Wednesday, April 4, 2018 5:46 PM

Answers

All replies