Giter Site home page Giter Site logo

microsoft / partner-center-storefront Goto Github PK

View Code? Open in Web Editor NEW
20.0 18.0 52.0 2.04 MB

A storefront that enables reseller partners to onboard customers and place orders for these customers.

License: MIT License

C# 50.00% CSS 3.68% JavaScript 33.34% PowerShell 0.64% HTML 12.34% ASP.NET 0.01%

partner-center-storefront's Introduction

Partner Center Storefront

Build Status

GitHub issues GitHub pull-requests

Overview

A web application that acts as a store front for Microsoft partners and enables them to sell Microsoft offers to their customers. The application gives partners the following features:

  1. Configure the Microsoft offers they would like to sell to their customers. Partners can set the price and append extra details.
  2. Configure the portal branding to reflect their company branding. This includes setting the company name, header icons, etc...
  3. Payment. Partners can configure their PayPal pro account which will receive payments from customers.

The store front application currently supports the following languages (French, Spanish, German and Japanese) along with English which serves as the fallback language. It uses the partner's default locale to configure the locale (currencies, date formats, localized offers in the repository) using the partner Profile from Partner Center.

Customers can

  1. Use the portal to view the offers available, purchase the quantities they need and make a payment from the storefront.
  2. Log back in and view their subscriptions, purchase extra seats or renew about to expire subscriptions.
  3. View all the subscriptions (whether they have purchased via the store front or have been managed for them from Partner Center) in the My Account page after they login.

Deployment

You can perform this deployment through Partner Center, to start this process click here. Also, there is a deployment project included in the solution through which, deployment can be started with the specified inputs.

Deploy to Azure Visualize

Build & Deploy on your own

If you are interested to fork and custom build/deploy the store front. We recommend reading this blog post by Isaiah Williams

Clone the source code and perform the following steps:

  1. Go to Partner Center, Account Settings, App Management and onboard a new Web App. Copy the application ID, application secret and the partner tenant ID into the following settings in Web.Config:

    <!-- Enter your Partner Center AAD application ID here -->
    <add key="partnerCenter.applicationId" value="" />
    
    <!-- Enter your Partner Center AAD application secret here -->
    <add key="partnerCenter.applicationSecret" value="" />
    
    <!-- Enter your Partner Center AAD tenant ID here -->
    <add key="partnerCenter.AadTenantId" value="" />
  2. Create a Web application in your Azure AD tenant. The portal will assume the identity of this application. Change the following settings in Web.Config to your AD application information:

    <!-- The AAD client ID of the application running the web portal -->
    <add key="webPortal.clientId" value="" />
    
    <!-- The AAD client secret of the application running the web portal -->
    <add key="webPortal.clientSecret" value="" />
    
    <!-- The AAD tenant ID of the application running the web portal -->
    <add key="webPortal.AadTenantId" value="" />
    
    <!-- The AAD client ID of the application running the web portal -->
    <add key="webPortal.clientId" value="" />
    
    <!-- The AAD client secret of the application running the web portal -->
    <add key="webPortal.clientSecret" value="" />
    
    <!-- The AAD tenant ID of the application running the web portal -->
    <add key="webPortal.AadTenantId" value="" />
  3. Provision an Azure storage account which will store the portal's assets and information. Copy its connection string to:

    <!-- The Azure storage connection string which will host the web portal's settings and customers repository. -->
    <add key="webPortal.azureStorageConnectionString" value="" />
  4. Optionally, specify a REDIS cache connection string to improve performance.

    <!-- The Azure Redis cache connection string. Empty value will disable caching. -->
    <add key="webPortal.cacheConnectionString" value="" />

partner-center-storefront's People

Contributors

christianhenrikreich avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar tameemansari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

partner-center-storefront's Issues

Payment error

When trying to make a purchase a pop says "Preparing order and redirecting to payment gateway... "
then nothing happens.
when looking at console this is one of the error I see.
TypeError: i.paymentId is undefinedStartupClasses:1:163359

VS Deployment - error MSB4086

Deployment is "successful" in visual studio, but when you look at the Deployment Center logs, there is an error:

