> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/web/webviewer-server/deployment/wv-server-azure-deployment.md).

# Deploying WebViewer on Azure

Learn how to efficiently deploy WebViewer on Azure with this comprehensive guide. Discover various methods and essential tips for optimal performance. The Apryse Web SDK streamlines secure, serverless

This guide will detail possible methods for deploying on Azure, remember to keep in mind the minimum requirements when deploying WebViewer Server.

### Running on a Linux VM

To build the WebViewer Server on a Linux VM, follow this guide on [building docker compose images](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/docker-compose-quickstart/) alongside our guide on building the [WebViewer Server image](/web/webviewer-server/wv-server-deployment.md#setting-up-the-server).

* If building with the Azure VM, you may have to change the version specifier in the docker-compose.yml file to `version:"2.0"` or update docker-compose depending on the VM used.

## Quick Start with Web Apps for Containers

{% hint style="warning" %}
**Azure WebApp Performance Issues**

Due to how Azure WebApps are designed, their main drive has read/write speeds around 20 MB/s, this may cause a loss in performance in WebViewer Server. We recommend that the read/write available exceed 60 MB/s at least in any system you deploy in.

It is possible to deal with these issues by using a dedicated instance, but this can only be acquired by contacting Azure regarding your account.
{% endhint %}

This section specifies how to build a Web App server for containers on Azure. Azure Web Apps provide you a fully managed environment for hosting web servers. This will be the easiest way to get setup on Azure.

1. Through the Azure Dashboard create a new `Web Apps for Containers` resource on Azure.
2. On the resource creation screen, configure the settings of your server.

* Type in a name for your app, this will also be the domain name for your server.
* Set the `OS` option to `Linux`.

1. Click `Configure Container`.

* In the new page, click `DockerHub`.
* In the field `Image and optional tag` type `pdftron/webviewer-server:latest`. Click apply.
* *A version of WebViewer Server version older than `_1.5.1_` can no longer be used on Web Apps*
* Once returned to the main page, click **Create**.

1. Set the options `Web Sockets` to `On` and the option `Always On` to `true`. While running, these options will be under `Application settings` and `General settings` respectively.
2. Restart the container.

If you wish to access the container it will be available under the URL field on the Overview page. You can access the demo application built in by using `URL/demo?s` to access it. It will take a few minutes for the server to become available after the initial creation is complete.

You may also add a key to the container and control any other settings as listed in our [Docker image guide](/web/webviewer-server/deployment/wv-server-dockerhub-deployment.md#Configuring-the-pulled-containers). Go to `Application Settings` and under the heading `Application Settings` select `Add new setting`. Set the name to your setting and the value to the desired value, like such (you do not need to set this property if you are demoing our software):

`TRN_PDFNET_KEY YOUR_APRYSE_LICENSE_KEY`

It is also possible to build the WebViewer Server container yourself and host it on Azure to be used with Web Apps, to do so follow this [guide](#building-the-azure-image-registry).

### Running on Container Instances

Building on a Container Instance allows you more flexibility in usage but does not offer the fully integrated environment that a Web App server provides.

1. Navigate to `Create a resource` in the Azure portal and search for `Container Instances`, once you've found it select it and create.
2. Set your `Container image type` to `Public`. In the `Container image` field type `pdftron/webviewer-server:latest`.
3. Click `OK`
4. The `Configuration` page should now be shown.

* Set `Port` to `8090`
* Set `OS Type` to `Linux`
* Set each `Environment Variable` to the variables you use under the `environment` section of the `docker-compose.yml` for example: `"INCLUDE_DEMO":"true"`

1. Hit `OK` twice more and the container should now be deploying.

If you included the demo in this build, you should now be able to access the demo at `container_instance_address:8090/demo?s` A private Azure image registry can also be used here.

### Building the Azure Image Registry

The image registry is responsible for serving built container images on Azure. This can be done if you wish to host the Docker image directly within your network. This registry can be used when building `Container Instances` or `Web Apps for Containers`.

Microsoft also provides a more detailed [guide on this process](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal/).

1. Start by navigating to `Create a resource` in the Azure portal and search for `Container Registry`, once you've found it select it and create.
2. Fill in the fields with settings appropriate to your Azure account. Ensure the `Admin User` is enabled.
3. Deploy the Registry and wait for it to be created. Once it has been completed move to the next step.
4. Go to your registry in your resources tab and find your username and password. It will be under `Settings` > `Access Keys`. You will need the username and password when pushing the image. Next go to Overview and find the `Login Server`, you will also need this when pushing the image.
5. Install [Docker](https://docs.docker.com/install/).
6. Login to your Azure Image Registry:

* `docker login -u your_username -p your_password your_login_server`

1. Pull, tag and push our docker images from your command prompt:

* `docker pull pdftron/webviewer-server:latest`
* `docker tag pdftron/webviewer-server:latest your_login_server/image_name:latest`
* `docker push your_login_server/image_name:latest`

1. You now have a pushed image on your Container Registry. You can move on to building your server.

### Azure FAQ

1. Do I need ARR Affinity cookies for my Web App server?

* If you wish to scale your Web App server beyond 1 container ARR Affinity should be enabled to ensure sticky sessions for users. If this is not enabled, the server will have problems if clients are swapped between servers during a document connection.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/web/webviewer-server/deployment/wv-server-azure-deployment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
