Preetham ReddyTechFabric Profile
Preetham Reddy
Sep 23, 2017
Sep 23, 2017
Blue Azure dev ops image

Convert PFX Certificate to Base64 String

When working on Azure DevOps test plans, oftentimes you’d have to secure the communication between the resources using certificates.

For example, when establishing a secure connection between your VSTS build server and Service Fabric cluster on Azure, you’ll have to give the Base64 encoded version of the pfx certificate that you’ve used to secure the service fabric cluster.

That way, your build server will be able to securely connect to the cluster to deploy packages or other artifacts.

Converting the pfx certificate to the Base64 encoded string is really easy using powershell.

$fileContentBytes = get-content 'C:\users\preet\downloads\wildcard.klwines.com.pfx' -Encoding Byte [System.Convert]::ToBase64String($fileContentBytes) | Out-File ‘pfx-encoded-bytes.txt’
Screenshot of Windows PowerShell with the certificate code.

The text file with the necessary bytes will be created in the same folder where the script is run.

Enjoy!



Preetham Reddy, Cloud Solutions Architect at Tech Fabric


Tech Fabric specializes in building web, mobile and cloud based application using Microsoft Stack (C#, .NET Core, Xamarin, Azure, SQL Service etc.,). If you need help with taking your on-premise application to cloud or convert your monolithic applications to microservices based, we’d be glad to help you out.You can reach out to our sales team at contact@techfabric.com.

What To Read Next

Jan 3, 2018

Using Traefik Reverse Proxy for securing Microservices on Azure Service Fabric

Service Fabric is a Microservices platform by Microsoft, similar to Docker Swarm/Kubernetes. It provides great features out of the box and helps orchestrate and manage your microservices.

Read More
Apr 22, 2021

Using custom software development data for supply chain optimization

Rising demand for Microsoft Dynamics 365 for supply chain optimization driven by data analysis and automation in logistics. Collaboration and strategic partnerships key to industry-wide consistency. Microsoft Gold Partners like TechFabric aid in custom software development.

Read More
Mar 5, 2021

Supply chain optimization: Do I innovate, or do I wait?

When it comes to supply chain optimization and adaptation to new technologies, some companies rise to the challenge while others experience a brutally painful demise.

Read More

Interested in learning more about this topic? Contact our solution experts and setup a time to talk.