Mobile deployment

Deploy and test the Mobile Client website

Introduction

This section describes the steps required to deploy a mobile website, which is used on the Mobile Clients.

Prerequisites

You have completed mobile setup for D365FO, as described in the section above.

Audience
Sysadmin, Partner Consultant

Deployment scenarios

There are two deployment scenarios. Use the scenario that applies to your company.

Scenario 1

The first time you deploy a mobile website, follow the steps described in the four articles below in sequential order:

  1. Create an Azure storage account (optional - only required if you want to manage large files on the Mobile Client)
  2. Add the Azure app (App Service)
  3. Web application registration on Azure Active Directory
  4. Configure and upload the mobile site:
    1. Configure the mobile site
    2. Configure attachments
    3. Update the web manifest file
    4. Upload the mobile site

When you create Azure resources, we recommend that you create a dedicated resource group for each purpose (example: one resource group for development and test, and one resource group for production).

Scenario 2

If you upgrade a mobile website from version 2008.0 or a previous version, do the following:

  1. Open the mobile app registration.
  2. Go to Authentication.
  3. You see a link on the Web tab with a text similar to "This app has implicit grant settings enabled. If you are using any of these URIs in a SPA with MSAL.js 2.0, you should migrate URIs". Select the link and follow the steps.
  4. Proceed with steps 9-10 in the step-by-step procedure in the article Web application registration to complete the upgrade process.
  5. Configure and upload mobile site:
    1. Configure the mobile site
    2. Configure attachments
    3. Update the web manifest file
    4. Upload the mobile site

Scenario 2 > Step 3: Migrate URIs
Scenario 2 > Step 3: Migrate URIs

Create an Azure storage account

An Azure storage account is required for interfacing with Dynamics 365 for Finance and Operations environments. The storage account is used as a temporary storage when uploading attachments from the mobile devices, such as images and pdf files. The storage account is only required if you want to manage large files on the Mobile Client.

If you're going to use attachments that are less than 20 MB in size per file, skip this section. You only need to create an Azure storage account if you expect to use attachments with a file size larger than 20 MB per file on the Mobile Client.

For additional information about Azure Blob storage setup and file size limitations, refer to the "appSettings" table and the text below the table in the article Configure the mobile site. The following app settings must be left blank if you skip the setup in this section:

  • ax7StorageAccountName
  • ax7StorageAccountKey

For DEV and TEST purposes, the General-purpose Azure storage account that is deployed with the Dynamics 365 for Finance and Operations environment can be used. Typically, the storage account can be identified by the resource group associated with the Azure environment.

  1. Navigate to Storage accounts.
  2. Select Add. These are the recommended settings:
    1. Storage account type: General-purpose
    2. Replication: Locally redundant storage (LRS)

Add the Azure app

The Azure installation consists of an Azure client deployment package. The deployment package is installed on an Azure website, which is connected to the application registration.

  1. On https://portal.azure.com/, log in with your Windows Azure credentials.
  2. Create a website in Azure by creating a Web App. In Azure, select App Services.
  3. Select Create +.
  4. Create a new Web App. The App name must be a globally unique name. Select a name that is related to your company (Example: "[company name]-eam-dev").
    1. Create a dedicated resource group (recommended).
    2. Select the latest ASP.NET runtime stack (shown as "V4.7" in the figure below). The Publish setting is automatically set to "Code", and the Operating System setting is automatically set to "Windows".
    3. In the Region field, select the region related to the physical data center that the new mobile website is created on.
  5. Wait for the resource to deploy and navigate to the new App Service.
    1. Copy the URL. You'll use it in a later step.
  6. Create one or more virtual applications (optional).
    1. Each Dynamics 365 for Finance and Operations environment requires a dedicated mobile client installation. If multiple mobile client installations are deployed under the same Azure Web Service, it's required that each Mobile Client installation is set up as a virtual application.
  7. In the App Services menu, select Deployment Center and select "FTP" as the deployment option.
    1. Copy the FTP URL and the App Credentials user name and password. You'll use this information in a later step.

