Giter Site home page Giter Site logo

servicefabricgetvmss's Introduction

Get Azure ScaleSets per Service Fabric Cluster Console Application

Create a Service Principal

The sample assumes that you have already set up a Service Principal to access your Azure subscription.

Required information:

  • Subscription
  • AzureTenantId
  • AzureClientId
  • AzureClientSecret

Can be obtained from the previous step. You already have the AzureClientSecret since you used it to create the Service Principal. The AzureTenantId and the AzureClientId will be returned by the az ad sp create-for-rbac command you executed before.

Update the file appsettings.json with all required info.

Request the Access Token

Next, obtain an authentication token for your Service Principal.

string token = await AuthenticationHelpers.AcquireTokenBySPN(
	tenantId, clientId, clientSecret);

Call the Azure ARM API

Then, gets the list of Service Fabric cluster resources created in the specified subscription calling the Azure ARM API using plain REST. List Request

Resource Graph query

And last, using Resource Graph you can get the VMSS details where you can associate with every cluster ID. Resource: Quickstart: Run your first Resource Graph query using .NET Core

Dependencies

Required Packages:

  • Microsoft.Azure.Management.ResourceGraph" Version="2.0.0"
  • Microsoft.Azure.Management.ResourceManager" Version="3.13.1-preview"
  • Microsoft.Extensions.Configuration" Version="5.0.0"
  • Microsoft.Extensions.Configuration.FileExtensions" Version="5.0.0"
  • Microsoft.Extensions.Configuration.Json" Version="5.0.0"
  • Microsoft.IdentityModel.Clients.ActiveDirectory" Version="5.2.9"
  • Microsoft.Rest.ClientRuntime" Version="2.3.23"
  • System.Net.Http.Formatting.Extension" Version="5.2.3"

servicefabricgetvmss's People

Contributors

mauricio-msft avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

whitwaldo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.