Accessing Azure Key Vault #3397
-
I need to download a pfx from Azure Key Vault. I would prefer to not do this in YAML, as I'm trying to move as much logic as possible into Cake. Is there any kind of tool or extensions for accessing an Azure Key Vault and downloading a file from it? -- |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Since downloading the certificate is possible using Azure CLI it should be possible using Cake.AzureCli. I have not tested this, though. In script #addin nuget:?package=Cake.AzureCli&version=1.2.1
Task("Default")
.Does(() => {
// probably need to authenticate, first...
Az().Keyvault.Secret.Download(new AzKeyvaultSecretDownloadSettings
{
File = "./my-cool-cert.pfx"
});
}); In Frosting (add a reference to Cake.AzureCli NuGet): [TaskName("Default")]
public class DefaultTask : FrostingTask<BuildContext>
{
public override void Run(BuildContext context)
{
// probably need to authenticate, first...
context.Az().Keyvault.Secret.Download(new AzKeyvaultSecretDownloadSettings
{
File = "./my-cool-cert.pfx"
});
}
} As to your edit: IntelliSense for Cake script is available in VS Code and script files are as easily (maybe more so) distributable, as Frosting dlls: Both can be shared locally using a (shared) folder or published using NuGet packages. There was a nice article recently on that topic from Lee Richardson. |
Beta Was this translation helpful? Give feedback.
Since downloading the certificate is possible using Azure CLI it should be possible using Cake.AzureCli.
I have not tested this, though.
In script
In Frosting (add a reference to Cake.AzureCli NuGet):