The BER Service was demoed during Donovan Brown's talk at the Xamarin Developer Summit 2019 in Houston TX.
The purpose of the service to update the back end URL of a mobile application without having to rebuild the mobile application. The BER Service is hosted at a URL that never changes and can be queried at runtime to get the URL of the back end. While the back end moves from environment to environment the BER Service is updated with the new back end URL for the mobile application to start using. The mobile application simply queries the BER Service before making a call to the back end to get the correct URL.
This repo contains following:
- BER Service Azure App Service Application with Azure DevOps Pipeline
- Azure App Service, WebApp, BER Service implementation
- YAML based Azure DevOps CI/CD pipeline
- BER Service Client Library
- Shared between the Azure Function and Azure WebApp implementations.
- BER Service Data Access Layer using Entity Framework
- Shared between the Azure Function and Azure WebApp implementations.
- BER Service Azure Function App with Azure DevOps Pipeline
- Azure Function App, BER Service implementation
- YAML based Azure DevOps CI/CD pipeline
- BER Service Azure Resource Manager Templates
- Infrastructure as Code for both WebApp and Azure Function
- Azure Resource Manager Templates
- BER Service Model Library
- Library that can be added to Xamarin applications to access a BER Service.
- It is published on NuGet as Trackyon.BER.Client
- There should be no reason to publish your own.
- BER Service PowerShell Module
- Provided for educational purposes only.
- The module is published as Trackyon.Ber in the PowerShell Gallery.
- There should be no reason to publish your own.
- BER Service Unit Tests
-
A GitHub account, where you can fork this repository. If you do not have one, you can create one for free.
-
An Azure DevOps organization. If you do not have one, you can create one for free. (An Azure DevOps organization is different from your GitHub organization. Give them the same name if you want alignment between them.)
-
An Azure account. If you do not have one, you can create one for free.
-
Fork this repository into your GitHub account.
-
Sign in to your Azure DevOps organization and navigate to your project.
-
Create an Azure Resource Manager service connection named AzureConnection.
-
In your project, navigate to the Pipelines page. Then choose the action to create a new pipeline.
-
Walk through the steps of the wizard by first selecting GitHub as the location of your source code.
-
You might be redirected to GitHub to sign in. If so, enter your GitHub credentials.
-
When the list of repositories appears, select your repository where you forked this repository.
-
Azure Pipelines will analyze your repository and recommend templates. Select Existing Azure Pipelines YAML file.
-
Under path select azure-pipelines-function.yml, then select Continue.
-
Select Variables, then select New variable, and then name the variable administratorLoginPassword. Next enter a strong password and check the Keep this value secret check box, and then choose OK, then Save.
-
Select Run. Once the pipeline is complete you will have a BER Service deployed into an Azure Function.
-
From the function app get the URL and default key.
To use the service in your mobile application you will need to add a reference to the BerService.Client library. You can build your own copy or download a version of Trackyon.BER.Client from NuGet.
When calling the function you are going to use the function key to authenticate.
var ber = new Trackyon.BER.Client.BerFunctionClient(functionURL, functionKey, version, appName);
this.baseAddress = ber.Get("back-end");
To use the service in your DevOps pipeline you can call the REST API directly or use the cross-platform PowerShell Module Trackyon.Ber.
Install-Module Trackyon.Ber -Scope CurrentUser -Force -Verbose
Add-BerRecord -functionKey $(functionKey) -berUrl $(functionUrl) -appName $(appName) `
-dataType 'back-end' -version $version `
-value 'http://$(webSiteName).azurewebsites.net' -verbose
-
Fork this repository into your GitHub account.
-
Sign in to your Azure DevOps organization and navigate to your project.
-
Create an Azure Resource Manager service connection named AzureConnection.
-
In your project, navigate to the Pipelines page. Then choose the action to create a new pipeline.
-
Walk through the steps of the wizard by first selecting GitHub as the location of your source code.
-
You might be redirected to GitHub to sign in. If so, enter your GitHub credentials.
-
When the list of repositories appears, select your repository where you forked this repository.
-
Azure Pipelines will analyze your repository and recommend templates. Select Existing Azure Pipelines YAML file.
-
Under path select azure-pipelines-website.yml, then select Continue.
-
Select Variables, then select New variable, and then name the variable administratorLoginPassword. Next enter a strong password and check the Keep this value secret check box, and then choose OK, then Save.
-
Select Run. Once the pipeline is complete you will have a BER Service deployed into an Azure Function.
-
From the App Service get the URL.
To use the service in your mobile application you will need to add a reference to the BerService.Client library. You can build your own copy or download a version of Trackyon.BER.Client from NuGet.
When calling the web application you are going to use clientId to request a JWT to authenticate. The clientId must match either the Web or Mobile properties of the TokenData object. Those values are read from the application configuration. You can update those values in the azure-pipelines-website.yml file.
var ber = new Trackyon.BER.Client.BerClient(appServiceURL, clientId, version, appName);
this.baseAddress = ber.Get("back-end");
To use the service in your DevOps pipeline you can call the REST API directly or use the cross-platform PowerShell Module Trackyon.Ber.
Install-Module Trackyon.Ber -Scope CurrentUser -Force -Verbose
Add-BerRecord -clientId $(appName) -berUrl $(berUrl) -appName $(appName) `
-dataType 'back-end' -version $version `
-value 'http://$(webSiteName).azurewebsites.net' -verbose