diff --git a/azure-key-vault/azure-key-vault.cabal b/azure-key-vault/azure-key-vault.cabal index c0d829a..afba7ef 100644 --- a/azure-key-vault/azure-key-vault.cabal +++ b/azure-key-vault/azure-key-vault.cabal @@ -62,3 +62,13 @@ library , text , unliftio default-language: Haskell2010 + +executable example + main-is: Main.hs + hs-source-dirs: example + ghc-options: -Wall + default-language: Haskell2010 + build-depends: + base >= 4.7 && < 5 + , azure-auth + , azure-key-vault diff --git a/azure-key-vault/example/Main.hs b/azure-key-vault/example/Main.hs new file mode 100644 index 0000000..f660f49 --- /dev/null +++ b/azure-key-vault/example/Main.hs @@ -0,0 +1,16 @@ +{-# LANGUAGE OverloadedStrings #-} + +module Main where + +import Azure.Secret (getSecret) +import Azure.Secret.Types (KeyVaultHost (..), SecretName (..)) +import Azure.Types (newEmptyToken) +import Azure.Auth (defaultAzureCredential) + +main :: IO () +main = do + tok <- newEmptyToken + cred <- defaultAzureCredential Nothing "https://vault.azure.net" tok + -- In order to run this, you need to replace @SecretName@ and @KeyVaultHost@ with + -- appropriate values in your resource group. These are just dummy values. + getSecret (SecretName "radiohead") (KeyVaultHost "albums") cred >>= print