-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c5dbaa8
commit 2952e8a
Showing
8 changed files
with
216 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -250,3 +250,6 @@ paket-files/ | |
# JetBrains Rider | ||
.idea/ | ||
*.sln.iml | ||
|
||
# Custom | ||
*.vsix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,31 @@ | ||
# vsts-arm-outputs | ||
VSTS Extension - Use ARM Deployment outputs | ||
# vsts-arm-outputs - a VSTS Extension | ||
|
||
Using this extenion in your VSTS environment enables you to use the values coming out of the ARM Deployment outputs. | ||
|
||
This step will use the last successful deployment within the selected resource group. If this deployent has outputs, all of them are copied to VSTS variables by the ARM Output key. | ||
|
||
```json | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": {}, | ||
"variables":{}, | ||
"resources":{}, | ||
"outputs": { | ||
"dbserver-fqdn": { | ||
"type": "string", | ||
"value": "[reference(concat('Microsoft.Sql/servers/',variables('dbserver-name'))).fullyQualifiedDomainName]" | ||
}, | ||
"sample-variable": { | ||
"type": "string", | ||
"value": "[variables('sample-variable')]" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
This outputs can then be used by default VSTS ways: ```$(sample-variable)``` | ||
|
||
Usually this task is ran directly after the 'Azure Resource Group Deployment' task. | ||
|
||
//todo: screenshot of VSTS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ | ||
"manifestVersion": 1, | ||
"id": "arm-outputs", | ||
"name": "ARM Outputs", | ||
"version": "1.0.0", | ||
"publisher": "keesschollaart", | ||
"public": false, | ||
"helpMarkDown": "[More Information](https://github.com/keesschollaart81/vsts-arm-outputs)", | ||
"targets": [ | ||
{ | ||
"id": "Microsoft.VisualStudio.Services" | ||
} | ||
], | ||
"description": "Use ARM Deployment outputs", | ||
"categories": [ | ||
"Build and release" | ||
], | ||
"tags": [ | ||
"azure", | ||
"arm", | ||
"template", | ||
"build", | ||
"release", | ||
"output", | ||
"variable", | ||
"parameter", | ||
"resource", | ||
"group", | ||
"deployment", | ||
"resourcegroup" | ||
], | ||
"screenshots": [ | ||
{ | ||
"path": "images/screenshots-vsts-arm-outputs-1.png" | ||
} | ||
], | ||
"content": { | ||
"details": { | ||
"path": "readme.md" | ||
}, | ||
"license": { | ||
"path": "LICENSE" | ||
} | ||
}, | ||
"links": { | ||
"getstarted": { | ||
"uri": "https://github.com/keesschollaart81/vsts-arm-outputs" | ||
}, | ||
"support": { | ||
"uri": "https://github.com/keesschollaart81/vsts-arm-outputs" | ||
} | ||
}, | ||
"branding": { | ||
"color": "rgb(82,108,161)", | ||
"theme": "light" | ||
}, | ||
"icons": { | ||
"default": "images/logo.png" | ||
}, | ||
"files": [ | ||
{ | ||
"path": "src" | ||
}, | ||
{ | ||
"path": "images/screenshots-vsts-arm-outputs-1.png", | ||
"addressable": true | ||
}, | ||
{ | ||
"path": "images/logo.png", | ||
"addressable": true | ||
} | ||
], | ||
"contributions": [ | ||
{ | ||
"id": "arm-outputs", | ||
"type": "ms.vss-distributed-task.task", | ||
"targets": [ | ||
"ms.vss-distributed-task.tasks" | ||
], | ||
"properties": { | ||
"name": "arm-outputs" | ||
} | ||
} | ||
], | ||
"repository": { | ||
"type": "git", | ||
"uri": "https://github.com/keesschollaart81/vsts-arm-outputs" | ||
} | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
param ( | ||
[string] [Parameter(Mandatory = $true)] | ||
$resourceGroupName="vsts-arm-outputs-test-rg" | ||
) | ||
|
||
Write-Verbose "Entering script run.ps1" | ||
|
||
Write-Host "ResourceGroupName= $resourceGroupName" | ||
|
||
$lastResourceGroupDeployment = Get-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName | Sort Timestamp -Descending | Select -First 1 | ||
|
||
if(!$lastResourceGroupDeployment) | ||
{ | ||
throw "Deployment could not be found for Resource Group '$resourceGroupName'." | ||
} | ||
|
||
if(!$lastResourceGroupDeployment.Outputs) | ||
{ | ||
throw "No output parameters could be found for the last deployment of Resource Group '$resourceGroupName'." | ||
} | ||
|
||
foreach ($key in $lastResourceGroupDeployment.Outputs.Keys){ | ||
$value = $lastResourceGroupDeployment.Outputs.Item($key).Value | ||
Write-Host "##vso[task.setvariable variable=$key;]$value" | ||
|
||
Write-Verbose "Updating VSTS variable '$key' to value '$value'" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"id": "584bcff2-3353-4f11-872b-6ba01267a972", | ||
"name": "Use ARM Outputs", | ||
"friendlyName": "Use ARM Outputs", | ||
"description": "This task reads the output values of an ARM deployment and sets them as VSTS variable", | ||
"helpMarkDown": "[More Information](https://github.com/keesschollaart81/vsts-arm-outputs)", | ||
"category": "Utility", | ||
"visibility": [ | ||
"Build", | ||
"Release" | ||
], | ||
"author": "Kees Schollaart", | ||
"version": { | ||
"Major": 1, | ||
"Minor": 0, | ||
"Patch": 0 | ||
}, | ||
"demands": [ | ||
"azureps" | ||
], | ||
"minimumAgentVersion": "1.95.0", | ||
"inputs": [ | ||
{ | ||
"name": "ConnectedServiceNameSelector", | ||
"type": "pickList", | ||
"label": "Azure Connection Type", | ||
"required": true, | ||
"helpMarkDown": "", | ||
"defaultValue": "ConnectedServiceNameARM", | ||
"options": { | ||
"ConnectedServiceNameARM": "Azure Resource Manager" | ||
} | ||
}, | ||
{ | ||
"name": "ConnectedServiceNameARM", | ||
"type": "connectedService:AzureRM", | ||
"label": "AzureRM Subscription", | ||
"defaultValue": "", | ||
"required": true, | ||
"helpMarkDown": "Select the Azure Resource Manager subscription." | ||
}, | ||
{ | ||
"name": "resourceGroupName", | ||
"type": "pickList", | ||
"label": "Resource Group", | ||
"required": true, | ||
"helpMarkDown": "Provide the name of the resource group.", | ||
"properties": { | ||
"EditableOptions": "True" | ||
} | ||
} | ||
], | ||
"dataSourceBindings": [ | ||
{ | ||
"target": "resourceGroupName", | ||
"endpointId": "$(ConnectedServiceNameARM)", | ||
"dataSourceName": "AzureResourceGroups" | ||
} | ||
], | ||
"instanceNameFormat": "Use ARM Outputs", | ||
"execution": { | ||
"PowerShell3": { | ||
"target": "$(currentDirectory)\\run.ps1" | ||
} | ||
} | ||
} |