How to auto-generate deploy.cmd in new Azure CLI?

Viewed 2885

I'm following this guide to create a web app with a custom deploy.cmd file. The article suggests that I can get a copy of the current deploy.cmd file (which I'll then modify) using the following command:

azure site deploymentscript --python

Unfortunately, when I install the Azure CLI using the MSI linked in the article, there is no azure binary on my path. I do have az -- is this a newer version of the same CLI? -- but I can't find an equivalent deployment script generation command for that executable.

I found a deploy.cmd file using Kudu (under D:\home\site\deployments\tools) but am not sure if that's the appropriate file to use. Can anyone suggest the right Azure CLI command for deployment script generation, or confirm that the deploy.cmd file I found is the right one to modify? Thanks in advance!

2 Answers

You can use kuduscript to generate the deployment script.

npm install -g kuduscript
kuduscript --python

Here is the list of options

Options:

    -h, --help                          output usage information
    -V, --version                       output the version number
    -r, --repositoryRoot [dir path]     The root path for the repository (default: .)
    --aspWAP <projectFilePath>          Create a deployment script for .NET web application, specify the project file path
    --aspNetCore <projectFilePath>      Create a deployment script for ASP.NET Core web application, specify the project file path
    --aspWebSite                        Create a deployment script for basic website
    --go                                Create a deployment script for Go website
    --node                              Create a deployment script for node.js website
    --ruby                              Create a deployment script for ruby website
    --php                               Create a deployment script for php website
    --python                            Create a deployment script for python website
    --functionApp [projectFilePath]     Create a deployment script for function App, specify the project file path if using msbuild
    --basic                             Create a deployment script for any other website
    --dotNetConsole <projectFilePath>   Create a deployment script for .NET console application, specify the project file path
    -s, --solutionFile <file path>      The solution file path (sln)
    -p, --sitePath <directory path>     The path to the site being deployed (default: same as repositoryRoot)
    -t, --scriptType <batch|bash|posh>  The script output type (default: batch)
    -o, --outputPath <output path>      The path to output generated script (default: same as repository root)
    -y, --suppressPrompt                Suppresses prompting to confirm you want to overwrite an existing destination file.
    --no-dot-deployment                 Do not generate the .deployment file.
    --no-solution                       Do not require a solution file path (only for --aspWAP otherwise ignored).
Related