This project has dependencies on OAuth authentication.
- Clone this repository to your local drive.
- Open
ARMExplorer.sln
with VS 2017+ and compile.
- Go to Azure Portal while logged in as an Org ID (i.e. not MSA) and create AAD Application. You may create an application on existing AAD directory or a new directory altogether.
- Select 'Azure Active Directory' and then 'App registrations' and click 'New application registration'
- Enter any name for application name.
- Select
WEB APPLICATION AND/OR WEB API
- Enter
https://localhost:44300/
asSIGN ON URL
- For
APP ID URL
, enter something likehttps://davidebboslingshot.onmicrosoft.com/
. - Once created, click
Settings
tab - On
Required permissions
, addWindows Azure Service Management API
and checkAccess Azure Service Management
forDelegated Permissions
and save. - In 'Reply URLs' add 'https://localhost:44300/manage'
- Copy
CLIENT ID
and paste it in this line, replacingEnvironment.GetEnvironmentVariable("AADClientId")
. - On
Keys
section, create a client secret. Copy the key and paste it in the same file, replacingEnvironment.GetEnvironmentVariable("AADClientSecret")
.
Test with localhost
- Build the solution using VS.
- Starting running it in the debugger (F5).
- In browser, it should redirect to login page.
- Enter AAD account and password. Note: try account that is not in the same directly as the application. Note: currently this does not work with MSA account.
- You should be prompt with OAuth allow/deny page, do accept it.
https://localhost:44306/api/token
- show current token details.https://localhost:44306/api/tenants
- show all tenants (AAD directory) user belongs to.- and so on..
- Create Azure Websites with local git publishing enabled
- Add the site https url as the reply URL for AAD application
- Deploy the website by pushing the repository
- Set AADClientID and AADClientSecret appSettings
- To test, simply browse to the website and append the query string "?repository="
- Unit test support is still evolving and the tests are located under ng\test directory.
- Tests are built using tsconfig.json file under ng folder.
- You will need to have tsc and node installed before you can run the tests. You can use npm for this.
- Navigate to ng directory and compile the files using 'tsc' and run the tests using 'node manageWithTests.js'
- Remember to update the tsconfig.json file when adding new test files.
Swagger files can be found at https://github.com/Azure/azure-rest-api-specs. For web apps the specs can be found internally under bin\Hosting\Azure\GeoMaster\Swagger\Service.json
Swagger files for all ARM providers are under App_Data/SwaggerSpecs. To update specs for any provider, locate the folder corresponding to the specific provider under SwaggerSpecs and do the following:
- To update an API in an existing file replace the old file contents with the latest specs.
- To move API to a new file, you will have to delete the old API from the existing file apart from adding the new file(s).
- To delete an API , remove the API from existing files.
- To add new API, copy the new files to the provider folder.
- To add new provider, create a new folder for the provider under SwaggerSpecs and place all your files inside the folder.
- When adding new files, make sure you include them in the csproj file. Ex: https://github.com/projectkudu/AzureResourceExplorer/blob/526106d2690bfadee6125a9e5c9b36ac1381d485/ARMExplorer.csproj#L193
Create a pull request with your changes.