Skip to content

Azure-Samples/create-azure-subscription-dotnet-core

Repository files navigation

page_type languages products description
sample
csharp
dotnet
azure
This is a simple .NET Core sample that uses the Azure .NET SDK to programmatically create EA subscriptions with a service principal.

Programmatically create Azure EA Subscriptions with .NET Core

This is a simple .NET Core sample that uses the Azure .NET SDK to programmatically create EA subscriptions with a service principal.

Run this sample

  1. Get the .NET Core SDK.

  2. Create an Azure service principal either through Azure CLI, PowerShell or the portal.

  3. As an EA Account Owner, follow instructions to give the service principal access to your enrollment account.

  4. Clone the repository and install dependencies

    git clone https://github.com/Azure-Samples/create-azure-subscription-dotnet-core.git
    cd create-azure-subscription-dotnet-core
    dotnet restore
  5. Create an appsettings.json using your tenant ID, application client ID, and client secret from the service principal that you created. Example:

    {
        "tenantId": "yourtenant.onmicrosoft.com",
        "appId": "app ID of the service principal",
        "secret": "client secret of the service principal"
    }
  6. Run the sample.

    dotnet run

Resources

About

An example on how to use .NET Core to create Azure EA subscriptions programmatically

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages