Azure-使用Arm模板从Visual Studio部署Web应用程序,并连接到VSTS git源代码控制 [英] Azure - deploy web app from visual studio using arm template, connected to VSTS git source control

查看:72
本文介绍了Azure-使用Arm模板从Visual Studio部署Web应用程序,并连接到VSTS git源代码控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用arm模板从Visual Studio部署Azure Web应用程序(应用程序服务).

I am trying to deploy azure web app (app services) from visual studio using arm template.

这些是模板中的资源:

"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应用程序.

I have separate template for creating resource group and service plan. After deployment everything is generated correctly on azure, but web app is not connected to source control. There is only default web application.

当我进入Web应用程序的部署选项下时,出现消息:找不到部署. Web应用程序的资源组部署下有错误消息:参数x-ms-client-principal-name为null或为空.(代码:BadRequest).

When I go under deployment options of web app, there is message: No deployments found. There is error message under resource group deployments of web app: Parameter x-ms-client-principal-name is null or empty.(Code: BadRequest).

当我尝试通过azure门户进行相同的部署时,就可以了.创建Web应用程序后,只需连接到源代码管理,即可自动开始同步.

When I try doing the same deployment through azure portal then it is ok. When I create web app, after that I only have to connect is to source control, and sync is started automatically.

  1. 错误消息参数x-ms-client-principal-name为null或为空.(代码:BadRequest)"是什么意思,我该如何纠正?

  1. What does error message 'Parameter x-ms-client-principal-name is null or empty.(Code: BadRequest)' means and how can I correct it?

是否有可能通过Visual Studio部署Web应用程序并将其连接到vsts git cource控件?

Is deploying web app through visual studio and connecting it to vsts git cource control even possible?

推荐答案

从我自己的问题中获取:

Taken from my own question here: my answered question.

您正在从Visual Studio运行,对吗? VSTS git是私有的- 如果问题与我的相同,则可以向URL添加凭据.不要使用您的真实凭据.

You are running from Visual Studio right? VSTS git is private - if the problem was the same as mine, adding credentials to the URL will work. Do not use your real credentials.

在与克隆"按钮相同的VSTS区域中创建Alias凭据,然后使用它们.您的网址应如下所示:

Create Alias credentials in the same VSTS area as the clone button and use these. Your url should look like this:

https://newAliasUserName:NewAliasPassword @ ####.visualstudio.com/####/####

祝你好运.

这篇关于Azure-使用Arm模板从Visual Studio部署Web应用程序,并连接到VSTS git源代码控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