Open BryanWilhite opened 4 years ago
the release in AzDO is broken ☹️
the shell context of the release cannot 'see' Azure Web Sites anymore such that a script like this
$job =
@{
Name = "job-feeds";
SubscriptionName = "My Subscription";
WebSiteName = "my-web-site-name";
ZipFile = "$env:AGENT_RELEASEDIRECTORY\$env:BUILD_DEFINITIONNAME\drop\MyWebJobRelease.zip";
}
Get-AzureSubscription -SubscriptionName $job.SubscriptionName
Select-AzureSubscription -SubscriptionName $job.SubscriptionName
Get-AzureWebsite | ForEach-Object {Get-AzureWebsite -Name $_.Name}
New-AzureWebsiteJob `
-Name $job.WebSiteName `
-JobName $job.Name `
-JobType Triggered `
-JobFile $job.ZipFile
returns ##[error]The website my-web-site-name was not found. Please specify a valid website name.
specifically, this command, Get-AzureWebsite | ForEach-Object {Get-AzureWebsite -Name $_.Name}
, returns nothing
this could be due to the type of connection the AzDO Task is using, a 'classic' connection or a Azure Resource Manager (RM) connection
the original script used a 'classic' connection:
switching to Azure RM means learning RM PowerShell module equivalents 🐰 🕳
switching to the Azure CLI made me open this issue: https://github.com/Azure/azure-cli/issues/11636 (which i assume will not be resolved to my satisfaction today)
i strongly suspect that the original script no longer works for security reasons and/or the 'classic' Azure PowerShell module is no longer supported---or the automatic deployment of WebJobs is no longer supported (to encourage the use of Azure Durable Functions)
this article from 2017 shows me how complicated it is to use Azure RM: https://github.com/projectkudu/kudu/wiki/Deploying-a-WebJob-using-PowerShell-ARM-Cmdlets
i've manually edited my way out of this:
Using the latest Az
Module, I find that there is no equivalent for New-AzureWebsiteJob
; New-AzureWebsiteJob
has an -AsJob
parameter that has nothing to do with a WebJob
https://docs.microsoft.com/en-us/powershell/module/az.websites/new-azwebapp?view=azps-3.2.0
"studio": "https://songhaystorage.blob.core.windows.net/day-path-blog/site-rss.xml"
needs to change to
"studio": "http://songhayblog.azurewebsites.net/entry/feed.xml"