แก้ไข

แชร์ผ่าน


AzureResourceGroupDeployment@1 - Azure Resource Group Deployment v1 task

Use this task to deploy, start, stop, and delete Azure Resource Groups.

This task is deprecated; use AzureResourceGroupDeployment@2.

Syntax

# Azure Resource Group Deployment v1
# Deploy, start, stop, delete Azure Resource Groups.
- task: AzureResourceGroupDeployment@1
  inputs:
    #ConnectedServiceNameSelector: 'ConnectedServiceName' # 'ConnectedServiceName' | 'ConnectedServiceNameClassic'. Azure Connection Type. Default: ConnectedServiceName.
    ConnectedServiceName: # string. Required when ConnectedServiceNameSelector = ConnectedServiceName. Azure Subscription. 
    #ConnectedServiceNameClassic: # string. Required when ConnectedServiceNameSelector = ConnectedServiceNameClassic. Azure Classic Subscription. 
    action: 'Create Or Update Resource Group' # 'Create Or Update Resource Group' | 'Select Resource Group' | 'Start' | 'Stop' | 'Restart' | 'Delete' | 'DeleteRG'. Required when ConnectedServiceNameSelector = ConnectedServiceName. Action. Default: Create Or Update Resource Group.
    #actionClassic: 'Select Resource Group' # 'Select Resource Group'. Required when ConnectedServiceNameSelector = ConnectedServiceNameClassic. Action. Default: Select Resource Group.
    resourceGroupName: # string. Required when ConnectedServiceNameSelector = ConnectedServiceName. Resource Group. 
    #cloudService: # string. Required when ConnectedServiceNameSelector = ConnectedServiceNameClassic. Cloud Service. 
    #location: 'East US' # 'Australia East' | 'Australia Southeast' | 'Brazil South' | 'Canada Central' | 'Canada East' | 'Central India' | 'Central US' | 'East Asia' | 'East US' | 'East US 2 ' | 'Japan East' | 'Japan West' | 'North Central US' | 'North Europe' | 'South Central US' | 'South India' | 'Southeast Asia' | 'UK South' | 'UK West' | 'West Central US' | 'West Europe' | 'West India' | 'West US' | 'West US 2'. Required when action = Create Or Update Resource Group. Location. Default: East US.
    #csmFile: # string. Required when action = Create Or Update Resource Group. Template. 
    #csmParametersFile: # string. Optional. Use when action = Create Or Update Resource Group. Template Parameters. 
    #overrideParameters: # string. Optional. Use when action = Create Or Update Resource Group. Override Template Parameters. 
    #deploymentMode: 'Incremental' # 'Validation' | 'Incremental' | 'Complete'. Required when action = Create Or Update Resource Group. Deployment Mode. Default: Incremental.
    #enableDeploymentPrerequisitesForCreate: false # boolean. Optional. Use when action = Create Or Update Resource Group. Enable Deployment Prerequisites. Default: false.
    #enableDeploymentPrerequisitesForSelect: false # boolean. Optional. Use when action = Select Resource Group. Enable Deployment Prerequisites. Default: false.
  # Output
    #outputVariable: # string. Resource Group.

Inputs

ConnectedServiceNameSelector - Azure Connection Type
string. Allowed values: ConnectedServiceName (Azure Resource Manager), ConnectedServiceNameClassic (Azure Classic). Default value: ConnectedServiceName.

Required. Selects the service connection that contains an Azure Subscription for the deployment.


ConnectedServiceName - Azure Subscription
string. Required when ConnectedServiceNameSelector = ConnectedServiceName.

Required. Selects the service connection that contains an Azure Subscription for the deployment.


ConnectedServiceNameClassic - Azure Classic Subscription
string. Required when ConnectedServiceNameSelector = ConnectedServiceNameClassic.

Selects an Azure Classic subscription for the deployment.


action - Action
string. Required when ConnectedServiceNameSelector = ConnectedServiceName. Allowed values: Create Or Update 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). Default value: Create Or Update Resource Group.

The action to be performed on the Azure resources or resource group.


actionClassic - Action
string. Required when ConnectedServiceNameSelector = ConnectedServiceNameClassic. Allowed values: Select Resource Group (Select Cloud Service). Default value: Select Resource Group.

The action to be performed on the Azure resources or cloud service.


resourceGroupName - Resource Group
string. Required when ConnectedServiceNameSelector = ConnectedServiceName.

Provides the name of the resource group.


cloudService - Cloud Service
string. Required when ConnectedServiceNameSelector = ConnectedServiceNameClassic.

Provides the name of the cloud service.


