Shaun Luttin
Shaun Luttin

Reputation: 141512

View deployment history from the command line or PowerShell

I am deploying through source control to a Microsoft Azure Website. It's a pain to log in to the Azure Portal and click through the UI to view the deployment history. Can we manage deployments from the command line or PowerShell?

Upvotes: 2

Views: 1060

Answers (2)

Shaun Luttin
Shaun Luttin

Reputation: 141512

Azure CLI for Web Apps. We find the legacy Azure Service Manager mode easiest for this. Also, we find the output more readable in JSON. Using --max limits the results.

azure config mode asm
azure site deployment list MySiteName --max 1 --json

Azure CLI for Web App Slots. We can also retrieve a specific --slot.

azure config mode asm
azure site deployment list MySiteName --slot MySlotName --max 1 --json

Upvotes: 1

Amit Apple
Amit Apple

Reputation: 9182

Yes, you can use both the PowerShell or xplat (commandline) tools to do this.

More about installing them here:

For the xplat use:

azure config mode 'asm'
site deployment list [options] [name]
site deployment show [options] <commitId> [name]
site deployment redeploy [options] <commitId> [name]
site deployment github [options] [name]

For PowerShell:

Get-AzureWebsiteDeployment [[-CommitId] <String>] [[-MaxResults] <Int32>] [-Details] [[-Name] <String>] [-Slot <String>] [<CommonParameters>]`

Get-AzureWebsiteDeployment -Name mySite

Also you can browse to https://{sitename}.scm.azurewebsites.net there you can also view your deployments using REST apis.

Upvotes: 3

Related Questions