簡體   English   中英

無法獲取列表中的資源組名稱

[英]Not able to get the resource group name in the list

我在下面的代碼中編寫了一個task.json文件,並嘗試創建一個插件..這是我對插件的輸入。我能夠看到蔚藍的字幕,但是資源組名稱沒有自動填充。 我應該添加什么?

`"inputs":[
        {
            "name": "ConnectedServiceNameSelector",
            "type": "pickList",
            "label": "Cloud Provider",
            "required": false,
        "helpMarkDown": "",
        "defaultValue": "",
        "options": {
            "ConnectedServiceNameARM": "Azure RM",
            "ConnectedServiceNameAWS": "AWS"
        }
    },
    {
        "name": "ConnectedServiceNameARM",
        "type": "connectedService:AzureRM",
        "label": "Azure RM Subscription",
        "defaultValue": "",
        "required": true,
        "helpMarkDown": "Azure Resource Manager subscription to target for copying the files.",
        "visibleRule": "ConnectedServiceNameSelector = ConnectedServiceNameARM"
    },
     {
        "name": "ConnectedServiceNameAWS",
        "type": "connectedService:AWS",
        "label": "AWS",
        "defaultValue": "",
        "required": true,
        "helpMarkDown": "AWS subscription to target for copying the files.",
        "visibleRule": "ConnectedServiceNameSelector = ConnectedServiceNameAWS"
    },
    {

        "name": "ResourceGroupName",
        "label": "Resource Group",
        "type": "pickList",
        "required": true,
        "groupName": "AzureDetails",
        "helpMarkDown": "Provide the name of a resource group.",
        "properties": {
            "EditableOptions": "True"
        }
    },
    {
        "name": "action",
        "type": "pickList",
        "label": "Operation",
        "defaultValue": "Create Or Update Resource Group",
        "required": true,
        "groupName": "AzureDetails",
        "helpMarkDown": "Action to be performed on the Azure resources or resource group.",
        "options": {
            "Create Or Update Resource Group": "Create or update resource group",
            "Select Resource Group": "Select resource group",
            "Start": "Start virtual machines",
            "Stop": "Stop virtual machines",
            "Restart": "Restart virtual machines",
            "Delete": "Delete virtual machines",
            "DeleteRG": "Delete resource group"
        }
    },
    {
        "name": "deploymentName",
        "type": "string",
        "label": "Deployment Name",
        "required": false,
        "defaultValue": "",
        "groupName": "AzureDetails",
        "helpMarkDown": "Provide a deployment name"
    },
    {
        "name": "location",
        "type": "pickList",
        "label": "Region",
        "defaultValue": "Southeast Asia",
        "required": true,
        "helpMarkDown": "Location for deploying the resource group. If the resource group already exists in the subscription, then this value will be ignored.",
        "groupName": "AzureDetails",
        "options": {
            "Australia East": "Australia East",
            "Australia Southeast": "Australia Southeast",
            "Brazil South": "Brazil South",
            "Canada Central": "Canada Central",
            "Canada East": "Canada East",
            "Central India": "Central India",
            "Central US": "Central US",
            "East Asia": "East Asia",
            "East US": "East US",
            "East US 2 ": "East US 2 ",
            "Japan East": "Japan East",
            "Japan West": "Japan West",
            "North Central US": "North Central US",
            "North Europe": "North Europe",
            "South Central US": "South Central US",
            "South India": "South India",
            "Southeast Asia": "Southeast Asia",
            "UK South": "UK South",
            "UK West": "UK West",
            "West Central US": "West Central US",
            "West Europe": "West Europe",
            "West India": "West India",
            "West US": "West US",
            "West US 2": "West US 2"
        },
        "properties": {
            "EditableOptions": "True"
        },
        "visibleRule": "action = Create Or Update Resource Group || action = Select Resource Group || action = DeleteRG"
    },


    }
],
"dataSourceBindings": [
    {
        "target": "ResourceGroupName",
        "endpointId": "$(ConnectedServiceName)",
        "dataSourceName": "AzureResourceGroups"
    },
    {
        "target": "location",
        "endpointId": "$(ConnectedServiceName)",
        "dataSourceName": "AzureLocations"
    },

],

`

這是我在VSTS中的插件的用戶界面 在此處輸入圖片說明

您的端點輸入是

"name": "ConnectedServiceNameARM"

但是數據綁定中的端點名稱最后沒有ARM

"endpointId": "$(ConnectedServiceName)"

希望這個幫助

您還希望僅將資源用於所選組

    {
        "target": "AutomationAccount",
        "endpointId": "$(ConnectedServiceName)",
        "dataSourceName": "AutomationAccountNames",
        "parameters": {
            "ResourceGroupName": "$(ResourceGroupName)"
        }
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM