【发布时间】:2017-09-04 09:59:56
【问题描述】:
我正在尝试使用 arm 模板从 Visual Studio 部署 azure Web 应用程序(应用程序服务)。
这些是来自模板的资源:
"resources": [
{
"type": "Microsoft.Web/sites",
"kind": "app",
"name": "[parameters('site_name')]",
"apiVersion": "2016-08-01",
"location": "North Europe",
"scale": null,
"properties": {
"enabled": true,
"hostNameSslStates": [
{
"name": "[concat(parameters('site_name'),'.azurewebsites.net')]",
"sslState": "Disabled",
"virtualIP": null,
"thumbprint": null,
"toUpdate": null,
"hostType": "Standard"
},
{
"name": "[concat(parameters('site_name'),'.scm.azurewebsites.net')]",
"sslState": "Disabled",
"virtualIP": null,
"thumbprint": null,
"toUpdate": null,
"hostType": "Repository"
}
],
"serverFarmId": "[parameters('site_serverFarmId')]",
"reserved": false,
"siteConfig": null,
"scmSiteAlsoStopped": false,
"hostingEnvironmentProfile": null,
"clientAffinityEnabled": true,
"clientCertEnabled": false,
"hostNamesDisabled": false,
"containerSize": 0,
"dailyMemoryTimeQuota": 0,
"cloningInfo": null
},
"resources": [
{
"apiVersion": "2016-08-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', parameters('site_name'))]"
],
"properties": {
"repoUrl": "https://...",
"branch": "master",
"isManualIntegration": false
}
}
],
"dependsOn": []
},
{
"type": "Microsoft.Web/sites/config",
"name": "[parameters('config_web_name')]",
"apiVersion": "2016-08-01",
"location": "North Europe",
"scale": null,
"properties": {
"numberOfWorkers": 1,
"defaultDocuments": [
"Default.htm",
"Default.html",
"Default.asp",
"index.htm",
"index.html",
"iisstart.htm",
"default.aspx",
"index.php",
"hostingstart.html"
],
"netFrameworkVersion": "v4.0",
"phpVersion": "5.6",
"pythonVersion": "",
"nodeVersion": "",
"linuxFxVersion": "",
"requestTracingEnabled": false,
"remoteDebuggingEnabled": false,
"remoteDebuggingVersion": null,
"httpLoggingEnabled": false,
"logsDirectorySizeLimit": 35,
"detailedErrorLoggingEnabled": false,
"publishingUsername": "[concat('$',parameters('site_name'))]",
"publishingPassword": null,
"appSettings": null,
"metadata": null,
"connectionStrings": null,
"machineKey": null,
"handlerMappings": null,
"documentRoot": null,
"scmType": "VSO",
"use32BitWorkerProcess": true,
"webSocketsEnabled": false,
"alwaysOn": false,
"javaVersion": null,
"javaContainer": null,
"javaContainerVersion": null,
"appCommandLine": "",
"managedPipelineMode": "Integrated",
"virtualApplications": [
{
"virtualPath": "/",
"physicalPath": "site\\wwwroot",
"preloadEnabled": false,
"virtualDirectories": null
}
],
"winAuthAdminState": 0,
"winAuthTenantState": 0,
"customAppPoolIdentityAdminState": true,
"customAppPoolIdentityTenantState": false,
"runtimeADUser": null,
"runtimeADUserPassword": null,
"loadBalancing": "LeastRequests",
"routingRules": [],
"experiments": {
"rampUpRules": []
},
"limits": null,
"autoHealEnabled": false,
"autoHealRules": {
"triggers": null,
"actions": null
},
"tracingOptions": null,
"vnetName": "",
"siteAuthEnabled": false,
"siteAuthSettings": {
"enabled": null,
"unauthenticatedClientAction": null,
"tokenStoreEnabled": null,
"allowedExternalRedirectUrls": null,
"defaultProvider": null,
"clientId": null,
"clientSecret": null,
"issuer": null,
"allowedAudiences": null,
"additionalLoginParams": null,
"isAadAutoProvisioned": false,
"googleClientId": null,
"googleClientSecret": null,
"googleOAuthScopes": null,
"facebookAppId": null,
"facebookAppSecret": null,
"facebookOAuthScopes": null,
"twitterConsumerKey": null,
"twitterConsumerSecret": null,
"microsoftAccountClientId": null,
"microsoftAccountClientSecret": null,
"microsoftAccountOAuthScopes": null
},
"cors": null,
"push": null,
"apiDefinition": null,
"autoSwapSlotName": null,
"localMySqlEnabled": false,
"ipSecurityRestrictions": null
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('site_name'))]"
]
}
]
我有用于创建资源组和服务计划的单独模板。部署后,一切都在 azure 上正确生成,但 Web 应用程序未连接到源代码管理。只有默认的 Web 应用程序。
当我进入 Web 应用程序的部署选项时,出现消息:未找到部署。 Web 应用的资源组部署下有错误消息:参数 x-ms-client-principal-name 为 null 或为空。(代码:BadRequest)。
当我尝试通过 azure 门户进行相同的部署时,就可以了。当我创建网络应用程序后,我只需要连接到源代码管理,同步就会自动启动。
错误消息“Parameter x-ms-client-principal-name is null or empty.(Code: BadRequest)”是什么意思,如何更正?
是否可以通过 Visual Studio 部署 Web 应用并将其连接到 vsts git 源控件?
【问题讨论】:
-
我刚刚问了一个与此非常相似的问题 - 我整天都在与这个问题作斗争。
-
你有什么运气吗?我仍然找不到解决方案!
-
是的,刚刚让它工作,所以它是可能的。您是从 Visual Studio 运行的,对吗? VSTS git 是私有的 - 您需要将您的凭据添加到 repo url。所以“username:password@xxx.visualstudio.com/_git/reponame”。不要使用真实的用户名和密码。在 VSTS 中的克隆按钮中,您可以创建别名凭据。使用别名作为用户名,新密码作为密码。