Am using Azure's CustomScriptExtension to run a script on VM after it gets provisioned. I use the following PowerShell command,
Set-AzureVMCustomScriptExtension -FileUri <location of script> -Run <filename.ps1> | Update-AzureVM
I would like to know whether the file should always be in an Azure Container to be downloaded from? Can i have the file in any other repository, like Amazon S3? I tried with a S3 location URL but got the following exception.
2015-01-28T22:53:27.9760918Z[Fatal]:Failed to download all specified files. Exiting. Exception: Microsoft.WindowsAzure.Storage.StorageException: Operation is not valid due to the current state of the object. ---> System.InvalidOperationException: Operation is not valid due to the current
state of the object.
at Microsoft.WindowsAzure.Storage.Blob.CloudBlobClient.<>c__DisplayClass13.<GetBlobReferenceImpl>b__12(RESTCommand`1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx)
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
at Microsoft.WindowsAzure.GuestAgent.Plugins.CustomScriptHandler.Program.DownloadFiles(IList`1 fileUriStrs, ProtectedSettings storageAccountSettings, String downloadDir) in x:\btsdx\310211\services\art\Plugins\CustomScriptHandler\src\Program.cs:line
492
at Microsoft.WindowsAzure.GuestAgent.Plugins.CustomScriptHandler.Program.Main(String[] args) in x:\btsdx\310211\services\art\Plugins\CustomScriptHandler\src\Program.cs:line 263
Am able to download the file when i enter the same S3 URL in a browser window. Does it mean that only files from Azure container will be executed by CustomScriptExtension?
Kindly advise.
Thanks,
Anish