Step 4: Create new Web App.
Step 4: Create new Web App.
Step 6: Create virtual applications.
Step 6: Create virtual applications.
Step 7: Select Deployment Center.
Step 7: Select Deployment Center.

Web application registration

Before you set up the Azure mobile site for the Mobile Client, you must first make a web application registration. The Azure web application registration ensures that the Mobile Client web app has security permissions to access Dynamics 365 for Finance and Operations.

Some steps regarding creating a web application registration require that you're set up as an 'Azure Global Administrator'.

Refer to this article from Microsoft for more information on how the Mobile Client is integrated with the Azure Active Directory https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app.

  1. Select the link https://portal.azure.com to open Microsoft Azure Dashboard.
  2. Navigate to Azure Active Directory.
  3. Select App registrations, and select the New registration button.
  4. In the Name field, insert the name of your Mobile Client. Examples: "Mobile AM Prod" and "Mobile AM Test-01".
  5. Select "Single-page application (SPA)" in the drop-down.
    1. This URL must be exactly the same as used when setting up the Azure Mobile Site, which is described in the article Add the Azure app. The sign-on URL must contain the complete URL to the mobile client main site. For example, this URL must be exactly the same as when setting up the Azure Mobile Site, which is described in the article Add the Azure app. The sign-on URL must contain the complete - URL to the mobile client main site, for example: inside the wwwroot folder: "https://example.azurewebsites.com/".
      - If in an additional folder wwwroot -> your_folder, then "https://example.azurewebsites.net/your_folder/".
      The most important is to keep the slash / at the end.
  6. Select Register and wait for the resource to deploy.
  7. Navigate to App registrations settings.
  8. Select API permissions from the settings menu.
    1. Select Add a permission > Dynamics ERP.
    2. Select Application permissions.
    3. Select one permission: Connector.FullAccess.
    4. Select Add permission.
    5. Select Add a permission > Dynamics ERP.
    6. Select Delegated permissions.
    7. Select two permissions: AX.FullAccess and CustomService.FullAccess.
    8. In API permissions > Grant consent, select Grant admin consent for... and select "Yes" on the pop-up screen. This step requires that you have the role 'Azure Global Administrator'.
  9. Ensure that the redirect URIs correspond with the App site URL and any virtual applications configured in earlier steps (refer to the article Add the Azure app).
    1. Verify that you use the "Single-page application" platform.
    2. In the Implicit grant section, ensure no checkmarks in the Access tokens and ID tokens checkboxes.
    3. If you're upgrading, select Manifest and ensure that oauth2AllowIdTokenImpliciFlow and oauth2AllowImplicitFlow are set to "False".
  10. Select Overview from the settings menu.
    1. Find and copy the Application (client) ID for your mobile client application. You'll use this Application ID to set up the Azure mobile site, described in the article Add the Azure app.

Step 5: Select
Step 5: Select "SPA" in drop-down.
Step 8.a: Select
Step 8.a: Select "Dynamics ERP" permission.
Step 8.c: Select
Step 8.c: Select "Connector.FullAccess" permission.
Step 8.g: Select two permissions.
Step 8.g: Select two permissions.
Step 9: Check redirect URIs.
Step 9: Check redirect URIs.
Step 9.a: Verify
Step 9.a: Verify "Single-page application" platform.

Configure the mobile site

When you've set up the Azure mobile site, created the web application registration, and uploaded the mobile deployment files, next step is to upload the Mobile Client application files.

  1. Extract the mobile installation files (from zip file).
  2. Locate the web config file, and edit it in a text editor. Go to the <appSettings> section, and change the settings shown in the table below to your current settings. The table below only shows examples.
App setting Example value Description
ax7Url

<add key="ax7Url"
value="https://contoso-test.sandbox.operations.
dynamics.com
" />

The URL for the Dynamics 365 for Finance
and Operations environment.

ax7ClientId

<add key="ax7ClientId"
value="b097fac0-deae-4959-9791-53bcb40a9909" />

This ID is the application ID of your App registration,
and it can be found in the Azure portal by navigating
to Microsoft Azure Portal > Azure Active Directory
> App registrations > Application ID.
Refer to the last step (step 10) in the
section Web application registration.
axDomain <add key="axDomain" value="contoso.com" />

Define the Active Directory domain name for the users
who should be able to log in on the Mobile Client.

ax7Storage
AccountName
See screenshot below.

An Azure Blob Storage account name.

Values are stored in Azure Portal > Storage Accounts
> Azure Blob Storage account > Access keys.

For more information on how to create a storage account,
if an account is not readily available, refer to Microsoft
documentation: Create a storage account.

Please remove the value from the web.config file if not used.

ax7Storage
AccountKey
See screenshot below.

An Azure Blob Storage account key. It is recommended
to use the secondary key. This could be the account key
of the Azure Blob Storage associated with your
Dynamics 365 for Finance and Operations account.

Values are stored in Azure Portal > Storage Accounts
> Azure Blob Storage account > Access keys.

Please remove the value from the web.config file if not used.

If the settings 'ax7StorageAccountName' and 'ax7StorageAccountKey' are left blank, there is a limitation of 18-20 MB per file. The limitation is set by the IIS service running Dynamics 365 for Finance and Operations. We recommend that you do not adjust these settings in a running environment.

When running an on-premise environment, the value of the 'ax7Url' setting will be similar to "https://d365onprem.myhost.com/namespaces/AXSF".
Furthermore, the settings for 'ax7StorageAccountName' and 'ax7StorageAccountKey' should be left blank on an on-premise installation because files are not actually stored in an Azure Blob store. As stated above, the result is a limitation regarding the size of files, which can be sent to and from Dynamics 365 for Finance and Operations, of 18-20 MB per file.

Step 1: Extract files
Step 1: Extract files
Step 2: Storage account name and key
Step 2: Storage account name and key

Attachments on the mobile site

We recommend that you do not change the parameters regarding attachment size shown in the table below.

system.web and system.webServer

Parameter Default value Description
maxRequestLength 134217728

The maximum allowed size of attachments sent from the Mobile Client in bytes.

maxAllowedContentLength 134217728

The maximum allowed size of attachments sent from the Mobile Client in bytes.

The fields maxRequestLength and maxAllowedContentLength, described in the table above, can be edited in configuration > system.web > httpRuntime @maxRequestLength and configuration > system.webServer > security > requestFiltering > requestLimits @maxAllowedContentLength.

Ensure that the webmanifest file type is enabled in configuration > system.webServer > staticContent:

<remove fileExtension=".webmanifest"/>

<mimeMap fileExtension=".webmanifest" mimeType="application/manifest+json" />

Update the web manifest file

  1. Locate the file "manifest.webmanifest".
  2. Edit the instances of <scope> to show the directory where the mobile site is installed.

Example: If it's installed in the root directory, /<scope>index.html should be /index.html. If it's installed in am_prod, /<scope>index.html should be /am_prod/index.html.

In the case of additional folder localisation, please do not forget to add settings in Azure:
1. Go to Azure -> App Services -> your app service
2. Go to Settings -> Configuration
3. Add virtual and physical path (example: Virtual path: /dev Physical path: site\wwwroot\dev)

Step 2: Edit location of mobile client directory
Step 2: Edit location of mobile client directory

Upload the mobile site

Use an ftp client with the specified credentials and URL, as described in the article Add the Azure app, to upload the mobile client application files.

The files to be uploaded are located in the .zip file.

Mobile client application files
Mobile client application files

Login test

This article describes how you can test the connection from the Mobile Client to Dynamics 365 for Finance and Operations.

  1. Navigate to your mobile site in a browser by using the URL you copied in step 5.a. in the article Add the Azure app.
  2. Log in with your Active Directory credentials.

Copyright Dynaway A/S