Failed 35abe9e (Isaiah Williams) Removed duplicate deploy button

details of the log shows this at the bottom:
D:\home\site\repository\packages\Microsoft.Net.Compilers.3.3.1\tools\Microsoft.Managed.Core.targets(63,60): error MSB4086: A numeric comparison was attempted on "$(MSBuildVersion)" that evaluates to "" instead of a number, in condition "$(MSBuildVersion) >= 16.1.0". [D:\home\site\repository\src\Storefront\Storefront.csproj]
Failed exitCode=1, command="D:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "D:\home\site\repository\src\Storefront\Storefront.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="D:\local\Temp\8d7f0e3204af75e";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="D:\home\site\repository.\"
An error has occurred during web site deployment.
\r\nD:\Program Files (x86)\SiteExtensions\Kudu\86.20224.4450\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

WebStore front deployment from CSP admin site error.

Issue : Unable to deploy WebStore front.

Error : The Website is still under construction. Please visit later.
And when tried to configure the storefront with organization name or when tried to login it gives an error “Object reference not set to an instance of an object”

Troubleshooting performed :

• Tried with different Azure subscriptions and tried multiple times with different storefront names.
• All the deployment that we tried has created Storage account, App Service, App Service plan resources ( Azure – All resources )
• Tried update from the Partner Center portal also tried manual sync from App Service – Deployment Center – Sync.
• The Sync get successful but the issue still remains.

Microsoft Storefront - secret keys are expired.

We are a MS CSP and provisioned the Storefront a couple of years ago. A key expired and I don't know where to enter a new one.

Website: https://cns-service.azurewebsites.net

Error:

AADSTS7000222: The provided client secret keys are expired. Visit the Azure Portal to create new keys for your app, or consider using certificate credentials for added security: https://docs.microsoft.com/azure/active-directory/develop/active-directory-certificate-credentials Trace ID: 77881f19-b041-4434-a4a5-beb802c31600 Correlation ID: 9bb1a63e-8b44-44eb-b361-55123d98d413

Usage of CreateAsync() method triggering 409(container already exist) errors resulting unresponsive application

Hello Team,

When using the following application "https://github.com/microsoft/Partner-Center-Storefront", noticed container "customerportalassets" being called multiple times and multiple 409(container already exists) errors received on create container operation resulting in an unresponsive application.

From the below code section ,noticed CreateAsync() method

///


/// Returns a cloud BLOB container reference which can be used to manage the public customer portal assets.
///

/// The public customer portal assets BLOB container.
public async Task GetPublicCustomerPortalAssetsBlobContainerAsync()
{
if (publicBlobContainer == null)
{
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
publicBlobContainer = blobClient.GetContainerReference(PublicPortalAssetsBlobContainerName);
}

        if (!await publicBlobContainer.ExistsAsync().ConfigureAwait(false))
        {
            await publicBlobContainer.CreateAsync().ConfigureAwait(false);

            BlobContainerPermissions permissions = await publicBlobContainer.GetPermissionsAsync().ConfigureAwait(false);
            permissions.PublicAccess = BlobContainerPublicAccessType.Blob;

            await publicBlobContainer.SetPermissionsAsync(permissions).ConfigureAwait(false);
        }

        return publicBlobContainer;
    }

As per following document this method will throw error when container already exists. Reference doc : https://docs.microsoft.com/bs-latn-ba/Azure/storage/blobs/storage-blob-container-create?tabs=dotnetv11#create-a-container

 The CreateIfNotExists and CreateIfNotExistsAsync methods return a Boolean value indicating whether the container was created. If a container with the same name already exists, these methods return False to indicate a new container wasn't created. 

could you please confirm if this createAsync() method here could be causing the 409s on container "customerportalassets" , If
not , please share your insights or workaround to avoid these errors from Application end.

Deployment Status Failed

