title: How to deploy a bot framework app to azure using a zip file and an ARM template?
body: <p>We're trying to deploy a prebuilt bot artefact into tenants via ARM deployments kicked off with REST APIs. We're struggling to replicate the actions of a gui based deployment from vs code / visual studio given that all the docs use the az cli. A manual deploy ends up with an app that includes dlls at the top level whereas our current route doesn't include the built dlls.</p>
  <p>Our pipeline for producing our bot artifact is:</p>
  <pre><code>- task: VSBuild@1
    inputs:
      solution: '$(solution)'
      msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation=&quot;$(build.artifactStagingDirectory)\WebApp.zip&quot; /p:DeployIisAppPath=&quot;Default Web Site&quot;'
      platform: '$(buildPlatform)'
      configuration: '$(buildConfiguration)'
  
  - task: AzureCLI@2
    inputs:
      azureSubscription: 'GoSmarter Azure Service Connection'
      scriptType: 'ps'
      scriptLocation: 'scriptPath'
      scriptPath: 'az-Prepare.ps1'
  </code></pre>
  <p>Where az-Prepare.ps1 includes <code>az bot prepare-deploy --lang Csharp --code-dir $codeDirectory --proj-file-path $projectFileName</code> to produce the zip of the bot app so that we can put it into blob storage for use in the ARM template.</p>
  <p>We then use an MSDeploy ARM resource to deploy this zip file as part of a bigger provisioning step.</p>
  <pre><code>    {
        &quot;name&quot;: &quot;MSDeploy&quot;,
        &quot;type&quot;: &quot;extensions&quot;,
        &quot;location&quot;: &quot;[variables('resourcesLocation')]&quot;,
        &quot;apiVersion&quot;: &quot;2015-08-01&quot;,
        &quot;dependsOn&quot;: [
          &quot;[resourceId('Microsoft.Web/sites', variables('webAppName'))]&quot;
        ],
        &quot;tags&quot;: {
          &quot;displayName&quot;: &quot;deployArchive&quot;
        },
        &quot;properties&quot;: {
          &quot;packageUri&quot;: &quot;[concat(variables('source'),'qnabotarchive.zip',parameters('SasToken'))]&quot;,
          &quot;dbType&quot;: &quot;None&quot;,
          &quot;connectionString&quot;: &quot;&quot;
        }
      }
  </code></pre>
  <p>We tried setting the Kudu App Setting for triggering builds to true but this doesn't seem to apply to MSDeploy provided zips so doesn't do a promotion of the dlls.</p>
  <pre><code>        {
            &quot;name&quot;: &quot;SCM_DO_BUILD_DURING_DEPLOYMENT&quot;,
            &quot;value&quot;: &quot;true&quot;
          }
  </code></pre>
  <p>Does anyone know what the right way is to configure the build, the app and/or the ARM template for the bot deployment to provide the dlls at the top level?</p>