Skip to content

Commit

Permalink
add example
Browse files Browse the repository at this point in the history
  • Loading branch information
nitinprakash96 committed Oct 28, 2024
1 parent 87247c5 commit fa557e2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions azure-key-vault/azure-key-vault.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 17 additions & 0 deletions azure-key-vault/example/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{-# 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.
res <- getSecret (SecretName "radiohead") (KeyVaultHost "albums") cred
print res

0 comments on commit fa557e2

Please sign in to comment.