D:\home\site\repository\packages\Microsoft.Net.Compilers.3.3.1\tools\Microsoft.Managed.Core.targets(63,60): error MSB4086: A numeric comparison was attempted on "$(MSBuildVersion)" that evaluates to "" instead of a number, in condition "$(MSBuildVersion) >= 16.1.0". [D:\home\site\repository\src\Storefront\Storefront.csproj]
Failed exitCode=1, command="D:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "D:\home\site\repository\src\Storefront\Storefront.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="D:\local\Temp\8d8021b09bee4c8";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="D:\home\site\repository.\"
An error has occurred during web site deployment.
\r\nD:\Program Files (x86)\SiteExtensions\Kudu\87.20512.4591\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

Deployment issues

Hello everybody.

I'm having a problem implementing the feature, no matter how successfully I perform the implementation, my Web App brings up the empty site.

Is there any other documentation that could help me with the implementation?
I just need a starting guide.

issue with deploying to azure

first of all the readme.md need to be updated as this part is different Build & Deploy on your own

Now I have tried to deploy through the deploy to azure button

I got this error

Deployment to resource group 'new-test' failed.
Additional details from the underlying API that might be helpful: At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.

tried to deploy with visual studio 2019 got the same thing
following this article (which was out of date)
https://docs.microsoft.com/en-us/archive/blogs/iwilliams/reseller-storefront

after the second attempt it built successfully (just did redeploy without any modifications)

but still got the default page with this text

Hey, App Service developers!

Your app service is up and running.
Time to take the next step and deploy your code.

tried to publish by the publish option in visual studio

filled all the option Web.config

did not find any option that says secret key to fill
publish succeeded, opened the site got the following message in the browser

