简体   繁体   中英

Determine if Azure Deployments exist for the Specified Service and Slot

I'd like to know if it is possible to determine if a deployment is present for a given service (and the respective slot ( Production or Staging )).

All I found would be to call Get-AzureDeployment -ServiceName xxxservice which would throw an error saying Get-AzureDeployment : ResourceNotFound: No deployments were found. in PowerShell.

try -ErrorVariable and -ErrorAction parameters

$deployment = Get-AzureDeployment -ServiceName $serviceName -Slot $slot -ErrorVariable a -ErrorAction silentlycontinue 
if ($a[0] -ne $null)
{
    Write-Output "$(Get-Date –f $timeStampFormat) - No deployment is detected."
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM