GithubHelp home page GithubHelp logo

qpc-github / azure-prince-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yeslogic/azure-prince-example

1.0 2.0 1.0 12.54 MB

Example project using Prince to generate a PDF response that can be deployed as an app service to Microsoft Azure

License: Apache License 2.0

C# 18.73% Max 73.99% CSS 5.39% AMPL 1.89%

azure-prince-example's Introduction

Prince Azure Example

This is a Visual Studio 2019 project that demonstrates generating a PDF with Prince in C# / ASP.NET Core. It uses the Prince C# / .Net Wrapper. It has been confirmed to work when deployed as an App Service on Microsoft Azure.

Contents

Deploying to Microsoft Azure

Follow these steps to deploy this project to Microsoft Azure:

  1. Clone the repository: git clone https://github.com/yeslogic/azure-prince-example.git
  2. Open the project in Visual Studio, selecting the PrinceApplication1.sln file.
  3. In the Solution Explorer, right-click on PrinceApplication1 and choose "Publish...".
    Screenshot of menu shown when right-clicking on PrinceApplication1 in the Solution Explorer
  4. In the Publish window that appears, select Azure as the Target and click "Next".
    Screenshot of the Publish window showing a list of possible targets
  5. Choose "Azure App Service (Windows)" as the Specific Target. Screenshot of the Publish window showing a list of specific targets
  6. Create or sign in to your Azure account. When signed in, click "Create a new Azure App Service...".
    Screeshot of App Service section of publishing workflow
  7. Pick a name, this will be used as the sub-domain when deployed. E.g. a name of PrinceApplication2 gets deployed to https://princeapplication2.azurewebsites.net/. Choose a subscription, create or choose an existing resource group, and hosting plan. Click "Create", then click "Finish".
    Screenshot of App Service configuration window
  8. Click the Publish button in the main Publish view.
    Screenshot of main configuration window
  9. Your browser should open when publishing completes. Add /prince to the URL and you should see a PDF generated by Prince.

Debugging

Two tools that are useful for debugging Prince in Azure are the logs and the console. This section shows how to use these.

Sign In and Navigate to Your App Service

  1. Sign in to the Azure portal and navigate to App Services.
    Screenshot of the App Services button on the home page of the Azure portal
  2. Click on the App Service you want to inspect.
    Screenshot of the App Services list in the Azure portal

Logs

Enable Logging

Logs from the App Service can be viewed in the Azure portal. However, they must be enabled first:

  1. Sign in and navigate to your App Service.
  2. In the side bar click on "App Service Logs".
  3. Enable "Application Logging (Filesystem)".
  4. Set the Level to "Information", and click "Save".
    Screenshot of the App Service log settings in the Azure portal
  5. Wait for the notification that logging is enabled.

View Logs

  1. Sign in and navigate to your App Service.
  2. In the side bar click on "Log stream". Now when new requests are made you will see the logs.
    Screenshot of the Log stream in the Azure portal

Console

  1. Sign in and navigate to your App Service.
  2. In the side bar click on "Console". You can now run commands and inspect the deployed files.
    Screenshot of the Console in the Azure portal

License

The source code in this repository is licensed under the Apache 2.0 license.

The Inter font family contained in PrinceApplication1/fonts is Copyright 2016-2020 The Inter Project Authors. "Inter" is trademark of Rasmus Andersson. This Font Software is licensed under the SIL Open Font License, Version 1.1. See PrinceApplication1/fonts/LICENSE.

azure-prince-example's People

Contributors

wezm avatar adrianwong avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.