location - Location
string. Required when action = Create Or Update Resource Group. Allowed values: Australia East, Australia Southeast, Brazil South, Canada Central, Canada East, Central India, Central US, East Asia, East US, East US 2 , Japan East, Japan West, North Central US, North Europe, South Central US, South India, Southeast Asia, UK South, UK West, West Central US, West Europe, West India, West US, West US 2. Default value: East US.

The location to deploy the resource group. If the resource group already exists in the subscription, then this value will be ignored.


csmFile - Template
string. Required when action = Create Or Update Resource Group.

Specifies the path or a pattern pointing to the Azure Resource Manager template. Learn more about Azure Resource Manager templates. To get started immediately, use this sample template.


csmParametersFile - Template Parameters
string. Optional. Use when action = Create Or Update Resource Group.

Specifies the URL of the parameters file. An example URL: https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vm-simple-windows/azuredeploy.parameters.json

To use a file stored in a private storage account, retrieve and include the shared access signature (SAS) token in the URL of the template. Example: <blob_storage_url>/template.json?<SAStoken> To upload a parameters file to a storage account and generate a SAS token, use the Azure file copy task or follow the steps using PowerShell or Azure CLI.

To view the template parameters in a grid, click on next to the override template parameters text box. This feature requires that CORS rules are enabled at the source. If templates are in Azure storage blob, refer to Cross-Origin Resource Sharing to enable CORS.


overrideParameters - Override Template Parameters
string. Optional. Use when action = Create Or Update Resource Group.

Specifies the template parameters to override.

To view the template parameters in a grid, click on ... next to the Override Parameters textbox. This feature requires that CORS rules are enabled at the source. If the templates are in the Azure storage blob, reference this string to enable CORS, or type the template parameters to override in the textbox.

Example: -storageName fabrikam -adminUsername $(vmusername) -adminPassword (ConvertTo-SecureString -String '$(password)' -AsPlainText -Force) -azureKeyVaultName $(fabrikamFibre).

If the parameter value has multiple words, enclose the words in quotes, even if you're passing the value by using variables. For example, -name "parameter value" -name2 "$(var)". To override object type parameters, use stringified JSON objects. For example, -options ["option1"] -map {"key1": "value1" }.


deploymentMode - Deployment Mode
string. Required when action = Create Or Update Resource Group. Allowed values: Validation (Validation Only), Incremental, Complete. Default value: Incremental.

The Incremental mode handles deployments as incremental updates to the resource group. It leaves unchanged resources that exist in the resource group but are not specified in the template.

Complete mode deletes resources that are not in your template. Complete mode takes relatively more time than incremental mode. If the task times out, consider increasing the timeout or changing to the Incremental mode.

Warning

Complete mode will delete all the existing resources in the resource group that are not specified in the template. Do review if the resource group you're deploying to doesn't contain any necessary resources that are not specified in the template.

Validate mode enables you to find problems with the template before creating actual resources.

Note

The Validate mode always creates a resource group, even if no resources are deployed.

Learn more about deployment modes.


enableDeploymentPrerequisitesForCreate - Enable Deployment Prerequisites
boolean. Optional. Use when action = Create Or Update Resource Group. Default value: false.

Applicable only when the resource group contains virtual machines.

Choosing the Deployment Group option configures the Deployment Group agent on each of the virtual machines.

Selecting the WinRM option configures the Windows Remote Management (WinRM) listener over HTTPS protocol on port 5986 using a self-signed certificate. This configuration is required for performing deployment operation on Azure machines. If the target virtual machines are backed by a load balancer, ensure the Inbound NAT rules are configured for the target port (5986).


enableDeploymentPrerequisitesForSelect - Enable Deployment Prerequisites
boolean. Optional. Use when action = Select Resource Group. Default value: false.

Applicable only when the resource group contains virtual machines.

Choosing the Deployment Group option configures the Deployment Group agent on each of the virtual machines.

Selecting the WinRM option configures the Windows Remote Management (WinRM) listener over HTTPS protocol on port 5986 using a self-signed certificate. This configuration is required for performing deployment operation on Azure machines. If the target virtual machines are backed by a load balancer, ensure the Inbound NAT rules are configured for the target port (5986).


outputVariable - Resource Group
string.

Required when an existing resource group is selected. Provides a name for the resource group variable. The variable can be used as $(variableName) to refer to the resource group in subsequent tasks, such as in PowerShell on Target Machines task for deploying applications.

Valid only when the selected action is Create, Update, or Select.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Requirements

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands Self-hosted agents must have capabilities that match the following demands to run jobs that use this task: azureps
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 1.103.0 or greater
Task category Deploy