question

PrabhuGunasekaran-1267 avatar image
0 Votes"
PrabhuGunasekaran-1267 asked PrabhuGunasekaran-1267 commented

Azure devops pfx install in remote vm

Hi Team,

I urgently need help. I am trying to install pfx certificate in my azure vm and saved my pfx file in variable group and saved my pfx password as well. I am using the below yaml script for deployment, but its not working. Certificate is not getting installed in my azure remote vm. please advise.

Starter pipeline

Start with a minimal pipeline that you can customize to build and deploy your code.

Add steps that build, run tests, deploy, and more:

https://aka.ms/yaml


trigger:
- master

pool:
vmImage: 'windows-latest'

variables:
- group: certificate-variable
steps:
- task: DownloadSecureFile@1
name: mySecureFile
displayName: 'Get the pfx file certificat'
inputs:
secureFile: '$(signingCert.secureFilePath)'
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Write-Host "Start adding the PFX file to the certificate store."
$pfxpath = '$(mySecureFile.secureFilePath)'
$password = '$(signingCert.password)'
Add-Type -AssemblyName System.Security
$cert = New-Object -TypeName System.Security.Cryptography.X509Certificates.X509Certificate2($pfxpath, $password, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]"PersistKeySet")
$store = new-object system.security.cryptography.X509Certificates.X509Store -argumentlist "sakthi", CurrentUser
$store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]"ReadWrite")
$store.Add($cert)
$store.Close()

not-supported-azure
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LeonLaude avatar image
0 Votes"
LeonLaude answered PrabhuGunasekaran-1267 commented

Hi @PrabhuGunasekaran-1267,

Azure DevOps is currently not supported in the Q&A forums, the supported products are listed over here https://docs.microsoft.com/en-us/answers/products (more to be added later on).

You can ask the experts in the dedicated Azure DevOps forum over here:
https://developercommunity.visualstudio.com/spaces/21/index.html


(If the reply was helpful please don't forget to upvote or accept as answer, thank you)


Best regards,
Leon

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LeonLaude avatar image LeonLaude PrabhuGunasekaran-1267 ·

You're welcome.

0 Votes 0 ·