Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

How to deal with IAzure Interface while migrating from Microsoft.Azure.Management.Fluent to Azure.ResourceManager?

$
0
0

I am migrating my source code to use Azure.ResourceManager package instead of Microsoft.Azure.Management.Fluent (which is deprecated).My code uses IAzure interface like mentioned below:

/// <summary>/// The azure context./// </summary>private readonly IAzure azureContext;this.azureContext = this.GetAzureForSubAsync().ConfigureAwait(false).GetAwaiter().GetResult();// method declaration here for GetAzureForSubAsyncprivate async Task<IAzure> GetAzureForSubAsync(){    // <some logic>    return Azure.Configure()        .WithLogLevel(HttpLoggingDelegatingHandler.Level.BodyAndHeaders)        .Authenticate(new AzureCredentials(tokenCredentials, tokenCredentials, tenantId, AzureEnvironment.AzureGlobalCloud))        .WithSubscription(this.subscriptionId);}

I am not sure which Interface would provide me the equivalent logic in new package ie. Azure.ResourceManager

While pipeline build, I get this error:

##[error]src\Test\LoadTest\ARMLib\ARMExecutor.cs(16,21): Error CS0234: The type or namespace name 'Rest' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)##[error]src\Test\LoadTest\ARMLib\ARMExecutor.cs(170,28): Error CS0246: The type or namespace name 'IAzure' could not be found (are you missing a using directive or an assembly reference?)##[error]src\Test\LoadTest\ARMLib\ARMExecutor.cs(26,26): Error CS0246: The type or namespace name 'IAzure' could not be found (are you missing a using directive or an assembly reference?)

I have gone through documentations but I think I am not getting it.https://learn.microsoft.com/en-us/dotnet/api/azure.resourcemanager?view=azure-dotnet


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>