Search code examples
deploymentazure-devopsazure-service-fabric

Deploying a Service fabric app from Team Services to Azure


I need some help with deploying a Service fabric app from Team Services to Azure.

I’m getting the following error from the Agent in Team Services (see screenshot below):

2018-06-22T13:17:13.3007613Z ##[error] An error occurred attempting to import the certificate. Ensure that your service endpoint is configured properly with a correct certificate value and, if the certificate is password-protected, a valid password.

Error message: Exception calling "Import" with "3" argument(s): "Cannot find the requested object.

Please advise.

TS Deploy error

Here is my Service Fabric Security security page, don't remember where I set up the password needed on the VSTS side but I took note of it and believe it's correct. SF Security

Here is the Endpoint page on the VSTS side: enter image description here


Solution

  • Issue resolved with the help of MS Support by creating a new Certificate in the Key Vault and Adding it to the Service Fabric, steps:

    Azure Portal:

    • Home > Key vaults > YourKeyVault - Certificates: Generate/Import Generate new key with a CertificateName of your choosing and CN=CertificateName as Subject.
    • Home > Key vaults > YourKeyVault - Certificates > CertificateName Select the only version available and Download in PFX/PEM format.
    • Power Shell: Convert to Base64 string, CertificateBase64 [System.Convert]::ToBase64String([System.IO.File]::ReadAllBytes("c:\YourCertificate.pfx"))
    • Home > YourServicefabric - Security: Add Add the Certificate you created as Admin Client by providing 's thumbprint.

    VSTS/TFS:

    • Build and release > Your pipeline: Edit In the Deployment Process Service Fabric Environment click Manage for Cluster Connection and add a new connection. Besides the other information, in the Client Certificate paste the previous CertificateBase64.