Azure Resource Manager 템플릿 매개 변수 살펴보기

완료됨

템플릿의 parameters 섹션에서 리소스를 배포할 때 입력할 수 있는 값을 지정합니다. 매개 변수에 사용할 수 있는 속성은 다음과 같습니다.

"parameters": {
    "<parameter-name>" : {
        "type" : "<type-of-parameter-value>",
        "defaultValue": "<default-value-of-parameter>",
        "allowedValues": [ "<array-of-allowed-values>" ],
        "minValue": <minimum-value-for-int>,
        "maxValue": <maximum-value-for-int>,
        "minLength": <minimum-length-for-string-or-array>,
        "maxLength": <maximum-length-for-string-or-array-parameters>,
        "metadata": {
        "description": "<description-of-the parameter>"
        }
    }
}

다음은 두 가지 매개 변수를 보여 주는 예입니다. 하나는 가상 머신의 사용자 이름이고 나머지 하나는 암호입니다.

"parameters": {
  "adminUsername": {
    "type": "string",
    "metadata": {
      "description": "Username for the Virtual Machine."
    }
  },
  "adminPassword": {
    "type": "securestring",
    "metadata": {
      "description": "Password for the Virtual Machine."
    }
  }
}

참고

템플릿에서 매개 변수는 256개로 제한됩니다. 여러 속성을 포함하는 개체를 사용하여 매개 변수의 개수를 줄일 수 있습니다.