SignalR-samples/PullRequestR
Brennan 4e1e9474a4
Update samples to 3.0 (#92)
2019-10-25 08:11:27 -07:00
..
android Update samples to 3.0 (#92) 2019-10-25 08:11:27 -07:00
function-dotnet fixed various issues per @anurse 2018-11-01 13:56:21 -07:00
function-javascript initial addition of the android/serverless example 2018-10-30 17:50:00 -07:00
html initial addition of the android/serverless example 2018-10-30 17:50:00 -07:00
project.code-workspace initial addition of the android/serverless example 2018-10-30 17:50:00 -07:00
readme.md initial creation of the sample and readme 2018-10-31 15:50:50 -07:00

readme.md

Sample Setup

Requirements

This setup process assumes you have the following tools installed:

  1. Visual Studio Code
  2. The Azure Extension for Visual Studio Code
  3. JetBrains IntelliJ Idea with the supporting prerequisites for developing Android applications in Java.
  4. A Microsoft Azure subscription. You can sign up for a free account here.

Note - you could also use Visual Studio 2017+ with the Azure workload installed to do these items, use Android Studio for your client development, or any other setup you prefer.

Setup Process

  1. Create an Azure Resource group for the resources you'll create for the app.

  2. Create a new Azure Function in the new resource group.

  3. Create a new Azure SignalR Service instance in the same resource group (free tier is fine).

  4. Set the AzureSignalRConnectionString environment variable in your Azure Function to be the connection string of the Azure SignalR Service you created.

  5. Open the project workspace in this directory by typing code .\project.code-workspace at the command line.

  6. Deploy either the function-dotnet code if you want a .NET back-end Function, or the function-javascript if you'd like to have a Node.js back-end function. Both sets of code operate the same way and will achieve the same result.

  7. Change line 33 of android\app\src\main\java\com.example.pullrequestr\MainActivity.java from this:

    String url = "https://YOUR-FUNCTION-URI.azurewebsites.net/api";
    

    to be the URL of your function, like this:

    String url = "https://MyGitHubReceiver.azurewebsites.net/api";
    
  8. In the GitHub repository you wish to monitor, create a new WebHook and provide the URL of your function as the target URL, with the pullrequests suffix. Given the example URL above, the full target URL for your GitHub WebHook would be https://MyGitHubReceiver.azurewebsites.net/pullrequests.

  9. Change the Content type of the request that will be sent to your Azure Function to application/json.

  10. In the Function App settings blade of the Azure portal, copy the default host key and paste it into the Secret property for the GitHub WebHook.

  11. Make sure to enable all pull request events so new pull request, closes, comments, and other activity will all be sent to your function.

  12. Save the WebHook.

  13. Run the Android app in the debugger.

  14. Branch your repository (or fork it), make a change, and send pull request to your repository.