Skip to content

Instantly share code, notes, and snippets.

@isaacrlevin
Created November 19, 2021 23:18
Show Gist options
  • Select an option

  • Save isaacrlevin/aaf31ddc42de5f780e03377498280119 to your computer and use it in GitHub Desktop.

Select an option

Save isaacrlevin/aaf31ddc42de5f780e03377498280119 to your computer and use it in GitHub Desktop.
Azure SDK
var credential = new AzureCliCredential();
ArmClient armClient = new ArmClient(credential);
var subscriptions = armClient.GetSubscriptions();
var sub = subscriptions.Where(a => a.Data.SubscriptionGuid == mySubId).FirstOrDefault();
var creds = new AzureIdentityFluentCredentialAdapter(sub.Data.TenantId, AzureEnvironment.AzureGlobalCloud);
// fails here
var websites = await Azure.Authenticate(creds)
.WithSubscription(sub.Data.DisplayName)
.WebApps.ListByResourceGroupAsync(rgName);
@isaacrlevin

Copy link
Copy Markdown
Author

That doesn't seem to work either. If you have a preferred sample, I will gladly take that.

@isaacrlevin

isaacrlevin commented Nov 22, 2021 via email

Copy link
Copy Markdown
Author

@isaacrlevin

isaacrlevin commented Nov 23, 2021 via email

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment