Thank you for the detailed tutorial. I have a similar implementation of automatic refresh with the azure function. For some reason app configuration updates aren't being picked up. Here is the code opts.ConfigureRefresh(refresh => { refresh .Register("Global:Sentinel", label: LabelFilter.Null, refreshAll: true) .SetCacheExpiration(new TimeSpan(0,0,5)); }); Updated the Global:Sentinel value and test config value var testConfig = _options.Value.Test; I am using nuget package Microsoft.Extensions.Configuration.AzureAppConfiguration 4.4.0
Thank you Ram. Sure will add Fluent Validations to my list and definitely do one. Could you provide more details around the start up code into different classes? There is a video on Startup Classes in general ruclips.net/video/y7UtOnbUUsg/видео.html (But guess that is not what you are looking for).
@@RahulNath Yes Rahul, instead of writing all of our code in the startup class, we can create the extension methods and write those logic into it and call the method in our start up class.
Hi Rahul, Really loved your videos for learning azure. Could you please add a video regarding the Azure Load balancer? Which Azure load balancer is well suited for the project etc.
hi Rahul, great video I got good understanding on App config and I was able to implement this by seeing your video. but when accessing the same with in container I am seeing an exception like "Retry failed after 3 tries. Retry settings can be adjusted in ClientOptions.Retry. (The SSL connection could not be established, see inner exception.) (The SSL connection could not be established, see inner exception.) (The SSL connection could not be established, see inner exception.) "
Great video... Whats the difference between AZure keyvalut vs Azure App Configuration..Because i can see we will use both to store secrets and config values etc.
Thank you Ram and glad you like it. Yes it complements Key Vault functionality but simplifies many tasks especially around configuration. You can also integrate App Configuration to a Key Vault. More details on your question here docs.microsoft.com/en-us/azure/azure-app-configuration/faq#how-is-app-configuration-different-from-azure-key-vault Hope that helps. Do let me know if you have further question.
Great Video Brother ! I need some help regarding this topic . Configurations are read correctly when the service starts . In my local .net core application my configuration are not getting refreshed even after cache expiration time has elapsed. InitializationCacheExpires is set to {1/1/0001 12:00:00 AM +00:00} . Thanks in advance.
Thanks Rahul, it's a wonderful tutorial. Is there any feasibility to read a section of config and bind it a custom model? let us say, I have a group of keys Section1:key1, Section1:key2 etc. I would need to bind this with a model Section1 wtih key1 and key2 as properties.
Thank you Challa. Yes you can use the configuration bind. I generally prefer using the Options Pattern in this case which is talk about here ruclips.net/video/SizJCLcjbOA/видео.html Also do checkout the entire ASP NET Series here (for other concepts) - bit.ly/asp-net-core-series Let me know if you have additional questions.
Is this bahviour has been changed in net6. I have a similar configuration in my using the example from Microsoft docs. Along with your great video, the new value is not being refreshed. I had to get the refresh provider and add middleware to refresh each time there is a new http request.
Hey Al Waseem, Thank you and glad you liked it. When you say not being refreshed, can you provide more details around it? I do talk about AutmaticRefresh (13:14) and Sentinel keys (21:28) in this video.
@@RahulNath Thanks for replying, the video you directed me to, creates feature flags (using azure app config) manually in the portal. I want to create the feature flag in azure app config via code. Is that something we can do?
Yes I show this under the Managed Identities section. Also checkout this link here for more details www.rahulpnath.com/blog/azure-managed-service-identity-and-local-development/ Let me know if you have additional questions
Am I correct to assume that enabling automatically refreshed configuration values increase the number of requests the app will do to Azure App Configuration and therefore, increase the subscription costs greatly?
@@RahulNath yes, thank you. It's not always obvious how many requests any of these implementations would generate in order to estimate the cost, and it can go up quite fast if you're not careful... Very nice tutorial by the way, I loved it!
@@YanickGirouard Yes very true - if you are not careful and running on larger scale costs can go up if you are not careful. One reason why I made sure to cover the Sentinel key in the video. Glad you found it useful!
Does the contents of your appsettings.{env}.json override the contents of App Config? If so, is there a way to make App Config take precedence over those files?
Yes it does . I talk about this around 7:30. The order in which the configuration providers are added determines which one overrides which. Why do you want appsettings to override the env specific ones ? Also checkout my video on Configuration to learn more on how it works ruclips.net/video/5GlgHV_12-k/видео.html
@@RahulNath The reason why I would maybe want the Azure App Config to override my appsettings files is because (in my case) our DevOps team would control the interactions with Azure App Config. As a developer, it would be nice to have a sort of 'template' within the appsettings files to see what is available to use (without knowing the values).
@@bewl2641 Yes absolutely - I leave all configurable values in appsettings.json (either empty or default) and have them overridden in the environment-specific files. So for this use case, it's better to keep the same order as default with env overriding the values in appsettings. I talk about these in more detail here ruclips.net/video/wTSu2aCoR7Y/видео.html Let me know if that answers your questions.
They are complementary services. You can use Key Vault references from App Configuration. This SO post answers a bit more stackoverflow.com/questions/67722160/what-is-the-point-of-using-azure-key-vault-instead-of-only-app-configuration Let me know if that helps.
@@RahulNath If we create a service then we will have the service URL, Lets say if we have the swagger link for that service then anyone can access, so for the customer faced URL's we can secure that service URL using the app gateway right and also if we want to pass the customerId parameterid in the query param then its not a good idea so we can send it using the JWT token.. 1) Create a Web api endpoint with asp net core which also have the customer info properties needs to pass in the querystring/body. 2) secure the service URL with app gateway which have the subscripion key so that only the services which want to consume needs to pass that subscription key 3) instead of passing the important customer details in the header/queryparams we can send it using JWT.
@@RahulNath I am working on React project and for backend we are using PHP YII2 frame work. So in react we need to configure Backend URL right. Can we configure that in CD part in Azure DevOps ?
@@hemchandu7813 Yes you can do that in Devops as part of Environment Variables. I have some videos on that. Check this playlist out here ruclips.net/p/PL59L9XrzUa-npmS1p7AIPOH7eZqzgMqV0 Check out the one around Environment Specific Variables in particular And this one ruclips.net/video/OFr6Vkw0mq8/видео.html Let me know if you have any additional questions.
Hi Rahul, For pushing the config dynamically whenever there is a change in config(for one to many scenarios) which is better Event Grid or service bus? If event grid then suggest something, with service bus I had tried ,and got it worked.
The doc here mentions why you would use one over the other docs.microsoft.com/en-us/azure/azure-app-configuration/enable-dynamic-configuration-dotnet-core-push-refresh?WT.mc_id=AZ-MVP-5003875 _"Applications can choose to subscribe to these events either directly from Event Grid, or through a web hook, or by forwarding events to Azure Service Bus. The Azure Service Bus SDK provides an API to register a message handler that simplifies this process for applications that either do not have an HTTP endpoint or do not wish to poll the event grid for changes continuously."_ Does that help?
@@RahulNath Azure AD for our own organization. But clients could bring in their own identity provider. So on a high level - basically, there is a 1. Third party auth0 service, 2. A central microservice (STS) which issues token, 3. Application microservice which is MVC application. When MVC application starts it communicates with STS, STS talks to its database to get what parameter values are to be sent to 3rd party service(auth0) . Then the auth0 redirects user to the respective login screen. Once authenticated, STS gets intimated. STS generates token and sends it back to the MVC application.
Hi Rahul, as always one more great tutorial. We have 30+ applications/apis/functions with each pointing to the same database(connection string). If we setup one app Configuration for db read for all the apps with SetCacheExpiration as 1 sec.Then number of requests in one hour would be 30*60*60=108,000 requests with one instance only. And each api is loadbalanced(autoscaling), the instances count usually is between 2 to 6. So the number of requests increases further. What do you suggest here as even the Standard pricing model has limitation of 20,000 requests per hour?
Hey Vinay, Glad you liked the video. When changing connection string don't delete the old one immediately (very similar to having a primary and secondary key). If you keep the cache expiration to a larger value (let's say 30 minutes), during that time all the applications will gradually fall over to the new key. You can use queries on your backend then to verify that all connections have switched over to the new key and then retire the old one (after 30 minutes, if all automatic updates were successful). Let me know if that helps or if you have additional questions.
@@RahulNath Hi Rahul, We have started using 'App Configuration' to store database connectionString and read it in all our apis. We store database connectionString in KeyVault and reference it in App Configuration using KeyVault reference way. 2 Observations 1) Once we update connectionString in KeyVault, api will not pick new version until we update 'App Configuration' (just need to re-reference the keyvault) - Is it by design ? 2) From the code, if we use Scoped/Transient service for the db connection, it works as expected for the updated connectionString. But if we make database connection service as Singleton, then even after updating the KeyVault's db connection with new version and re-reference it in app configuration, still it picks the old version since the db connection service is a Singleton - Is their any better and easy way to notifiy appService to re-initialize db service instace once there is a change in connection from KeyVault&/App Configuration ?
@@VinayKumar-qu1eg When integrating with Key Vault are you specifying a specific version or the latest version? I will try this out myself and let you know. When using Singleton instances it depends on how you are resolving the connection string value inside. If it's during construction time then I guess it's working as expected. You will need to add in additional code in the case you getting an unauthorized error to reinitialize your connection inside the singleton class. Is there a specific reason to keep it as Singleton?
With a great community not just the video tutorials but the comments also help a lot!
Glad they are Harshit!
Thanks Rahul for End-to-End demo, for work b/w Developer & Admin
Thank you and glad it helped Rajkumar!
Hats off to your dedication, making videos @ 4am in the morning , Keep going !!
Thank you so much 😀Yes all videos are recorded between 4 and 5. That's when the house is most silent.
Thank you for doing these high-quality tutorials...
Glad you like them Arun. Thank you!
I really like and appreciate your wonderful tutorials. Each one is a great source of new info to developers
Happy you like them Paniraj!
Thanks Rahul, Very clear explanation.
Thank you Sajid 😀
in-depth and to the point..even though I am a python developer but the process helped me a lot, thanks man
Glad to hear that Amit. Happy it helped.
Really great video having very useful information..
Glad it was helpful Ravindra! Do checkout out the ASP Series bit.ly/asp-net-core-series
Such a great teacher! Tehank you so much !
So glad you like it Mario! Do let me know if you have any topic suggestions.
Great 👍 plz make video on asynchronous programming using async and await in details and also include use of Task. We will be very thankful to you 🙏❤️
Thank you Akash and it is a great suggestion. I will definitely make one! Lots of concepts to be covered there I believe (time to start reading 😀)
So great. Thanks
Thank you too Kay, Glad it helps!
Thanks a lottt.. ya
Thank you Tom 👍
great vid. got me up to speed fast
Good to hear! Do check out the Azure series bit.ly/azure-series
Thank you for the detailed tutorial. I have a similar implementation of automatic refresh with the azure function. For some reason app configuration updates aren't being picked up.
Here is the code
opts.ConfigureRefresh(refresh =>
{
refresh
.Register("Global:Sentinel", label: LabelFilter.Null, refreshAll: true)
.SetCacheExpiration(new TimeSpan(0,0,5));
});
Updated the Global:Sentinel value and test config value
var testConfig = _options.Value.Test;
I am using nuget package Microsoft.Extensions.Configuration.AzureAppConfiguration 4.4.0
Did you come across this SO stackoverflow.com/questions/61181243/usage-of-azure-app-configurations-feature-flags-in-azure-functions
thanks
You're welcome Parvesh!!
Good explanation Rahul. Thank for your lessons
So nice of you, thank you!
Thank you !
Thank you Mayuresh!
Hats off Rahul keep going
Thank you!! Do check out the full series on ASP NET Core here ruclips.net/p/PL59L9XrzUa-nqfCHIKazYMFRKapPNI4sP
Great video... Rahul could you please make a video on Fluent Validations and Writing start up code into sepearate exrtension classes
Thank you Ram. Sure will add Fluent Validations to my list and definitely do one. Could you provide more details around the start up code into different classes?
There is a video on Startup Classes in general ruclips.net/video/y7UtOnbUUsg/видео.html (But guess that is not what you are looking for).
@@RahulNath Yes Rahul, instead of writing all of our code in the startup class, we can create the extension methods and write those logic into it and call the method in our start up class.
Hi Rahul,
Really loved your videos for learning azure. Could you please add a video regarding the Azure Load balancer? Which Azure load balancer is well suited for the project etc.
hi Rahul, great video I got good understanding on App config and I was able to implement this by seeing your video. but when accessing the same with in container I am seeing an exception like "Retry failed after 3 tries. Retry settings can be adjusted in ClientOptions.Retry. (The SSL connection could not be established, see inner exception.) (The SSL connection could not be established, see inner exception.) (The SSL connection could not be established, see inner exception.) "
Great video... Whats the difference between AZure keyvalut vs Azure App Configuration..Because i can see we will use both to store secrets and config values etc.
Thank you Ram and glad you like it. Yes it complements Key Vault functionality but simplifies many tasks especially around configuration. You can also integrate App Configuration to a Key Vault. More details on your question here docs.microsoft.com/en-us/azure/azure-app-configuration/faq#how-is-app-configuration-different-from-azure-key-vault
Hope that helps. Do let me know if you have further question.
Can you please do a demo on reading excel content from Azure blob
What problem are you facing? My first question would be - does it need to be excel or can it be csv?
Hey rahul, can we add a list of values for some key in azure app configuration?
1st view
First reply! 😀 Thank you
Hello Rahul
Please create some videos on Durable functions.
Done already added to my list 😀
Great Video Brother ! I need some help regarding this topic . Configurations are read correctly when the service starts . In my local .net core application my configuration are not getting refreshed even after cache expiration time has elapsed. InitializationCacheExpires is set to {1/1/0001 12:00:00 AM +00:00} . Thanks in advance.
Thanks Rahul, it's a wonderful tutorial. Is there any feasibility to read a section of config and bind it a custom model? let us say, I have a group of keys Section1:key1, Section1:key2 etc. I would need to bind this with a model Section1 wtih key1 and key2 as properties.
Thank you Challa. Yes you can use the configuration bind. I generally prefer using the Options Pattern in this case which is talk about here ruclips.net/video/SizJCLcjbOA/видео.html
Also do checkout the entire ASP NET Series here (for other concepts) - bit.ly/asp-net-core-series
Let me know if you have additional questions.
Hi, How we can get ride/increase of azure request timeout 230 seconds?
Where are you seeing these timeouts?
Is this bahviour has been changed in net6. I have a similar configuration in my using the example from Microsoft docs. Along with your great video, the new value is not being refreshed. I had to get the refresh provider and add middleware to refresh each time there is a new http request.
Hey Al Waseem, Thank you and glad you liked it. When you say not being refreshed, can you provide more details around it? I do talk about AutmaticRefresh (13:14) and Sentinel keys (21:28) in this video.
Using azure app config, is there a way to create a feature flag/define a feature flag or update the audience of the feature flag in code?
Yes Charu , and I have a follow up video on that here ruclips.net/video/qtp90IYMRh8/видео.html
Let me know if that’s what you are looking for ?
@@RahulNath Thanks for replying, the video you directed me to, creates feature flags (using azure app config) manually in the portal. I want to create the feature flag in azure app config via code. Is that something we can do?
Is there anyway to access app configuration using managed identities from local itself
Yes I show this under the Managed Identities section. Also checkout this link here for more details www.rahulpnath.com/blog/azure-managed-service-identity-and-local-development/
Let me know if you have additional questions
Am I correct to assume that enabling automatically refreshed configuration values increase the number of requests the app will do to Azure App Configuration and therefore, increase the subscription costs greatly?
Yes you are correct Yanick - Which is why using a Sentinel key is suggested. I talk about it at 21:28. Hope that answers your question.
@@RahulNath yes, thank you. It's not always obvious how many requests any of these implementations would generate in order to estimate the cost, and it can go up quite fast if you're not careful... Very nice tutorial by the way, I loved it!
@@YanickGirouard Yes very true - if you are not careful and running on larger scale costs can go up if you are not careful. One reason why I made sure to cover the Sentinel key in the video. Glad you found it useful!
Does the contents of your appsettings.{env}.json override the contents of App Config? If so, is there a way to make App Config take precedence over those files?
Yes it does . I talk about this around 7:30. The order in which the configuration providers are added determines which one overrides which. Why do you want appsettings to override the env specific ones ?
Also checkout my video on Configuration to learn more on how it works ruclips.net/video/5GlgHV_12-k/видео.html
@@RahulNath The reason why I would maybe want the Azure App Config to override my appsettings files is because (in my case) our DevOps team would control the interactions with Azure App Config. As a developer, it would be nice to have a sort of 'template' within the appsettings files to see what is available to use (without knowing the values).
@@bewl2641 Yes absolutely - I leave all configurable values in appsettings.json (either empty or default) and have them overridden in the environment-specific files. So for this use case, it's better to keep the same order as default with env overriding the values in appsettings. I talk about these in more detail here ruclips.net/video/wTSu2aCoR7Y/видео.html
Let me know if that answers your questions.
How is it different from Azure Key Vault
They are complementary services. You can use Key Vault references from App Configuration. This SO post answers a bit more stackoverflow.com/questions/67722160/what-is-the-point-of-using-azure-key-vault-instead-of-only-app-configuration
Let me know if that helps.
Plz make a video on Azure AppGateway..
Thank you Ram for the suggestion. Added to my list. Any specific things you want to be covered about App Gateway?
@@RahulNath If we create a service then we will have the service URL, Lets say if we have the swagger link for that service then anyone can access, so for the customer faced URL's we can secure that service URL using the app gateway right and also if we want to pass the customerId parameterid in the query param then its not a good idea so we can send it using the JWT token..
1) Create a Web api endpoint with asp net core which also have the customer info properties needs to pass in the querystring/body.
2) secure the service URL with app gateway which have the subscripion key so that only the services which want to consume needs to pass that subscription key
3) instead of passing the important customer details in the header/queryparams we can send it using JWT.
Hi Rahul can you make a video how to configure Backend for react apps in Azure ?
Can you provide more details Hem on what exactly that you are looking for?
@@RahulNath I am working on React project and for backend we are using PHP YII2 frame work. So in react we need to configure Backend URL right. Can we configure that in CD part in Azure DevOps ?
@@hemchandu7813 Yes you can do that in Devops as part of Environment Variables. I have some videos on that. Check this playlist out here ruclips.net/p/PL59L9XrzUa-npmS1p7AIPOH7eZqzgMqV0
Check out the one around Environment Specific Variables in particular
And this one ruclips.net/video/OFr6Vkw0mq8/видео.html
Let me know if you have any additional questions.
Thanks Rahul
Hi Rahul, For pushing the config dynamically whenever there is a change in config(for one to many scenarios) which is better Event Grid or service bus? If event grid then suggest something, with service bus I had tried ,and got it worked.
The doc here mentions why you would use one over the other docs.microsoft.com/en-us/azure/azure-app-configuration/enable-dynamic-configuration-dotnet-core-push-refresh?WT.mc_id=AZ-MVP-5003875
_"Applications can choose to subscribe to these events either directly from Event Grid, or through a web hook, or by forwarding events to Azure Service Bus. The Azure Service Bus SDK provides an API to register a message handler that simplifies this process for applications that either do not have an HTTP endpoint or do not wish to poll the event grid for changes continuously."_
Does that help?
@@RahulNath Yes
@@rahulchaurasia5560 cool 😀
Could you do one video on how to create STS(Secure Token Service) . Central Authentication for microservices?
Thank you for the suggestion Arbaaz. Do you use any Central Identity Server for your microservices?
@@RahulNath Azure AD for our own organization. But clients could bring in their own identity provider. So on a high level - basically, there is a 1. Third party auth0 service, 2. A central microservice (STS) which issues token, 3. Application microservice which is MVC application. When MVC application starts it communicates with STS, STS talks to its database to get what parameter values are to be sent to 3rd party service(auth0) . Then the auth0 redirects user to the respective login screen. Once authenticated, STS gets intimated. STS generates token and sends it back to the MVC application.
Hi Rahul, as always one more great tutorial. We have 30+ applications/apis/functions with each pointing to the same database(connection string).
If we setup one app Configuration for db read for all the apps with SetCacheExpiration as 1 sec.Then number of requests in one hour would be
30*60*60=108,000 requests with one instance only. And each api is loadbalanced(autoscaling), the instances count usually is between 2 to 6. So the number of
requests increases further. What do you suggest here as even the Standard pricing model has limitation of 20,000 requests per hour?
Hey Vinay, Glad you liked the video. When changing connection string don't delete the old one immediately (very similar to having a primary and secondary key). If you keep the cache expiration to a larger value (let's say 30 minutes), during that time all the applications will gradually fall over to the new key. You can use queries on your backend then to verify that all connections have switched over to the new key and then retire the old one (after 30 minutes, if all automatic updates were successful). Let me know if that helps or if you have additional questions.
@@RahulNath Hi Rahul, thanks. Yes this idea helps. I will reach out to you if I need any help when I am going to implement this.
@@VinayKumar-qu1eg Do let me know!
@@RahulNath Hi Rahul,
We have started using 'App Configuration' to store database connectionString and read it in all our apis.
We store database connectionString in KeyVault and reference it in App Configuration using KeyVault reference way.
2 Observations
1) Once we update connectionString in KeyVault, api will not pick new version until we update 'App Configuration' (just need to re-reference the keyvault)
- Is it by design ?
2) From the code, if we use Scoped/Transient service for the db connection, it works as expected for the updated connectionString. But if we make database connection service as Singleton, then even after updating the KeyVault's db connection with new version and re-reference it in app configuration, still it picks the old version since the db connection service is a Singleton
- Is their any better and easy way to notifiy appService to re-initialize db service instace once there is a change in connection from KeyVault&/App Configuration ?
@@VinayKumar-qu1eg When integrating with Key Vault are you specifying a specific version or the latest version? I will try this out myself and let you know.
When using Singleton instances it depends on how you are resolving the connection string value inside. If it's during construction time then I guess it's working as expected. You will need to add in additional code in the case you getting an unauthorized error to reinitialize your connection inside the singleton class. Is there a specific reason to keep it as Singleton?