Hello @Santhya you can include the custom HTML file in your code repository and deploy it using Azure DevOps pipeline by following these steps:
- Add your custom HTML file for the 403 error page to your code repository. You might want to place it in a directory that’s included in your deployment, such as the root directory or a
wwwroot
subdirectory. - In your Azure pipeline YAML file, add a task to copy the custom HTML file to the appropriate location in the Azure App Service during deployment. Here’s an example of how you might do this:
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: '<Azure-Subscription>'
appType: 'webApp'
WebAppName: '<Web-App-Name>'
packageForLinux: '$(Build.ArtifactStagingDirectory)/**/*.zip'
CustomStartCommand: 'echo Your command here'
enableCustomDeployment: true
DeploymentType: 'webDeploy'
RemoveAdditionalFilesFlag: true
AdditionalArguments: '-skip:objectName=filePath,absolutePath=403.html'
In this example, the AdditionalArguments
field is used to prevent the 403.html
file from being deleted during deployment. Replace <Azure-Subscription>
and <Web-App-Name>
with your Azure subscription and web app name, respectively.
- In the Azure portal, navigate to your App Service and then to “Configuration” > “Path Mappings” > “Error Pages”. Here, you can configure the path to your custom HTML file for the 403 error code.
Remember to commit and push these changes to your repository. The next time you run your pipeline, it should deploy the custom HTML file to your Azure App Service.
Hope that helps.
Best,
Grace