0
votes

I am currently building an ARM Template that deploys the following.

  1. App Service Plan
  2. App Service
  3. MS Deploy .NET Core Application on the App Service

The problem is that after the .NET Core Application is deployed I want to execute a command in the console. I have tried a couple of different ways to do it via the CustomScriptExtension, but I keep getting :

"No route registered for '/CustomScriptExtension?api-version=2015-06-15'"

Which makes me think that the Custom Script Extensions are supported for VMs only and not for App Services (I am a bit new to ARM Templating and there is nothing useful I could find in the Azure Quickstart Templates).

Any suggestions on how I can execute a simple command in the App Service command promt via an ARM Template ?

1
CustomScriptExtension is for VM's, I believe4c74356b41
@4c74356b41 yep. My understanding as well. I am looking for the alternative for app services :)nsgocev

1 Answers

0
votes

I use the runcommand option of msdeploy to run a command after deployment. In my case I added a manifest.xml to the root of the zip file that will be deployed:

<MSDeploy.iisApp>
    <runcommand path="move D:\home\site\wwwroot\applicationHost.xdt D:\home\site\" dontUseCommandExe="true" MSDeploy.MSDeployKeyAttributeName="path" />
</MSDeploy.iisApp>

The "MSDeploy.MSDeployKeyAttributeName="path"" is important. More details here.

The content of the path attribute will be executed on the remote mashine.

I hope this helps, KirK