-
Install Visual Studio 2019 with the '.NET Core', 'Desktop Development with C++'. and 'Azure Development' workloads.
-
Install Azure Service Fabric SDK: https://www.microsoft.com/web/handlers/webpi.ashx?command=getinstallerredirect&appid=MicrosoftAzure-ServiceFabric-CoreSDK
-
Install SQL Server Express: https://www.microsoft.com/en-us/sql-server/sql-server-downloads
-
Install Node.js LTS. When asked, at the end of installation, also opt-in for all necessary tools.
-
Acquire the required secrets from Azure key vault. This can be done by running /src/Maestro/bootstrap.ps1 from an admin powershell window (note: the Powershell ISE may have problems running this script). This script will do three things:
- Download a secret required for using the
Microsoft.Azure.Services.AppAuthentication
package from the service fabric local dev cluster - Download and install the SSL cert used for local development from key vault
- Configure the SQL Server LocalDB instance for use from the local Service Fabric cluster
- Download a secret required for using the
-
Make sure you have installed Entity Framework Core CLI by running
dotnet tool install --global dotnet-ef
-
From the Maestro.Data project directory, run
dotnet ef --msbuildprojectextensionspath <full path to obj dir for Maestro repo (e.g. "C:\arcade-services\artifacts\obj\Maestro.Data\")> database update
.- Note that the generated files are in the root artifacts folder, not the artifacts folder within the Maestro.Data project folder
-
Join the @maestro-auth-test org in GitHub (you will need to ask someone to manually add you to the org).
-
In SQL Server Object Explorer in Visual Studio, find the local SQLExpress database for the build asset registry and populate the Repositories table with the following rows:
-
- Repository: https://github.com/maestro-auth-test/maestro-test
- Installation Id: 289474
-
- Repository: https://github.com/maestro-auth-test/maestro-test2
- Installation Id: 289474
-
- Repository: https://github.com/maestro-auth-test/maestro-test3
- Installation Id: 289474
-
-
Run
.\Build.cmd -pack
at the root of the repo -
Install ngrok from https://ngrok.com/ or
choco install ngrok
-
(optional - when darc is used) Run
ngrok http 8080
and then use the reported ngrok url for the --bar-uri darc argument
After successfully running bootstrap.ps1
running the MaestroApplication
project via F5 in VS (launch as elevated) will run the application on http://localhost:8080
.
Maestro.Web uses Azure AppConfiguration (AAC) to dynamically enable/disable automatic build to channel assignment. AAC works basically as a KeyVault, however it doesn't need to necessarily store secrets. We use Azure Managed Service Identity (AMSI) to authenticate to AAC.
- https://docs.microsoft.com/en-us/azure/azure-app-configuration/overview
- https://zimmergren.net/introduction-azure-app-configuration-store-csharp-dotnetcore/
- https://docs.microsoft.com/en-us/azure/azure-app-configuration/howto-integrate-azure-managed-service-identity
If you want to run the C# scenario tests (make sure that you followed the getting started steps before), you will need to set some environment variables:
- GITHUB_TOKEN : Get a github PAT from https://github.com/settings/tokens
- AZDO_TOKEN Get a Azure DevOps PAT from https://dnceng.visualstudio.com/_usersSettings/tokens (or appropriately matching project name if not dnceng)
- MAESTRO_TOKEN : Get a maestro bearer token (you can create one after running maestro app)
- DARC_PACKAGE_SOURCE : Get the path to the darc nuget package (which would be in
arcade-services\artifacts\packages\Debug\NonShipping\
, see below for getting this built) - MAESTRO_BASEURI : Run ngrok and get the https url
Generally this is easiest if you want to debug both sides to simply have two instances of Visual Studio 2019 running. See below if you do not have the file paths mentioned for DARC_PACKAGE_SOURCE
Since Visual Studio's Debug Environment variable settings do not apply to debugging tests, you'll need to set them, preferably from a command prompt:
- Start command prompt
- set AZDO_TOKEN=...
- set GITHUB_TOKEN=...
- set MAESTRO_TOKEN=...
- set DARC_PACKAGE_SOURCE=...
- set MAESTRO_BASEURI=https://blahblahblah.ngrok.io
- "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\Common7\IDE\devenv.com" (adjusted for your VS version / drive)
When debugging the tests, you can check this via the Immediate window, e.g. by running System.Environment.GetEnvironmentVariable("GITHUB_TOKEN")
Things to try:
- If Visual Studio hangs, edit the properties of MaestroApplication and change
Application Debug Mode
toRemove Application
- If Visual Studio still hangs, under Debug->Options, uncheck "Enable Diagnostic Tools while debugging"
- Clean your repository before building/running. (e.g. cd to repo,
git clean -xdf
) - Ensure the ASP.NET Workload is installed for Visual Studio.
- If you are using your own PATs for debugging tests, your account needs to have permissions to the repositories involved and include appropriate scopes (default is just 'public')
- To build the packages folder starting from a clean repository, run desktop
nuget restore arcade-services.sln
then desktopmsbuild arcade-services.sln /t:Restore,Build,Pack
. Non-desktop versions of build, including dotnet.exe, will fail building the .sfproj projects and then not pack the nupkgs. - Seeing errors like
EXEC : gyp verb `which` failed error : not found: python2 [E:\gh\chcosta\arcade-services\src\Maestro\maestro-angular\maestro-angular.proj]
EXEC : gyp verb `which` failed python2 error : not found: python2 [E:\gh\chcosta\arcade-services\src\Maestro\maestro-angular\maestro-angular.proj]
Make sure python 2.7 is installed and on your path. You may have to copy python27\python.exe
to python27\python2.exe