I saw @kamiyn's example here https://github.com/Azure/azure-docs-sdk-dotnet/issues/961#issue-429108506
Is there any smoother way to do it?
I expected these libraries would fit seamlessly, for example:
// Code sketch
// ---------------------
var azureServiceTokenProvider = new AzureServiceTokenProvider();
// Could detect the tenant itself - like AzureServiceTokenProvider.GetAccessTokenAsync(string)
// Could use AzureGlobalCloud by default
TokenCredentials creds = await azureServiceTokenProvider
.LogMeInAsync("https://management.azure.com");
var azure = Azure
.Configure()
.Authenticate(creds);
It's disappointing that I spent hours trying to get AzureServiceTokenProvider to work with Azure.Authenticate. This should be seamless so we can encourage people to use the Fluent API with managed identities.
@ishepherd @seesharprun Please see this temporary adapter that we created here: https://github.com/jongio/azidext
It only supports DefaultAzureCredential for now. Please let me know if you have other requirements.
This is only a stop gap until Fluent supports the new Azure Identity classes.
using JonGallant.Azure.Identity.Extensions;
using Microsoft.Azure.Management.ResourceManager.Fluent;
var creds = new DefaultAzureFluentCredential(tenantId, AzureEnvironment.AzureGlobalCloud);
var resourceGroup = Azure.Authenticate(creds)
.WithSubscription(subId)
.ResourceGroups
.Define(name)
.WithRegion(region)
.Create();
This helps, thanks!
Great. Please let me know if you have any requests / feedback. Apologies for being in this transition state.
No problem. Will this issue be updated when there is a final solution?
I'm starting to use MSAL for everything (authenticating to the graph, accessing Azure SQL DB, etc) and it would be nice to use MSAL with the fluent SDK too.
Yes, we are working on this and will keep this open until it is resolved.
Will the new version support Azure.Identity instead of Microsoft.Azure.Services.AppAuthentication?
@Rookian
The .NET Fluent library depends on an older version of Azure Core library which is now only in maintenance mode (Only critical security and bug fixes)
A newer version of .NET SDK will be released and in public preview late June this month. The new version will have Azure.Identity support. Please monitor this repo and https://azure.github.io/azure-sdk/ for annoucement
@Rookian
The .NET Fluent library depends on an older version of Azure Core library which is now only in maintenance mode (Only critical security and bug fixes)
A newer version of .NET SDK will be released and in public preview late June this month. The new version will have Azure.Identity support. Please monitor this repo and https://azure.github.io/azure-sdk/ for annoucement
Nice information, thank you!
@nickzhums - Please update this issue when Fluent supports Azure.Identity.
@jongio sure, quick note though - the Track 2 .NET SDK will NOT be fluent due to the SDK guidelines, however, it will support azure identity for sure (as it does now)
@Rookian if there are no further questions we'll close this issue
@nickzhums Do you have an example on how I can use Azure.Identity with Microsoft.Azure.Management.Fluent / Microsoft.Azure.Management.ResourceManager.Fluent.
I am a little bit confused and don't know what you mean by
... the Track 2 .NET SDK will NOT be fluent due to the SDK guidelines, however, it will support azure identity for sure (as it does now)
My reading of the statement is that the new v2 SDK that supports MSAL tokens is not fluent. I read the guidelines and it鈥檚 not allowed under the current design/rules.
My reading of the statement is that the new v2 SDK that supports MSAL tokens is not fluent. I read the guidelines and it鈥檚 not allowed under the current design/rules.
So is there a complete new nuget package for provisioning Azure resources?
@seesharprun Yes your understanding is correct
@Rookian sorry for the confusion. We are in the process of designing a hand-written layer on top of the generated code for the new .NET SDK. We hope that the current Fluent customers will be able to migrate to this new API in the future
However, if you are good with just raw code generated SDK and needs to use the Azure Identity, please find the package list in here (https://azure.github.io/azure-sdk/releases/latest/dotnet.html). These are the .NET SDKs under the new guidelines.
Look for packages that has "ResourceManager" or "Resource Manager" in the description
When the re-designed API layer is released, the package namespace will stay the same, likely it will be just another layer based on existing code-gen SDK.
Hope this clarifies things
Nick
@Rookian - Please see this comment for instructions on how to use Azure.Identity with Fluent https://github.com/Azure/azure-sdk-for-net/issues/9262#issuecomment-580444940
Hi, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!
Closing since this comment shows the example being asked for https://github.com/Azure/azure-sdk-for-net/issues/9262#issuecomment-580444940
Most helpful comment
@seesharprun Yes your understanding is correct
@Rookian sorry for the confusion. We are in the process of designing a hand-written layer on top of the generated code for the new .NET SDK. We hope that the current Fluent customers will be able to migrate to this new API in the future
However, if you are good with just raw code generated SDK and needs to use the Azure Identity, please find the package list in here (https://azure.github.io/azure-sdk/releases/latest/dotnet.html). These are the .NET SDKs under the new guidelines.
Look for packages that has "ResourceManager" or "Resource Manager" in the description
When the re-designed API layer is released, the package namespace will stay the same, likely it will be just another layer based on existing code-gen SDK.
Hope this clarifies things
Nick