Export Azure automation Account certificate

Bombbe 1,611 Reputation points
2020-10-14T11:04:45.7+00:00

Hi,
is it possible to export Azure automation Account certificate (Run as account) out to as .cert, .pim, pfx ect file? Could not find direct information about this. With Powershell command Get-AzAutomationCertificate returns information about the certificate asset, but not the certificate itself.

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,121 questions
0 comments No comments
{count} votes

Accepted answer
  1. SwathiDhanwada-MSFT 17,556 Reputation points
    2020-10-14T15:46:25.06+00:00

    @Bombbe This document articulates the information on how to add a certificate to a cloud service within runbook. But if you are looking to download the certificate locally , here is a workaround which you can use.

    • Prerequisite: Create a storage account (in case you don’t have one), storage container in same subscription as your automation account.
    • Go to Azure > Automation Account > Runbooks > Create Runbook , on Runbook type select Powershell and give it a name.
    • Now select the runbook created above and Edit (paste the content of the script 32411-export-certificatetostorage.txt) , before running the Runbook please amend the below values in the script and hit save. $storageAccountResourceGroup = "RG" $storageAccount ="test" $storageContainer = "cert" $Password = "YourStrongPasswordForTheCert" # Set the password used for this certificate
    • Once edit is complete hit Save and then Publish
    • Now select your runbook and hit Start
    • Once Runbook finishes you’ll be able to download the Certificate to local drive from your storage account container.
    • Once downloaded open it, it will prompt you for store location (Select Local Machine) , note the password will need to match to info on step 3. 32340-image.png
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Nikhil Pathak 1 Reputation point
    2021-01-08T10:31:52.377+00:00

    It did not work for me. the command let are wrong

    0 comments No comments