This is the repository for Azure App Service diagnostics experience.
- Install Node 12.*
- Download the .msi file from https://nodejs.org/en/download/ and install it on your machine
- Install Angular-CLI 8
npm install -g @angular/cli@8
- Build the diagnostic-data lib, Applens and Diagnostics Portal:
npm run build
- Run the project locally:
- To run Applens:
npm run applens - To run Diagnostics Portal: App Service Diagnostics Portal
- To run Applens:
- Node 12.*
- Node Package Manager (npm)
- Typescript
npm install -g typescript - Angular-CLI
npm install -g @angular/cli@8
root
│
└───AngularApp
│ │ This is the home of the angular code for App Service Diagnostics Portal and Applens
| |
| | angular.json - This is the angular-cli configruation file
│ │
│ └───projects
| | This is the list of projects registered in angular.json
| |
│ └───app-service-diagnostics
| | | This is the code for the external App Service Diagnostics Portal
| |
| └───applens
| | | This is the code for Applens
| |
| └───diagnostic-data
| | This is a library containing the common component and services
| | that are used to generate detector views in ASD/Applens.
| | Any component or feature that you want to use both internally
| | or externally should be put here
│
└───Backend
│ │ ASP.Net Core Backend for App Service Diagnostics Portal
|
└───ApplensBackend
│ │ ASP.Net Core Backend for Applens
- Clone repo
git clone https://github.com/Azure/Azure-WebApps-Support-Center.git - Navigate to the angular root folder
AngularAppand runnpm install(This will install all the required packages.)
- Create a Local Environment Settings file
- Copy
AngularApp\projects\app-service-diagnostics\src\environments\environment.tsto createAngularApp\projects\app-service-diagnostics\src\environments\environment.local.ts - Set key
"useApplensBackend"totrue
- Copy
- Get Resource Auth Token from ARM Client:
- Install ArmClient:
choco install armclient- Ensure source
chocolateyis enabled:choco source enable -n=chocolatey
- Ensure source
- Log in to ArmClient:
ARMClient.exe login - Run
ARMClient.exe token {SubscriptionID}with your Subscription ID, which will copy the Auth Token to the clipboard
- Install ArmClient:
- Add Auth Token and ResourceID to Local Environment Settings:
- Paste the ArmClient token from the above step into
authServiceTokeninenvironment.local.ts - Copy the ID of a Resource you want to test, and paste it into
authServiceResourceIdinenvironment.local.ts
- Paste the ArmClient token from the above step into
- Skip Authorization in ApplensBackend
- Open
appsettings.Development.json - Set
"ServerMode": "internal"
- Open
- Create a self-signed certificate for Applens
- Navigate to
AngularApp\ssl - Follow the instructions in
AngularApp\ssl\README.mdto create a self-signed certficate and install the certificate for your local machine in Trusted Root
- Navigate to
- Run the SSL server
- Run
npm run ssl-local - Navigate to
https://localhost:3000to confirm the server is up - Access the resource denoted by the Resource ID you copied using the Local Portal Test URL
- This will load the iframe from
https://localhost:3000. Must be running in ssl mode. - Any changes made to the locally hosted project will be automatically refreshed in the Portal
- Run
- In order to test your local changes in the portal, you can use the following links:
- Right now the back end is optional as it is not required for functionality of the angular project.
- You will need appropriate secrets to be added to appsettings.Development.json.
- Open the
Backendproject in Visual Studio 2017 and run it inIIS Expressmode.
- The production build commands for the angular projects are as follows:
npm run build-applens- Build Applens. Build output is placed inApplensBackend/wwwroot.npm run build-asd- Build App Service Diagnostic Portal. Build output is placed inBackend/wwwroot.npm run build- Build both App Service Diagnostic Portal and Applens.
- If you have the appropriate Publishing Profiles, you can deploy these changes to the staging slots.
- TODO: Azure Dev Ops Integration