[AdalServiceException: Response status code does not indicate success: 401 (Unauthorized).]
   Microsoft.Identity.Core.OAuth2.<GetResponseAsync>d__18`1.MoveNext() in D:\a\1\s\src\Microsoft.IdentityModel.Clients.ActiveDirectory\Core\OAuth2\OAuthClient.cs:66

[AdalServiceException: AADSTS7000215: Invalid client secret is provided.
Trace ID: 6c8d61c0-69fd-45b0-a796-6e20a4b83500
Correlation ID: bfd2304e-86f4-4b0d-b1d7-409c7a1db9aa
Timestamp: 2020-04-27 01:06:26Z]

Cannot choose Country

Hi.

We have set up our Storefront at https://office365mexico.azurewebsites.net/, but we are having some problems. Whenever a client wants to purchase an Office 365 subscription, they can't, because once in the shopping cart, they need to choose a country. The problem is that the dropdown list of countries is empty and one can't just type a country name.

Has anyone else had this problem? Any solutions?

Here is the image of the error:

Webstorefront Error - 28 May 2019.docx

Thanks!

Blank Page after Deployment and configuration

  1. Try
    Deployment via PartnerCenter under Partner Settings -> Storefrontt
    -> Failed but resources where created, Result: Blank web page

  2. Try
    Downloaded Partner-Center-Storefront repository
    Configured the existing parameters correctly
    All assets and templates where deployed into blob storage
    Both app registrations have required permissions
    -> Deployment succeeded without error, Result: Blank web page

  3. Try
    Added _artifactsLocation, _artifactsLocationSasToken, StoreFrontPackageFolder, StoreFrontPackageFileName Parameters in website.json/website.parameters.json
    Both app registrations have required permissions
    -> Deployment suceeded without errors, Result: Blank web page

  4. Try
    Contacted Microsoft Support
    Response:
    The problem doesn't seem to be connected to the subdomain, unfortunately after several tests we have the same result in the test area. Unfortunately we don't have any technical support available on this section, as stated in the following document, point 6.

Could there be any issues with the Key Vault?
If i execute the Web Page locally it breaks with the error: No endpoint defined in global.asax.cs line 39, ApplicationDomain.BootstrapAsync()

Is there anything I'm doing wrong (+MS Support)?

Greetings and thanks for help

ArgumentException: endpoint is not set

While trying to run the project from visual studio, I am getting following exception:

File Name: Global.asax.cs
Line Number: 39
Line Code: Task.Run(() => ApplicationDomain.BootstrapAsync()).Wait();

Exception Details:
System.AggregateException
HResult=0x80131500
Message=One or more errors occurred.
Source=mscorlib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at Microsoft.Store.PartnerCenter.Storefront.MvcApplication.Application_Start() in C:\Users\User1\Desktop\Partner Center Storefront\src\Storefront\Global.asax.cs:line 39

Inner Exception:
ArgumentException: endpoint is not set

Am I missing the any initial steps we need to perform before we can successfully build/run the solution?

Deploying program failure is always have a conflict status

I use the "Deploy to Azure" button. I try a lot of times but I cannot deploy the program successfully. It always shows the Status message as follows
{
"status": "Failed",
"error": {
"code": "ResourceDeploymentFailure",
"message": "The resource operation completed with terminal provisioning state 'Failed'."
}
}
擷取

and I cannot find what's wrong with this situation. What should I solve this problem. Thanks!

Cannot buy the trial subscription

When I use the Preapproved account to buy the trial subscription, it will show the error message and I cannot buy the subscription.
trial錯誤訊息

Operation returned an invalid status code 'NotFound'

i got this error. any one help me here ?

at Microsoft.Azure.KeyVault.KeyVaultClient.d__65.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.KeyVault.KeyVaultClientExtensions.d__12.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.Store.PartnerCenter.Storefront.BusinessLogic.KeyVaultService.d__3.MoveNext() in E:\Project\StoreFront\Partner-Center-Storefront-master\src\Storefront\BusinessLogic\KeyVaultService.cs:line 61

failed to run the store front application in app service

We tried to use Visual Studio to deploy the code to Azure App Service. Also configured the web.config file. But the web app currently reporting the following error message. "[ArgumentException: endpoint is not set]"
In which configure file should we set the endpoint value, and how to set it?
detailed error message:

[ArgumentException: endpoint is not set]
Microsoft.Store.PartnerCenter.Storefront.ValidationExtensions.AssertNotEmpty(String nonEmptyString, String caption) in C:\Users\Administrator\Desktop\Partner-Center-Storefront-master\src\Storefront\ValidationExtensions.cs:43
Microsoft.Store.PartnerCenter.Storefront.BusinessLogic.KeyVaultService..ctor(String endpoint) in C:\Users\Administrator\Desktop\Partner-Center-Storefront-master\src\Storefront\BusinessLogic\KeyVaultService.cs:39
Microsoft.Store.PartnerCenter.Storefront.BusinessLogic.d__65.MoveNext() in C:\Users\Administrator\Desktop\Partner-Center-Storefront-master\src\Storefront\BusinessLogic\ApplicationDomain.cs:119

[AggregateException: One or more errors occurred.]
System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) +4751668
System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) +14351601
Microsoft.Store.PartnerCenter.Storefront.MvcApplication.Application_Start() in C:\Users\Administrator\Desktop\Partner-Center-Storefront-master\src\Storefront\Global.asax.cs:39

[HttpException (0x80004005): One or more errors occurred.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +517
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +185
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +168
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +277
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +369

[HttpException (0x80004005): One or more errors occurred.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +714

CustomerAccountController.cs

When customers log in and tries to manage subscriptions, they get:
Could not retrieve your account. Please try again later.

I traced this to line 125 in CustomerAccountController.cs
IEnumerable customerSubscriptions = await ApplicationDomain.Instance.CustomerSubscriptionsRepository.RetrieveAsync(Principal.PartnerCenterCustomerId).ConfigureAwait(false);

Line 123 works as expected:
ResourceCollection customerAllSubscriptions = await localeSpecificPartnerCenterClient.Customers.ById(clientCustomerId).Subscriptions.GetAsync().ConfigureAwait(false);
I see all customer subscriptions (test customer has 4 different office monthly products)

The test customer has no Azure subscription.

Initial Setup

After logging in for the first time, I am seeing:

Your Organization Name
Response status code does not indicate success: 400 (BadRequest).
Home page, Sign out

I've double checked my settings with the blog post. The only difference is the API permissions for the App Registration - where the UI has changed significantly. I've added Azure Service Management/user_impersonation to the already existing Microsoft Graph/User.Read.

I feel like there should be more - does anyone have a hint? Or am I headed in the wrong direction?

Connection String: [No connection string specified]

Connection String: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/8430550f-01d2-4dd8-a579-cfc7679facd9. Exception Message: Tried the following 4 methods to get an access token, but none of them worked.
Parameters: Connection String: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/8430550f-01d2-4dd8-a579-cfc7679facd9. Exception Message: Tried to get token using Managed Service Identity. Access token could not be acquired. An error occurred while sending the request.
Parameters: Connection String: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/8430550f-01d2-4dd8-a579-cfc7679facd9. Exception Message: Tried to get token using Visual Studio. Access token could not be acquired. Visual Studio Token provider file not found at "D:\local\LocalAppData.IdentityService\AzureServiceAuth\tokenprovider.json"
Parameters: Connection String: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/8430550f-01d2-4dd8-a579-cfc7679facd9. Exception Message: Tried to get token using Azure CLI. Access token could not be acquired. 'az' is not recognized as an internal or external command,
operable program or batch file.

Parameters:` Connection String: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/8430550f-01d2-4dd8-a579-cfc7679facd9. Exception Message: Tried to get token using Active Directory Integrated Authentication. Access token could not be acquired. Failed to get user name from the operating system.Inner Exception : The format of the specified domain name is invalid

