I added a.cert certificate to Azure DevOps as a secure file.
We employ traditional pipelines.
My pipeline now has two extra tasks.
Download a secure file first
2, import Azure Cli task.
add below script as an inline script from the cert file
Keyvault certificate import —vault-name "keyvaultname" -n "mycert.com.crt" -f $certFilePath = $(Agent.TempDirectory)mycert.com.crt $certFilePath
receiving the error below
The phrase "D:agent work tempmycert.com.crt" is not recognised as the name of a cmdlet, function, script file, or executable programme. Verify the name's spelling, or if a path was included, make sure the path is accurate and try again. Azureclitaskscript1675572660483 inlinescript.ps1:1 char:12 at D:agent work temp
MyCert.com.crt is located in the folder D:agent work temp.
Category
ObjectNotFound information: Mycert.com.crt:String (D:agent work temp), ParentContainsErrorRecordException FullyQualifiedErrorId: CommandNotFoundException