Azure-使用arm模板从visual studio部署web应用程序,连接到VSTS git源代码管理
我正在尝试使用arm模板从VisualStudio部署azure web应用程序(应用程序服务) 以下是模板中的资源:Azure-使用arm模板从visual studio部署web应用程序,连接到VSTS git源代码管理,git,azure,templates,arm,Git,Azure,Templates,Arm,我正在尝试使用arm模板从VisualStudio部署azure web应用程序(应用程序服务) 以下是模板中的资源: "resources": [ { "type": "Microsoft.Web/sites", "kind": "app", "name": "[parameters('site_name')]", "apiVersion": "2016-08-01", "location": "Nor
"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 app的资源组部署下有错误消息:参数x-ms-client-principal-name为null或空。(代码:BadRequest)
当我尝试通过azure portal进行相同的部署时,一切正常。当我创建web应用程序时,之后我只需要连接到源代码管理,同步会自动启动
摘自我自己的问题: 您正在从Visual Studio运行,对吗?VSTS git是私有的- 如果问题与我的相同,则向URL添加凭据将起作用。不要使用您的真实凭证 在与“克隆”按钮相同的VSTS区域中创建别名凭据并使用这些凭据。您的url应如下所示:
祝你好运。我刚才问了一个与此非常类似的问题——我已经为此奋斗了一整天。你在这方面运气好吗?我还是找不到解决办法!是的,我刚刚让它工作了,所以这是可能的。您正在从Visual Studio运行,对吗?VSTS git是私有的-您需要将凭据添加到repo url。因此,我认为“是”。不要使用真实的用户名和密码。在VSTS中的“克隆”按钮中,可以创建别名凭据。使用别名作为用户名,新密码作为密码。非常感谢!解决方案是创建别名凭据。