We have our Python API working with 3.6 however as of today Azure support Python3.7. We have our product on Windows Platform and the python3.6 works well in our On-Prem environment. We are hosting our product as Azure SaaS and need to use host Python API through Azure App Service. We have done code changes for Python3.7 API and hosted on Azure App service for windows platform but dont get any output. We have referred the below Azure documentation and attached is the error screenshot.
Anyone who has face similar issue and resolved it.
https://learn.microsoft.com/en-us/visualstudio/python/publish-to-app-service-windows?view=vs-2022
enter image description here
I have tried to reproduce the same by creating a sample BottleWebProject by using the python version 3.7.9 and deployed the web app to Azure App Service windows from Visual Studio successfully.
After creating the project in VS we have to add the virtual environment by right click on the Python environments -->Add Environment as shown in the below Images:
Then we can run in our local environment and test through VS(Run without debugging mode) and you will see the output if app runs successfully like in the below image.
Output:
Then you have to publish the webapp to the Azure by creating the App service, App service plan and click on publish in VS as shown in below image:
Output after publishing to Azure App Service Windows:
Related
I tried to deploy NodeJS project with xml2json package in Azure Web App Service, but I got error because of python version, how can I solve this problem?
I have tried to reproduce the issue by using the Visual Studio Code to deploy a sample node.js application with the XML2JSON Parser package by using this npm install xml2json --save command in the VS code terminal and installed this package successfully as shown below in the screenshot:
Then tried to publish the app to the Azure App Service by
signing into your azure account and Right click--> Create new Web App( Advanced)-->Create a new resource group-->Node.js version-->OS(Windows/Linux)-->location-->App service plan.
Then by expanding the app services in VS code and select your app service add new setting as shown below:
Type this SCM_DO_BUILD_DURING_DEPLOYMENT and set its value to true.
And select your app service and deploy to web app option-->your app-->done.
Your application will be published successfully to the Azure App Service as shown below:
Note: Make sure to use the latest node.js version and In the terminal, ensure you're in your app directory, then start Visual Studio Code with this- code .cmd.
I am currently using PythonAnywhere to deploy my web2py project, it is working fine for me.
Now I want to deploy my web2py application on azure App service. I followed all the steps mentioned in below Goggle group
Creating web apps with Web2py in Azure Web Apps
Still I can see default page of azure python web app. I also tried to do it with same code base mentioned in given git repository.
I am unable to figure out which document I should refer or what are the right steps to deploy web2py project to Azure web app service.
Below are the steps I followed to deploy web2py project to Azure app service
Created Azure app service with P1V2 app service plan. Linux machine with python 3.6 default language
Selected local git repository in deployment center and pushed code to azure git repository. It shows deployment successful message
Browse azure website, but this time it is not showing expected landing page. It is showing me default app page of azure website
I tried steps 3-4 times but everytime I am getting same result. Am I missing something here?
I reviewed the forum thread Creating web apps with Web2py in Azure Web Apps of Google Groups as you mentioned, I see there is a file named web.config in its attachments, as the figure below.
However, the discussion is too old at 2015-11-13. At that time, Azure only supports Windows for Azure App Services, but you were trying to reproduce it on Azure WebApp for Linux based on Docker, because P1V2 Sku is for Linux and Standard S1 for Windows, as the figures below.
P1V2 Sku of Azure App Service Plan for Windows
Standard S1 Sku of Azure App Service Plan for Windows
So if you want to reproduce the same application of the thread of Google Groups on Azure WebApp for Windows, please try to refer to my answer for the other SO thread No pip or python module inside azure webapp. There is not any Azure offical document introduce how to deploy a Python application on Azure Windows WebApp.
Otherwise, please refer to the two Azure offical documents Quickstart: Create a Python app in Azure App Service on Linux and Configure a Linux Python app for Azure App Service to try to change and deploy it on Azure Webapp for Linux. Even that you need to follow the document Configure a custom Linux container for Azure App Service to create a custom docker image for deployment.
I have a netcore 3.0 Web api that I've developed and tested on Windows using Visual Studio 2019.
I have deployed it to a Windows Web app on a Windows app service plan. This runs as expected.
I then created a Linux app service plan with a net core 3.0 Linux Web app on azure using "executable" and not "Docker".
Next I attempted to publish my Web app from Visual Studio 2019 to this instance. It succeeds however my web app just gives the following fault
I have tried deploying as Linux-x64 and portable. I have also tried selecting framework dependent and self contained as the deployment mode.
Some simply show the error above, the other combinations just time out.
Is there an official MS guide to do what I am attempting to do above?
If not how can I diagnose the error. Can I remote in via SSH? Are there error logs anywhere?
Can I remotely debug the instance?
If not can I build and test the Linux version using the Linux subsystem for Windows?
If you're not sure about how to deploy your application, you can create a new Devops project on Azure portal and import your source code later.
Search for Devops Project
Select .NET as application from the template click Next
Select ASP.NET Core as application framework click Next
Select Linux Web App as a Service
Pass the necessary paramters in the next step and you are done
you should be able to compare and apply the same
We have a Restify API running in Azure App Service on Linux for a while now. Suddenly this app (both test and prod, they run as seperate apps) stopped working. Based on the logs the error is related to a package we are using node-highcharts-exporting which is dependent on PhantomJS. App Service is using Node 8.1.
We tried re-deploying the code, upgrading node version to 8.12 (do not want to use latest version with out testing) but still no luck.
Deployment Logs: (This part is successful. This is just for reference)
Container logs: (Startup fails here)
Tried to replicate the same environment on-prem and everything works fine. Created a new App Service which is also running into same issue. Any help is much appreciated.
Update 1:
I think I figured out what is happening. This is related to font libraries on linux https://github.com/ariya/phantomjs/issues/10904
I need to install libfontconfig but this is not supported on Azure App Service.
Yes, it is due to sandbox restriction on a App Service. Just to highlight, the standard/native Azure Web Apps run in a secure environment called a sandbox. Each app runs inside its own sandbox, isolating its execution from other instances on the same machine as well as providing an additional degree of security and privacy which would otherwise not be available.
Not supported scenarios on standard App Service - PhantomJS (/Selenium): tries to connect to local address, and also uses GDI+.Known issue for all PDF generators based on wkhtmltopdf or phantomjs: custom fonts are not rendered (system-installed font is used instead) because of sandbox GDI API limitations.See App Service GitHub sandbox page.
Based on your requirement, however you could use a custom container in App Service (You can use a custom Docker image) that lets you make OS changes that your app needs.
Checkout these document for more details on this topic:
Run a custom Linux container in Azure App Service (You can use a custom Docker image): https://learn.microsoft.com/azure/app-service/containers/quickstart-docker
Run a custom Windows container in Azure (Preview):
https://learn.microsoft.com/azure/app-service/app-service-web-get-started-windows-container
I've been having trouble being able to use any of the functionality of ASPPDF on a web app I publish to Azure. When running the website locally through Visual Studio, the website behaves as expected, and I can use any of the methods in the ASPPDF library. However, when I publish to Azure and test the website I get this error: "Retrieving the COM class factory failed due to the following error: 80040154."
This error is documented here: http://support.persits.com/show.asp?code=ps071016166.
The Azure App Service I am publishing to is 64-bit as well as the project I am working on is configured for 64-bit. The libraries from ASPPDF are also 64-bit. Making any one of these 32-bit is not an option since the App Service must be 64-bit.
I have already viewed this: AspPDF and AspJPEG on Windows Azure. And I don't see how I can apply that solution to an App Service in Azure.
Has anyone had any success using ASPPdf on an Azure App Service?