File tree Expand file tree Collapse file tree
share-marketplace-extension Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9191 version : ' v0.x'
9292 checkLatest : true
9393
94+ - template : /devops/steps/obtain-marketplace-accesstoken.yml
95+
9496 # fetch the current extension version
9597 # You must build and upload manually for the first execution
9698 # specify the Extension.VersionOverride variable at queue time to override this value
99101 name : Query
100102 inputs :
101103 connectTo : ' VsTeam'
102- connectedServiceName : ' AzureDevOpsMarketplace '
104+ connectedServiceName : ' $(MarketplaceServiceConnection) '
103105 publisherId : ' $(PublisherID)'
104106 extensionId : ' $(ExtensionID)'
105107 versionAction : ' Patch'
@@ -125,7 +127,7 @@ jobs:
125127 condition : eq('${{ parameters.publishExtension}}', 'true')
126128 inputs :
127129 connectTo : ' VsTeam'
128- connectedServiceName : ' AzureDevOpsMarketplace '
130+ connectedServiceName : ' $(MarketplaceServiceConnection) '
129131 fileType : ' vsix'
130132 vsixFile : ' $(Build.ArtifactStagingDirectory)/*.vsix'
131133 publisherId : ' $(PublisherID)'
Original file line number Diff line number Diff line change @@ -24,13 +24,15 @@ steps:
2424 version : ' v0.x'
2525 checkLatest : true
2626
27+ - template : /devops/steps/obtain-marketplace-accesstoken.yml
28+
2729# share the extension
2830# --share-with only adds new organizations, existing orgs are untouched
2931- task : ShareAzureDevOpsExtension@5
3032 displayName : ' Share Extension with Organization'
3133 inputs :
3234 connectTo : ' VsTeam'
33- connectedServiceName : ' AzureDevOpsMarketplace '
35+ connectedServiceName : ' $(MarketplaceServiceConnection) '
3436 method : ' id'
3537 publisherId : ' $(PublisherID)'
3638 extensionId : ' $(ExtensionID)'
Original file line number Diff line number Diff line change 1+ # uses $(MarketplaceServiceConnection) stored in pipeline-extension-settings variable group. This is the ID of the service connection
2+
3+
4+ steps :
5+ - task : AzureCLI@2
6+ displayName : ' Obtain Access Token for Marketplace API'
7+ inputs :
8+ azureSubscription : ' azure-devops-marketplace'
9+ scriptType : ' pscore'
10+ scriptLocation : ' inlineScript'
11+ useGlobalConfig : true
12+ inlineScript : |
13+ $accessToken = az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query "accessToken" --output tsv
14+ write-host "##vso[task.setsecret]$accessToken"
15+ write-host "##vso[task.setendpoint id=$env:MARKETPLACESERVICECONNECTION;field=authParameter;key=password]$accessToken"
16+
You can’t perform that action at this time.
0 commit comments