question

bombbe avatar image
0 Votes"
bombbe asked nikhilpathak answered

Export Azure automation Account certificate

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
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.

SwathiDhanwada-MSFT avatar image
0 Votes"
SwathiDhanwada-MSFT answered

@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



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.

nikhilpathak avatar image
0 Votes"
nikhilpathak answered nikhilpathak published

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

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.