none
Artifact not installing custom software RRS feed

  • Question

  • I have a custom application I'm trying to install as an artifact.  The app doesn't have a silent installer so I had to write a powershell script to issue the keystrokes.  

    When I run the script manually the software is installed without issue, after I turned it into an Artifact the app isn't installed.

    The script executes the following tasks:

    * Mount the Azure file share

    * Copy the app to a local folder

    * Disable UAC

    * Run installer as domain admin

    After all the artifacts are applied I can log in and see the first 3 tasks were successful.

    Is there any way I can get more details out of the logs or see what's actually preventing the installer from launching?

    This is the first error I see in the log

    type "System.IntPtr"."
    At C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.9.5\Downloads\
    4\privaterepo000\master\e8f0409e64d2700091df74700001ded7f80bcdee\Artifacts\software
    Install\scripts\appInstall.ps1:82 char:1
    + [SFW]::SetForegroundWindow($fw)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodException
        + FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument
     
    get-process : Cannot find a process with the name "MYPROCESS". Verify the 
    process name and call the cmdlet again.

    Friday, September 20, 2019 9:24 PM

All replies

  • I enabled powershell logging through group policy and found the problem.

    The installer needs to be called with a domain admin account but Azure is running it as a local admin.

    Now I'm looking for the best way to run the installer using domain admin creds and have it not prompt me for creds.

    Tuesday, September 24, 2019 10:02 PM
  • @David Maximoff IT, Thanks for sharing your experience. I hope you were able to resolve this issue. Correct me if I've misunderstood your post and let me know if you need any further assistance on this.
    Tuesday, October 1, 2019 3:19 PM
    Moderator
  • I still don't have it working.  I think the main issue is the program needs to be run as a domain admin and the Azure client appears to run it as the SYSTEM account.  I've tried changing system policies to allow the SYSTEM account to run the installer and interact with the desktop but it's still not working.

    If I log into the machine as a domain admin or even local admin it runs fine.

    I would appreciate any suggestions you have.

    Thanks,

    Dave

    Tuesday, October 1, 2019 4:58 PM
  • Hi David Maximoff,

    IMO by default the Azure Automation runbooks run in the context of Local System account for Windows and nxautomation user account for Linux. You may use Credential and Certificate assets in your runbook with cmdlets that allow you to specify credentials and try to authenticate to install your custom application by running as user account that has permission to install it (i.e., in your words, by running using domain admin account credentials).

    If it doesn't help then you may use Hybrid Worker feature of Azure Automation to run runbooks directly on the machine that's hosting the role and against resources in the environment to manager local and other resources. And then while specifying a RunAs account for a Hybrid worker group, change RunAs from Default to Custom and select custom created Credential asset.

    IMO the best way to accomplish your requirement is by leveraging Azure Automation DSC instead of runbooks and see if it helps without any default user account related issue.

    Hope this helps!
    Thursday, October 3, 2019 11:09 AM
    Moderator
  • Thank you for the reply Krishna.  I haven't spent any time on Runbooks or Automation DSC.  

    I'll read up on them and see if I can get it working.

    Monday, October 7, 2019 5:03 PM