We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I am using powershell commands the settings property is not setting up in the extension, but its working with az cli command.
Powershell Commands: $storageAccountName = "SAName" $reRunId = string.Guid $fileURI = @("https://SAName.blob.core.windows.net/linux/linux.sh", "https://SAName.blob.core.windows.net/linux/file1.conf", "https://SAName.blob.core.windows.net/linux/file2.sh") $ScriptSettings = @{"fileUris" = $fileURI ; "commandToExecute" = 'bash ./linux.sh'}; $ProtectedSettings = @{"storageAccountName" = $storageAccountName; "storageAccountKey" = $storageAccountKey}; Set-AzVMExtension -ResourceGroupName 'RGName' -Location 'SoutheastAsia' -VMName 'VMName' -Name "CustomScript" -Publisher "Microsoft.Azure.Extensions" -TypeHandlerVersion 2.1 -ExtensionType "CustomScript" -Settings $ScriptSettings -ProtectedSettings $ProtectedSettings -ForceRerun $reRunId
PS Commands Extension output: Get-AzVMExtension -ResourceGroupName 'rg-name' -VMName 'VMName' | Where-Object Name -EQ 'customScript' ResourceGroupName : rg-name VMName : VMName Name : CustomScript Location : southeastasia Etag : {} Publisher : Microsoft.Azure.Extensions ExtensionType : CustomScript TypeHandlerVersion : 2.1 Id : /subscriptions/xxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/rg-name/providers/Microsoft.Compute/virtualMachines/vmname/extensions/CustomScript PublicSettings : ProtectedSettings : ProvisioningState : Succeeded Statuses : SubStatuses : AutoUpgradeMinorVersion : True ForceUpdateTag : EnableAutomaticUpgrade :
AZ CLI Commands: az vm extension set --resource-group 'rg-name' --vm-name 'vmname' --name "customScript" --publisher Microsoft.Azure.Extensions.customScript --settings (($ScriptSettings | ConvertTo-Json -Compress).Replace("""","\""")) --protected-settings (($ProtectedSettings | ConvertTo-Json -Compress).Replace("""",""""))
--resource-group 'rg-name'
--name "customScript"
--settings (($ScriptSettings | ConvertTo-Json -Compress).Replace("""","\"""))
AZ CLI Extension output: Get-AzVMExtension -ResourceGroupName 'rg-name' -VMName 'vmname' | Where-Object Name -EQ 'customScript'
ResourceGroupName : rg-name VMName : vmname Name : customScript Location : southeastasia Etag : {} Publisher : Microsoft.Azure.Extensions ExtensionType : customScript TypeHandlerVersion : 2.1 Id : /subscriptions/xxxxxxxxxxxxxxxxxxxxx/resourceGroups/rg-name/providers/Microsoft.Compute/virtualMachines/vmname/extensions/customScript PublicSettings : { "commandToExecute": "bash ./linux.sh", "fileUris": [ "https://SAName.blob.core.windows.net/linux/linux.sh", "https://SAName.blob.core.windows.net/linux/file1.conf", "https://SAName.blob.core.windows.net/linux/file2.sh" ] } ProtectedSettings : ProvisioningState : Succeeded Statuses : SubStatuses : AutoUpgradeMinorVersion : True ForceUpdateTag : EnableAutomaticUpgrade :
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When I am using powershell commands the settings property is not setting up in the extension, but its working with az cli command.
Powershell Commands:
$storageAccountName = "SAName"
$reRunId = string.Guid
$fileURI = @("https://SAName.blob.core.windows.net/linux/linux.sh", "https://SAName.blob.core.windows.net/linux/file1.conf", "https://SAName.blob.core.windows.net/linux/file2.sh")
$ScriptSettings = @{"fileUris" = $fileURI ; "commandToExecute" = 'bash ./linux.sh'};
$ProtectedSettings = @{"storageAccountName" = $storageAccountName; "storageAccountKey" = $storageAccountKey};
Set-AzVMExtension -ResourceGroupName 'RGName' -Location 'SoutheastAsia' -VMName 'VMName' -Name "CustomScript" -Publisher "Microsoft.Azure.Extensions" -TypeHandlerVersion 2.1 -ExtensionType "CustomScript" -Settings $ScriptSettings -ProtectedSettings $ProtectedSettings -ForceRerun $reRunId
PS Commands Extension output:
Get-AzVMExtension -ResourceGroupName 'rg-name' -VMName 'VMName' | Where-Object Name -EQ 'customScript'
ResourceGroupName : rg-name
VMName : VMName
Name : CustomScript
Location : southeastasia
Etag : {}
Publisher : Microsoft.Azure.Extensions
ExtensionType : CustomScript
TypeHandlerVersion : 2.1
Id : /subscriptions/xxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/rg-name/providers/Microsoft.Compute/virtualMachines/vmname/extensions/CustomScript
PublicSettings :
ProtectedSettings :
ProvisioningState : Succeeded
Statuses :
SubStatuses :
AutoUpgradeMinorVersion : True
ForceUpdateTag :
EnableAutomaticUpgrade :
AZ CLI Commands:
az vm extension set
--resource-group 'rg-name'
--vm-name 'vmname'
--name "customScript"
--publisher Microsoft.Azure.Extensions.customScript
--settings (($ScriptSettings | ConvertTo-Json -Compress).Replace("""","\"""))
--protected-settings (($ProtectedSettings | ConvertTo-Json -Compress).Replace("""",""""))
AZ CLI Extension output:
Get-AzVMExtension -ResourceGroupName 'rg-name' -VMName 'vmname' | Where-Object Name -EQ 'customScript'
ResourceGroupName : rg-name
VMName : vmname
Name : customScript
Location : southeastasia
Etag : {}
Publisher : Microsoft.Azure.Extensions
ExtensionType : customScript
TypeHandlerVersion : 2.1
Id : /subscriptions/xxxxxxxxxxxxxxxxxxxxx/resourceGroups/rg-name/providers/Microsoft.Compute/virtualMachines/vmname/extensions/customScript
PublicSettings : {
"commandToExecute": "bash ./linux.sh",
"fileUris": [
"https://SAName.blob.core.windows.net/linux/linux.sh",
"https://SAName.blob.core.windows.net/linux/file1.conf",
"https://SAName.blob.core.windows.net/linux/file2.sh"
]
}
ProtectedSettings :
ProvisioningState : Succeeded
Statuses :
SubStatuses :
AutoUpgradeMinorVersion : True
ForceUpdateTag :
EnableAutomaticUpgrade :
The text was updated successfully, but these errors were encountered: