How microsoft/partner-center-dotnet-samples works
Project type and purpose
• This repository is a collection of .NET sample applications and tools demonstrating how to interact with the Microsoft Partner Center SDK and how to implement the Secure App Model using Azure Key Vault.
• It includes:
• Two command-line tools (MCARefreshBulkAttestationCLITool and NCEBulkMigrationTool)
• A suite of console “sdk” samples covering Partner Center SDK scenarios
• A “secure-app-model” section with three projects (CPVApplication, CSPApplication, PartnerConsent web app) showing Key Vault integration and OAuth flows
File structure
• Top-level folders:
• MCARefreshBulkAttestationCLITool (CLI tool for bulk customer re-attestation)
• nce-bulk-migration-tool (CLI for New Commerce bulk migration)
• sdk (console apps grouped by scenario/category under SdkSamples)
• secure-app-model (Key Vault samples: CPV, CSP, ASP.NET MVC partner consent app)
• Common sub-structures in each console/web project:
• Interfaces (ICustomerProvider, ITokenProvider, IFileProvider)
• Providers (implementations: CsvProvider, TokenProvider, CustomerProvider)
• Http folder (extension methods for HttpClient)
• Models (DTOs for Partner Center request/responses)
• AppSettings/Configuration files (appsettings.json, App.config)
• Build/deployment files:
• .csproj and .sln for each project
• Azure Pipelines YAML for CI/CD
• Scripts to install or update tools
README for additional insights
• The root README splits the repository into two main scenario sets: “SDK Samples” (console scenarios using Partner Center .NET SDK) and “Secure App Model” (demonstrates best practices for CPV/CSP apps using Key Vault).
a. Main components (grouped into logical layers)
• Presentation/CLI layer
• MCARefreshBulkAttestationCLITool
• NCEBulkMigrationTool
• SdkSamples console app
• PartnerConsent ASP.NET MVC web app
• Business/Provider layer
• ITokenProvider + TokenProvider
• ICustomerProvider + CustomerProvider
• IFileProvider + CsvProvider
• INewCommerceMigrationProvider, ISubscriptionProvider, etc.
• HttpClient extensions (McaHttpClientExtensions)
• SDK/Service layer
• Partner Center .NET SDK (NuGet packages)
• Azure Key Vault client libraries (for secure-app-model projects)
• External services
• Partner Center REST API (PartnerCenter endpoint)
• Azure Active Directory (OAuth token issuance)
• Azure Key Vault (secret storage)
• Local file system (CSV import/export)
b. Relationships and data flows
• CLI/Console apps → TokenProvider → AAD → partner center SDK → Partner Center API
• CSVProvider reads local CSV → constructs domain model → CustomerProvider calls SDK
• Secure-app projects → KeyVaultProvider → Azure Key Vault → retrieve client secrets → AuthorizationUtilities → obtain AAD token → call Partner Center
• PartnerConsent web app uses MVC controllers to present UI, triggers calls through AuthorizationUtilities and KeyVaultProvider before delegating to Partner Center SDK
c. Architectural patterns and design principles
• Dependency Injection (Interfaces decoupled from Implements)
• Layered architecture (Presentation → Business → SDK / External)
• Single Responsibility (each Provider has one concern: token, file, customer, migration)
• Extension Methods for configuring HttpClient consistency
• MVC pattern in the ASP.NET PartnerConsent app
d. Key technologies, frameworks, libraries
• .NET Core / .NET Framework console & web projects
• Partner Center .NET SDK (PartnerCenter NuGet)
• Azure.Identity or ADAL/MSAL for authentication
• Microsoft.Azure.KeyVault or Azure.Security.KeyVault.*
• ASP.NET MVC (PartnerConsent web app)
• CsvHelper or custom CSVProvider for file I/O