I'm trying to deploy an azure cloud service web role, a simple app to test connecting to Hive via odbc. In order to do so, I need to install the hive odbc driver on the machine before I launch the app, which is why I've added a startup task that calls a powershell script to download the driver than installs it like so:
startup.cmd
@echo off
powershell -command "Set-ExecutionPolicy Unrestricted" 2>> err.out
powershell .\dlHiveOdbcDriver.ps1 2>> err.out
hiveodbc.msi /passive
dlHiveOdbcDriver.ps1
(new-object system.net.webclient).downloadfile('https://download.microsoft.com/download/F/4/A/F4A2CA7D-5D14-4177-A7CE-B938EF3F3C24/HiveODBC32.msi', 'hiveodbc.msi')
My serviceDefinition has the following code to declare the startup task
<WebRole name="SomeTest" vmsize="ExtraSmall">
<Startup>
<Task commandLine="startup.cmd" taskType="simple" executionContext="elevated" />
</Startup>
...
</WebRole>
However, when I deploy the app, I still get the following error
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
which insinuates that the driver was not installed. I've tried restarting the app, made sure all the pre-requisites (scripts in root folder, copy always, executionPolicy etc') have been applied, but to no avail. Unfortunately I cannot remote into the machine currently, due to office issues...
Any help would be highly appreciated.
I nearly forgot to update this. It turns out Azure uses by default x64 architecture for the IIS websites they host on their VMs in their Cloud Service Web Roles. On top of that they have a Hive odbc driver pre-installed as well, however they used the x86 driver rather than the x64 one. I was trying to install the x86 driver as well- so the task was working just as it should have. I have raised an issue with Azure to fix this, in case anyone suffered from this issue too.