|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: Deploy Spreadsheet Server to Azure App Service using CLI | Syncfusion |
| 4 | +description: Learn how to deploy the Syncfusion Spreadsheet Server Docker image to Azure App Service using Azure CLI. |
| 5 | +control: How to deploy Spreadsheet Server Docker Image to Azure App Service using Azure CLI |
| 6 | +platform: document-processing |
| 7 | +documentation: ug |
| 8 | +--- |
| 9 | + |
| 10 | +# Deploy Spreadsheet Server Docker Image to Azure App Service via CLI |
| 11 | + |
| 12 | +## Prerequisites |
| 13 | + |
| 14 | +* `Docker` installed on your machine (Windows, macOS, or Linux). |
| 15 | +* `Azure CLI` installed based on your operating system. [Download Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) |
| 16 | +* An active [`Azure subscription`](https://azure.microsoft.com/en-gb) with App Services access. |
| 17 | +* The [`Spreadsheet Server Docker image`](https://hub.docker.com/r/syncfusion/spreadsheet-server) available. |
| 18 | + |
| 19 | +## Deploy to Azure App Service using Azure CLI |
| 20 | + |
| 21 | +**Step 1:** Log in to Azure |
| 22 | + |
| 23 | +Open your terminal and sign in to Azure using the command below. This authenticates your CLI with Azure. |
| 24 | + |
| 25 | +```bash |
| 26 | +az login |
| 27 | +``` |
| 28 | + |
| 29 | +**Step 2:** Create a resource group |
| 30 | + |
| 31 | +Create a resource group with the following command in your preferred location. |
| 32 | + |
| 33 | +```bash |
| 34 | +az group create --name < your-app-name> --location <your-selected-region> |
| 35 | +``` |
| 36 | + |
| 37 | +**Step 3:** Create an app service plan |
| 38 | + |
| 39 | +Create a resource group with the following command in your preferred location. |
| 40 | + |
| 41 | +```bash |
| 42 | +az appservice plan create --name --resource-group < your-resource-group> --sku S1 --is-linux |
| 43 | +``` |
| 44 | + |
| 45 | +This creates an App Service plan in the standard pricing tier (S1) and ensures it runs on Linux containers with the --is-linux flag. |
| 46 | + |
| 47 | +**Step 4:** Create the docker-compose.yml file |
| 48 | + |
| 49 | +Define your container configuration in a docker-compose.yml file. This file specifies the container name, image, and environment variables for the Spreadsheet Server: |
| 50 | + |
| 51 | +```bash |
| 52 | +version: '3.4' |
| 53 | + |
| 54 | +services: |
| 55 | + spreadsheet-server: |
| 56 | + image: syncfusion/spreadsheet-server |
| 57 | + environment: |
| 58 | + |
| 59 | + # Provide your license key for activation |
| 60 | + SYNCFUSION_LICENSE_KEY: YOUR_LICENSE_KEY |
| 61 | + ports: |
| 62 | + - "6002:8080" |
| 63 | + |
| 64 | +``` |
| 65 | + |
| 66 | +Note: Replace YOUR_LICENSE_KEY with your valid Syncfusion license key. |
| 67 | + |
| 68 | +**Step 5:** Create a Docker compose app |
| 69 | + |
| 70 | +Deploy the containerized app to Azure App Service using the following command. |
| 71 | + |
| 72 | +```bash |
| 73 | +az webapp create --resource-group <your-resource-group> --plan < your-app-service-plan> --name <your-app-name> --multicontainer-config-type compose --multicontainer-config-file docker-compose.yml |
| 74 | +``` |
| 75 | + |
| 76 | +This command creates a web app that runs your Spreadsheet Server Docker container using the configuration defined in the docker-compose.yml file. |
| 77 | + |
| 78 | +**Step 6:** Browse your app |
| 79 | + |
| 80 | +Once deployed, your app will be live at https://XXXXXXXXXX.azurewebsites.net. |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | +**Step 7:** With your server running, verify that it supports import and export operations by testing the following endpoints: |
| 85 | +``` |
| 86 | +openUrl="https://XXXXXXXXXX.azurewebsites.net/api/spreadsheet/open" |
| 87 | +saveUrl="https://XXXXXXXXXX.azurewebsites.net/api/spreadsheet/save |
| 88 | +``` |
| 89 | +Append the App Service running URL to the service URL in the client‑side Spreadsheet Editor component. For more information about how to get started with the Spreadsheet Editor component, refer to this [`getting started page`](../getting-started.md) |
| 90 | + |
| 91 | +For more information about the app container service, please look deeper into the [`Microsoft Azure App Service`](https://docs.microsoft.com/en-us/visualstudio/deployment/) for a production-ready setup. |
0 commit comments