Giter VIP home page Giter VIP logo

key-vault-dotnet-managed-storage's Introduction

services platforms author
key-vault
dotnet
dragav

.Net SDK samples illustrating the management and consumption of Azure Key Vault-managed storage account keys.

This repo contains sample code demonstrating the management and consumption of Azure Storage account keys via Azure Key Vault, using the Azure .Net SDK. The scenarios covered by these samples include:

  • Setting up and managing a storage account in a key vault: adding, removing, backing up, restoring and recovering an account
  • Setting up and managing SAS token definitions in a key vault: adding, removing, backing up, restoring and recovering a SAS definition
  • Consuming a SAS token - obtaining it from Azure Key Vault, and using it to access an Azure Storage endpoint

Support for Azure Key Vault-managed storage account may be colloquially referred to as 'MSAK'; SAS stands for shared access signature. We assume reader familiarity with Azure Storage in general, and SAS tokens in particular.

Samples in this repo:

  • Add and delete a managed storage account
  • List and get existing managed storage accounts
  • Backup and restore, delete and recover a managed storage account; permanently delete a managed storage account in a soft-delete enabled vault
  • Set the storage account key regeneration period
  • Rotate on demand the active storage account key
  • Add and delete a managed storage SAS definition; recover a deleted managed storage SAS definition
  • List and get existing managed storage SAS definitions
  • Obtain a SAS token from Azure Key Vault and use it to access an Azure Storage endpoint

Getting Started

Prerequisites

  • OS: Windows
  • SDKs:
    • KeyVault data SDK: Microsoft.Azure.KeyVault ver. 3.0.0+
  • Azure:
    • an active Azure subscription, in which you have the Key Vault Contributor role
    • an Azure key vault
    • an Azure Active Directory application, created in the tenant associated with the subscription, and with access to KeyVault; please see Accessing Key Vault from a native application for details.
    • the credentials of the AAD application, in the form of a client secret
    • an Azure Storage account, which you have access to (for data and management)
    • a user account, with List and Manage permissions to the storage account

Installation

  • open the solution in Visual Studio - NuGet should resolve the necessary packages

Quickstart

Follow these steps to get started with this sample:

  1. git clone https://github.com/Azure-Samples/key-vault-dotnet-managed-storage.git
  2. cd key-vault-dotnet-managed-storage
  3. edit the app.config file, specifying the tenant, subscription, AD app id and secret, and storage account and its resource id
  4. dotnet run --project AzureKeyVaultManagedStorageSamples\AzureKeyVaultManagedStorageSamples.csproj

Note that storage account management requires a user account, and that the sample will interactively ask for a user login.

Demo

Resources

Please see the following links for additional information:

key-vault-dotnet-managed-storage's People

Contributors

microsoftopensource avatar dragav avatar msftgits avatar prashanthyv avatar schaabs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.