4e1e9474a4 | ||
---|---|---|
.. | ||
android | ||
function-dotnet | ||
function-javascript | ||
html | ||
project.code-workspace | ||
readme.md |
readme.md
Sample Setup
Requirements
This setup process assumes you have the following tools installed:
- Visual Studio Code
- The Azure Extension for Visual Studio Code
- JetBrains IntelliJ Idea with the supporting prerequisites for developing Android applications in Java.
- 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
-
Create an Azure Resource group for the resources you'll create for the app.
-
Create a new Azure Function in the new resource group.
-
Create a new Azure SignalR Service instance in the same resource group (free tier is fine).
-
Set the
AzureSignalRConnectionString
environment variable in your Azure Function to be the connection string of the Azure SignalR Service you created. -
Open the project workspace in this directory by typing
code .\project.code-workspace
at the command line. -
Deploy either the
function-dotnet
code if you want a .NET back-end Function, or thefunction-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. -
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";
-
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 behttps://MyGitHubReceiver.azurewebsites.net/pullrequests
. -
Change the Content type of the request that will be sent to your Azure Function to
application/json
. -
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. -
Make sure to enable all pull request events so new pull request, closes, comments, and other activity will all be sent to your function.
-
Save the WebHook.
-
Run the Android app in the debugger.
-
Branch your repository (or fork it), make a change, and send pull request to your repository.