Deploy an HTML-to-PDF Converter to Azure App Service Using Azure DevOps and Managed Identity
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
- Sign in to your Azure DevOps Project.
- Navigate to
Project Settings > Pipelines > Service connections
- Click + New service connection and choose Azure Resource Manager.
- Select Managed Identity as the authentication method.
- Fill in the required fields:
- Service connection name (e.g.,
appservicewindows
) - Tenant ID
- Leave Issuer and Subject Identifier as default for now.
- Service connection name (e.g.,
- Choose Scope Level as
Subscription
, and provide:- Subscription ID
- Subscription Name
- Client ID
- Enable the Grant access to all pipelines option.
- 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
- Open the Azure Portal and go to your Managed Identity resource.
- In the left panel, navigate to
Settings > Federated credentials
. - Click + Add credential.
- Under Select a scenario, choose Other issuer.
- 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
)
- Click Add to create the federated credential.
- 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
- Log in to your Azure DevOps project.
- 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
- After the project is created, go to the Repos section.
- 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
- Ensure all files are committed locally before pushing.
Configure the deployment pipeline
- Go to the Pipelines tab in Azure DevOps and click + New Pipeline.
- Choose Azure Repos Git as the source.
- Select your repository and pick ASP.NET as the template.
- 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.