After also having the end-point error like the other guy, I went and coded the end point in the Web.Config
add key="webPortal.keyVaultEndpoint" value="https://teststorekey.vault.azure.net/" />

Only this seemed to solve the endpoint issue,but now I am having the connection string error also.

I tried deploying using the Deployment project file, but it also throws some powershell errors such as command not recognized, while I am not writing anything there just letting it run.

Deployment template validation failed: 'The template resource 'Microsoft.Web/sites/<webSiteName>' cannot reference itself. Please see https://aka.ms/arm-template-expressions/#reference for usage details.'

Steps to reproduce

What steps can reproduce the defect?

  • Click on the "Deploy to Azure" link in README.md file;
  • Fill out the form with all appropriate values (e.g. web site name with max 15 characters);
  • Click on "Next";
  • Got the following error:

"Deployment template validation failed: 'The template resource 'Microsoft.Web/sites/' cannot reference itself. Please see https://aka.ms/arm-template-expressions/#reference for usage details.'."

PC Storefront for the New Commerce Experience (NCE)

Feature Request

Is your feature request related to a problem? Please describe.
Microsoft recently launched the New Commerce Experience which uses slightly different API calls and 'workflow' during the purchase experience. Looking at the existing code-base, it does not look like it has changed and therefore would not take advantage of the new commerce experience per say. Not to mention that by March 31, 2022, only the new commerce experience will be possible.

Describe the solution you would like
Update the PC Storefront and code sample to use the new functionalities introduced with the NCE

Describe alternatives you have considered
Hack the existing code

Additional context
Add any other context or screenshots about the feature request here.

Error portalResources is not defined and $WebPortal is not defined in the console

I have downloaded the repo and set everything including the Azure storage blob with all the properties mentioned in the BrandingConfiguration class, and also create a new Azure Application Insights and updated the InstrumentationKey. And when I run the project I am getting the below errors in the console.

Uncaught SyntaxError: Unexpected identifier
appinsights.js:4 Uncaught ReferenceError: portalResources is not defined
    at appinsights.js:4
Shell.js:10 Uncaught ReferenceError: portalResources is not defined
    at new Microsoft.WebPortal.Core.Shell (Shell.js:10)
    at Shell.js:273
SplashScreen.js:50 Uncaught ReferenceError: $WebPortal is not defined
    at SplashScreen.js:50

Below Is the screenshot of the error.

image

Any help is really appreciated.

The identity of the calling application could not be established.

I today was able to do the initial configuration of the web store front via the Partner portal and have started testing the solution.

If I click logon, and then logon as a existing office 365 customer we receive this error. "The identity of the calling application could not be established."

In addition to this we receive this error when selecting the pre-approved customer list from the admin portal.

Could not retrieve pre-approved customer details.

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.