Articles in this section
Category / Section

Deploy an HTML-to-PDF Converter to Azure App Service Using Azure DevOps and Managed Identity

3 mins read

Learn how to deploy a Syncfusion® HTML-to-PDF converter to Azure App Service (Windows) through an Azure DevOps pipeline. This guide uses Azure Managed Identity with federated credentials to create a secure Azure service connection and automate deployments.

Prerequisites

Ensure the following prerequisites are met before proceeding:

  • Access to Azure Portal and Azure DevOps with the necessary permissions.
  • A working ASP.NET project (e.g., targeting .NET 9.0) that implements HTML-to-PDF conversion using Syncfusion®.
  • An Azure App Service (Windows) instance configured for deployment.
  • Ability to create and assign roles to Managed Identities.
  • Permission to create an Azure Service Connection in Azure DevOps.

Create an Azure Service connection in Azure DevOps

  1. Sign in to your Azure DevOps Project.
  2. Navigate to Project Settings > Pipelines > Service connections
  3. Click + New service connection and choose Azure Resource Manager.
  4. Select Managed Identity as the authentication method.
  5. Fill in the required fields:
    • Service connection name (e.g., appservicewindows)
    • Tenant ID
    • Leave Issuer and Subject Identifier as default for now.
  6. Choose Scope Level as Subscription, and provide:
    • Subscription ID
    • Subscription Name
    • Client ID
  7. Enable the Grant access to all pipelines option.
  8. Copy the Issuer and Subject Identifier values. You’ll need these to configure federated credentials in Azure.

The service connection cannot be finalized until a federated credential is created in Azure.

Add Federated Credential in Azure Portal

  1. Open the Azure Portal and go to your Managed Identity resource.
  2. In the left panel, navigate to Settings > Federated credentials.
  3. Click + Add credential.
  4. Under Select a scenario, choose Other issuer.
  5. Provide the following details:
    • Issuer: Copied from the Azure DevOps service connection setup
    • Subject Identifier: Copied from Azure DevOps
    • Type: Select Explicit subject identifier
    • Name: Enter a meaningful name (e.g., devops-deployment-token)
  6. Click Add to create the federated credential.
  7. Return to Azure DevOps and complete the Service Connection creation using Workload Identity Federation.

If you encounter permission-related errors at this step, ensure the Managed Identity has appropriate role assignments. Contact your cloud administrator for assistance.

Set up your Azure DevOps repository

  1. Log in to your Azure DevOps project.
  2. Create a new project
    • Click New Project.
    • Provide a Name and optional Description
    • Set the Visibility to Private for secure access.
    • Choose Git as the version control system.

For detailed project setup steps, refer to the Azure DevOps documentation.

Push your project code

  1. After the project is created, go to the Repos section.
  2. Push your HTML-to-PDF converter source code to the Azure DevOps Git repository using the following commands:
git remote add origin https://dev.azure.com/{organization}/{project}/_git/{repo}
git push -u origin main 
  1. Ensure all files are committed locally before pushing.

Configure the deployment pipeline

  1. Go to the Pipelines tab in Azure DevOps and click + New Pipeline.
  2. Choose Azure Repos Git as the source.
  3. Select your repository and pick ASP.NET as the template.
  4. Replace the auto-generated azure-pipelines.yml with your custom pipeline configuration for deploying to Azure App Service.
trigger:
- master

pool:
 vmImage: 'windows-latest'

variables:
 solution: 'YourSolutionFolder/YourSolution.sln'
 buildPlatform: 'Any CPU'
 buildConfiguration: 'Release'
 azureSubscription: 'appservicewindows'  # Service connection name
 appName: 'your-app-service-name'

steps:
- task: UseDotNet@2
 inputs:
   packageType: 'sdk'
   version: '9.0.x'
   installationPath: $(Agent.ToolsDirectory)/dotnet

- task: NuGetToolInstaller@1

- task: NuGetCommand@2
 inputs:
   restoreSolution: '$(solution)'

- task: VSBuild@1
 inputs:
   solution: '$(solution)'
   msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
   platform: '$(buildPlatform)'
   configuration: '$(buildConfiguration)'

- task: VSTest@2
 inputs:
   platform: '$(buildPlatform)'
   configuration: '$(buildConfiguration)'

- task: PublishBuildArtifacts@1
 inputs:
   PathtoPublish: '$(build.artifactStagingDirectory)'
   ArtifactName: 'drop'
   publishLocation: 'Container'

- task: AzureRmWebAppDeployment@4
 inputs:
   azureSubscription: '$(azureSubscription)'
   appType: 'webApp'
   WebAppName: '$(appName)'
   package: '$(build.artifactStagingDirectory)/**/*.zip' 

Result

Once the pipeline executes successfully:

  • Your Syncfusion HTML-to-PDF converter app is deployed to Azure App Service (Windows).
  • Authentication is securely handled using Managed Identity and federated credentials—no secrets or client secrets are required.

Conclusion

I hope you enjoyed learning about how to deploy an HTML-to-PDF converter using Azure DevOps and Managed Identity.

You can refer to HTML to PDF Features section for more information about features in HTML to PDF converter, you can get the details, code examples and demo from this section.

Also, Refer to HTML to PDF Troubleshooting section for troubleshooting HTML to PDF conversion failures and frequently asked questions.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied