I'm trying to pick up a passed-in argument to a PowerShell DSC configuration fired by Set-AzureRmVMDscExtension and not having much luck. The idea is to have a xRemoteFile section download a file at a URL in the arguments. The URL is in $certificateSASToken
$dscConfigurationArguments = @{
certificateToken = $certificateSASToken
}
Creates the hash table of the arguments, then I'm calling;
Publish-AzureRmVMDscConfiguration -ConfigurationPath ".\DSC\webserver.ps1" -ResourceGroupName "MyResourceGroup" -StorageAccountName "MyStorageAccount" -Force
and then finally;
Set-AzureRmVMDscExtension -Version 2.72 -ResourceGroupName "MyResourceGroup" -VMName "WebServer1" -ArchiveStorageAccountName "MyStorageAccount" -ArchiveBlobName "webserver.ps1.zip" -AutoUpdate:$true -ConfigurationName "WebServer" -ConfigurationArgument $dscConfigurationArguments
In the DSC configuration there's
xRemoteFile TLSCertificateDownload
{
Uri = $certificateToken['certificateToken']
DestinationPath = "C:\webcert.pfx"
MatchSource = $false
}
DSC fails because $certificateToken is null. The hash table of config gets all the way through fine because I missed the index on it the first time and it complained that a system object hash table wasn't a URL. Why isn't this getting passed through?