gpt4 book ai didi

azure - VSO/VSTS : Azure Powershell - The specified credentials cannot be used with the authentication scheme 'Basic'

转载 作者:行者123 更新时间:2023-12-02 07:50:10 28 4
gpt4 key购买 nike

我有以下构建步骤,该步骤在 Azure Powershell 中运行脚本。该脚本基本上将文件发布到网络应用程序(有关详细信息,请参阅下文)。

Azure Powershell

这对于我的所有网络应用程序都适用,除了一个。我收到以下错误:

scriptCommand= & "C:\a\8b0700333\MyProj\Scripts\Publish.ps1" -websiteName mywebapp -packOutput "C:\a\8b0700333\MyProj\Api"
Stopping web app...
Publishing web app...
Publishing with publish method [MSDeploy]
[error]Error: The specified credentials cannot be used with the authentication scheme 'Basic'.
[error]Error: Default credentials cannot be supplied for the Basic authentication scheme.
[error]Parameter name: authType
[error]Error count: 1.

Publish.ps1 脚本:

param($websiteName, $packOutput)

$website = Get-AzureWebsite -Name $websiteName

# get the scm url to use with MSDeploy. By default this will be the second in the array
$msdeployurl = $website.EnabledHostNames[1]

$publishProperties = @{'WebPublishMethod'='MSDeploy';
'MSDeployServiceUrl'=$msdeployurl;
'DeployIisAppPath'=$website.Name;
'Username'=$website.PublishingUsername;
'Password'=$website.PublishingPassword
'SkipExtraFilesOnServer'='False'}

Write-Output "Stopping web app..."
Stop-AzureWebsite -Name $websiteName

Write-Output "Publishing web app..."
$publishScript = "${env:ProgramFiles(x86)}\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\Publish\Scripts\default-publish.ps1"

. $publishScript -publishProperties $publishProperties -packOutput $packOutput

Write-Output "Starting web app..."
Start-AzureWebsite -Name $websiteName

最佳答案

有同样的问题,问题是由于微软提供的脚本显然不支持插槽。在这里做了一个固定版本https://gist.github.com/baywet/f7ed425c48ccde4399c7

从这篇文章中帮助自己How can I get the PublishUrl via Azure PowerShell?

关于azure - VSO/VSTS : Azure Powershell - The specified credentials cannot be used with the authentication scheme 'Basic' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34417649/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com