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

标签 azure tfs azure-web-app-service msdeploy azure-devops

我有以下构建步骤,该步骤在 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/

相关文章:

Azure 应用程序服务 - Docker 组成多容器应用程序 - 无 Docker 日志

Azure可扩展架构设计

visual-studio - 通过 TFS Power Tools 2015 添加新状态?

visual-studio - 快捷方式/链接到 TFS 中的另一个文件夹

c# - 如何在 TFS 自定义构建事件中获取构建项目

应用程序之间的 Azure Web 应用程序访问限制

c# - 一张表、多个 View 、一个 C# 类

azure kubernetes 服务 - 私有(private)注册表上的自签名证书

azure - Terraform:Azure VMSS Rolling_upgrade 不会重新镜像实例

azure - 在azure应用程序服务上公开TLS/SSL服务器