Azure Web Job - Authorization Basic Header

2019-05-21 07:19发布

问题:

I created an Azure Web Job and published and associated with my Web App. I think created a schedule to run every hour.

When I login to the portal, I notice a new Schedule has been created. It has two automatically headers:

Where did that Basic Authorization key come from? I can't seem to find it when drilling into the Web Jobs tab under my Web App.

It's also strange the scheduler only allows for minimum of hour intervals for a "Basic" web app. But I can just create a fresh Scheduled Job using the same credentials in order to get minute level processing.

回答1:

$authPair = "$($site.PublishingUsername):$($site.PublishingPassword)";
$pairBytes = [System.Text.Encoding]::UTF8.GetBytes($authPair);
$encodedPair = [System.Convert]::ToBase64String($pairBytes);

Reference
Create a Scheduled Azure WebJob with PowerShell