Stop Putting Your Asp.Net Core Secrets at Risk - Use Azure Key Vault!

Поділитися
Вставка
  • Опубліковано 26 лис 2024

КОМЕНТАРІ • 75

  • @warrenhales
    @warrenhales Місяць тому

    Awesome video. I was bouncing from one documentation article to another just looking for a clear, clean explanation. This video is exactly what I was looking for. Thank you!

  • @abuuthmaan
    @abuuthmaan 6 місяців тому +3

    You're the man, Dan! This is the best tutorial on the topic I've found.

  • @PatGarvey
    @PatGarvey Рік тому +2

    Three hours to find this videos. !5 minutes to get things to work. Excellent!

    • @Codewrinkles
      @Codewrinkles  Рік тому

      In the end, I'd say it's a success! I'm glad it was helpful. Make sure to subscribe, so that you don't spend other 3 hours searching for stuff you might find here :)

    • @343GuiItySpark
      @343GuiItySpark Рік тому

      exactly. As a fresher, helped a lot. now manager won't shout at me 😉

  • @Erny-w6s
    @Erny-w6s 27 днів тому

    I can never thank you enough!. Thank you so much for this.

  • @Thecodemagic
    @Thecodemagic 3 місяці тому

    Thanks @Codewrinkles. The way you explained is fire. 🔥..you eared a new subscriber.

  • @isrukhasan8504
    @isrukhasan8504 Рік тому

    This is one of the best. Clear and precise. Good job ! Love from Bangladesh

    • @Codewrinkles
      @Codewrinkles  Рік тому

      Thanks for watching. Love back from Romania!

  • @goranmaric6806
    @goranmaric6806 Рік тому +2

    Excellent video, indeed. Thanks!
    I would like to suggest that it could be beneficial to mention the order in which the secrets are added to the configuration object. Based on my experience using this configuration, it appears that secrets are loaded from KeyVault at the end. Therefore, if there is a configuration key with the same name as a secret in KeyVault within the Azure App Service, the value from KeyVault will be present in the configuration object at the end.

    • @Codewrinkles
      @Codewrinkles  Рік тому +2

      Thank you for watching. I have talked in dept about the order of configuration keys and how this might brake our apps in the video about configurations that I also mentioned in this one: ua-cam.com/video/5TxnLU-SXVg/v-deo.html
      Also with practical demos to show how things happen.

  • @ahmed3od2011
    @ahmed3od2011 6 днів тому

    Thank you very much, this is a great straight forward video. But I have one more question, can I store a serialized Json object inside an Azure key valut?, in your example you saved a string (connection string) so I might assume there would be not problem when saving a serialzed string inside :D !

  • @jadhavvishal89
    @jadhavvishal89 Рік тому

    Always waiting for your new videos, it's really help me and encourage me to learn and use concept with new way. Thank you very much.

    • @Codewrinkles
      @Codewrinkles  Рік тому

      Happy to hear that! Thank you for watching.

  • @kojoagyemang4169
    @kojoagyemang4169 Рік тому +1

    Really useful and simple. Can't like it enough

  • @ahmedmagdy356
    @ahmedmagdy356 15 днів тому

    Excellent video. Thanks 🎉

  • @androidsavior
    @androidsavior 8 місяців тому

    So if i sign out of Azure from the web on my pc, the key-vault will stop working in the C# code ?
    What if i host my application on-premise ? should i signin to azure form the server to get it authenticate the key-vault in my C# code ?

  • @hackneythugg
    @hackneythugg Рік тому

    Sure, here's the edited version of the UA-cam comment:
    Great video! I have a question: When you create an enabled identity on the web app and then create the access policy so that the application can access it, do you need to make any code changes? From what I saw in the video, it didn't seem like you had to change any code. So, does the Azure Default Identity work when the application is running in Azure? So no code changes are required?

    • @Codewrinkles
      @Codewrinkles  Рік тому

      If you use the system assigned managed identity, then no change should be required in the code. If you use a user assigned managed identity, then you need to provide the Object identifier for that identity either in code or as an environment variable.

  • @343GuiItySpark
    @343GuiItySpark Рік тому

    you just got a new subscriber.
    And I dont usually subscribe to anyone to keep my yt feed cleaner.
    Many thanks .

    • @Codewrinkles
      @Codewrinkles  Рік тому +1

      Thanks for the sub! I really appreciate it. Hope to not disappoint in the future :)

  • @androidsavior
    @androidsavior 8 місяців тому

    the developer will be able to debug the code and inspect the connection string and the secrets after they are returned from azure ? So we're just hiding the secretes from viruses and cyber attacks ?

  • @viktorasmickunas2527
    @viktorasmickunas2527 Рік тому

    A very useful and much needed video. Thank you.

  • @zaharivaklinov
    @zaharivaklinov Рік тому

    Short, clear and concise. If only this had been uploaded back in December. Nevertheless, I will be using it from now on (:

  • @19balazs86
    @19balazs86 Рік тому +2

    This video could be on the Microsoft Learn page by default. Easier and better to understand the KeyVault, than other learning materials.

    • @Codewrinkles
      @Codewrinkles  Рік тому +1

      Thank you for the kind words. Feel then free to share it wherever you can. That would probably help a lot of people.

    • @nove1398
      @nove1398 Рік тому +1

      I feel the same here

    • @Codewrinkles
      @Codewrinkles  Рік тому

      @@nove1398 Same goes for you. Feel free to share it wherever you think there are people that would find in useful: at work, friends, social media, forums. That would be highly appreciated.

  • @bouthaynahamdi707
    @bouthaynahamdi707 6 місяців тому

    very helpful. does it work if the app service is container base?

  • @jadhavvishal89
    @jadhavvishal89 Рік тому

    Awesome video @codewrincles, you explain how to use key vault concept very simple way. I gone through lots of documents, but your 16 min video help me to clear my most of the doubts. Thanks.
    Could you please cover azure function with real time scenario. Like input and output bindings.

    • @Codewrinkles
      @Codewrinkles  Рік тому

      I'm glad the video was useful to you. I will for sure cover also Azure Functions, probably in a lot of videos. I'm just getting the Azure series started. That's the 4th video only :)

  • @mahdiali4299
    @mahdiali4299 22 дні тому

    Really clean code thanks a lot

  • @androidsavior
    @androidsavior 8 місяців тому

    Thank you very much, it will try it soon

  • @Harshvardhan2
    @Harshvardhan2 2 місяці тому

    Simple and Perfect

  • @AhmedMohammed23
    @AhmedMohammed23 Рік тому

    my man where were you hiding
    great content overall thanks

  • @ravindranaths513
    @ravindranaths513 2 місяці тому

    In Azure, how can we link one service-bus topic to another topic?

  • @xelaksal6690
    @xelaksal6690 Рік тому

    Thanks for very clear explanation!

  • @Liboterac
    @Liboterac Рік тому

    Bro u are fking awesome! Thank you for this. Clear, on spot, nice examples....

    • @Codewrinkles
      @Codewrinkles  Рік тому

      Glad you found it useful. Thanks for watching!

  • @PROFDAILY
    @PROFDAILY Рік тому

    Great Work, what happens if you deploy to different environments(dev, QA and Prod), your vault will have different secrets, how do you then update you Program.cs to read different secret based on the environment?

    • @Codewrinkles
      @Codewrinkles  Рік тому +2

      First of, you just create the needed secrets for each environment. In your app you than use the secrets based on the environment you are currently in.
      You'll have to create 3 managed identities for each of the web apps and assign permissions. An alternative here would be to create one user assigned managed identity and use it for all the environments. This would actually be a scenario where a user assigned managed identity would make sense.

    • @flo187de
      @flo187de Рік тому +1

      @@Codewrinkles I've used a separate keyvault for each environment. that way I only have to change they keyvault url in appsettings. any downsides to that?

    • @Codewrinkles
      @Codewrinkles  Рік тому +1

      I wouldn't say it's a problem or downside, but companies tend to usually have more consolidated key vaults, as they would contain keys, secrets and certificates used throughout all the Azure resources.

    • @PROFDAILY
      @PROFDAILY Рік тому

      @@Codewrinkles that makes sense

  • @HungTran-jx2xc
    @HungTran-jx2xc Рік тому +1

    how is the cost would increase since we retrieve the connection string directly from Azure Key Vault ?

    • @Codewrinkles
      @Codewrinkles  Рік тому

      What cost exactly? Bot the Azure webapp and the KeyVault reside inside Azure, in the same region. So, I wouldn't be too worried about that in terms of network latency.

  • @mustafaaltnok3250
    @mustafaaltnok3250 Рік тому

    Thanks for the video, What about azure keyvault- azure kubernetes integration?

  • @dailylearning1706
    @dailylearning1706 Рік тому

    Excellent job, thank you. But can you make a video like this with Terraform? I mean, by using Terraform to create the key vault, the secret inside the key vault and then access the secret from the secret vault with Terraform and Azurerm provider. Thank you in advance.

    • @Codewrinkles
      @Codewrinkles  Рік тому

      Thanks for the idea! I guess infrastructure as code topics is something that I'll cover sooner rather than later.

  • @SinanNAR
    @SinanNAR Рік тому

    What is the difference between system generated and user generated managed identity? Also could you please cover app configuration with keyvault together for next topic?

    • @Codewrinkles
      @Codewrinkles  Рік тому

      I explained the difference in the video. Maybe you have skipped that part :)

  • @NazarYuras
    @NazarYuras Рік тому

    Thank you very much!

    • @Codewrinkles
      @Codewrinkles  Рік тому

      Glad you enjoyed it. Thanks for watching.

  • @sauravbhatta5303
    @sauravbhatta5303 Рік тому

    Good content.
    You should also start producing content for Azure service fabric, function and service bus
    Have u also looked into Azure app configuration?

    • @Codewrinkles
      @Codewrinkles  Рік тому +1

      I have just started the Azure videos on this channel. I'll get probably in most of the topicsyou mentioned. Thank you for watching and commenting!

  • @alboshajdari6871
    @alboshajdari6871 Рік тому

    AddAzureKeyVault is now updated and now requiring different arguments:
    (string vault, string clientId, string clientSecret)
    But why do I need to manually give clientId and clientSecret when I already have valid credentials through DefaultAzureCredential(); ?

    • @Codewrinkles
      @Codewrinkles  Рік тому

      TBH, I'm not sure about this change. This video is not that old. I will investigate. But it seems very odd to me.

    • @alboshajdari6871
      @alboshajdari6871 Рік тому

      @@Codewrinkles I found a solution, I was able to do it with this code here:
      string keyVaultUrl = builder.Configuration.GetSection("KeyVaultUrl").Value!;
      var azureServiceTokenProvider = new AzureServiceTokenProvider();
      var keyVaultClient = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(azureServiceTokenProvider.KeyVaultTokenCallback));
      builder.Configuration.AddAzureKeyVault(keyVaultUrl, keyVaultClient, new DefaultKeyVaultSecretManager());

    • @pylvr8021
      @pylvr8021 Рік тому

      any updates on this, could you tell from what packages its comes from, i did not find it anywhere
      @@Codewrinkles

  • @PhantasyAI0
    @PhantasyAI0 10 місяців тому

    what about Cache the secrets? the way you did it now you'd have to pay for every read operation on a secret. You need to Cache the secrets and reuse from memory whenever possible right?

    • @Codewrinkles
      @Codewrinkles  10 місяців тому

      That sounds like a valid point and idea.

  • @loadiam
    @loadiam Рік тому

    Simple and helpful!

  • @brianalessi2673
    @brianalessi2673 Рік тому

    Create video, this was very informative! We just implanted this with success, but we also noticed that it takes about 12 seconds to retrieve just one secret. Has anyone noticed this or discovered workaround(s)?

    • @Codewrinkles
      @Codewrinkles  Рік тому

      I assume there's a networking problem somewhere. Retrieving secrets is and should be very fast.

  • @Harshvardhan2
    @Harshvardhan2 2 місяці тому

    Thanks

  • @codeme8016
    @codeme8016 7 місяців тому

    Wonderful

  • @RoyZASTEROiD
    @RoyZASTEROiD Рік тому

    thanks

  • @AnsisPlepis
    @AnsisPlepis Рік тому +1

    14:20 Theres nothing wrong with your face :)

  • @Harshvardhan2
    @Harshvardhan2 2 місяці тому

    Thanks