Creating an azure php web role - php

I have somewhat successfully followed this tutorial:
http://blogs.msdn.com/b/silverlining/archive/2012/06/21/creating-a-php-web-role-in-windows-azure.aspx
However I am stuck. I am not entirely sure how to create an instance in the azure management portal, after I have set up the web role on my local machine.
There are currently no instances set up. When I try to set them up, it asks me to upload a package and configuration file. Where can I find these.
Thanks

This should be a comment on your question but I can't make comments yet.
When creating a new cloud service do not check the box "Deploy a cloud service package."
If you use + -> Compute -> Cloud Service -> Quick Create it won't ask for a package either.
Once it's done being created you can open it up to download the credential file for Power Shell.

Related

Azure portal Web Service PHP Monitoring

I wrote a simple Application in HTML with a form. I submit the form into a PHP file and insert the data into a database.
I created an App Service on Azure Portal + MySQL database
It took me a while to get the git Pipeline going (So Git - Azure Portal - deploying into a Webservice)
If I submit my form, the data will go to the database just fine.
Now I wanted to extend everything with a monitoring tool. So I tried Application Insights. But unfortunately, that doesn't work. If I understand it correctly it's because of the PHP file or to be exact the Php Stackruntime on Azure.
Is it possible to the monitoring anyway somehow? I only have experience in Php and Html a little bit of Java and Javascript.
Thanks.
I have deployed sample PHP App to Azure App Service.
So I tried Application Insights. But unfortunately, that doesn't work.
I have checked with both PHP 8.0 and 8.1 runtime version. The Application Insights option is disabled for PHP.
Thanks #Dmitry-Matveev for the Application Insights SDK.
Is it possible to the monitoring anyway somehow?
Check the below steps to Monitor Azure PHP App Service.
Way 1:
Check the Logs under Monitoring.
Way 2:
Enable Application logging (File System).
Navigate to the Log stream to check the Live metrics.
Also, we can check the metrics section to monitor the App.

Azure B2C integration with PHP

Hope you can help with, we are building a new customer portal and would like to use Azure B2C for various reasons including the need to interface with MS Dynamics CE. However, our tech stack is PHP, Slim to be precise.
Does anyone have experience of delivering a fully functioning production app with this configuration?
Would love to hear from you and have your assistance.
Please get in touch.
Thanks, Duong.
To deploy the PHP Web Application using Azure AD B2C,follow the below steps :
Install PHP, Laravel (it's web framework).
Create a Web App in Azure Portal B2C blade by noting the ClientID and Client Secret from the Application.
Clone and customize the source code from github: git clone https://github.com/Azure-Samples/active-directory-b2c-php-webapp-openidconnect.git
Download the latest version of the php security library in your repo.
To deploy into Azure, you need to set-up the Deployment settings by selecting Local Git Repository and setting up the username and password for deployment.
git init and git remote add azure [deployment url] commands are used to set up deployment to azure.
git push azure master to deploy online.
Instead of depending on their own code, developers can rely on B2C for consumer sign up and sign in.
Using OpenID Connect, we can validate the authentication token of the users connected with the Azure B2C of the PHP Web Application.
Please refer this GitHub article for code and more information.
I've implemented B2C integration on Azure with a Slim 4 application, what is it you need to know?
In short:
Set up B2C in Azure
Set up Client ID en Secret in external provider and store in Azure Key Vault
Create a middleware service that looks for the client token in requests for the routes you want to protect
I haven't written a blog about it yet, but expect one in March at www.azurephp.dev with a working example using Slim 4. In the mean time, I hope this short answer works for you. If not, ping me.

How to enable custom PHP laravel logging for Azure log analytics

We have developed a PHP application and hosted the same in Azure Webapp with Linux as the operating system.
Currently the log files are getting generated inside the wwwroot/storage/logs as shown in attached ssh console app screenshot.
We have enabled the Custom logs for the App Service from Log Analytics as shown in log analytics screenshot. (I was unable to understand whether path should be given from home or site so I added both).
When I tried to query the custom log in the Azure Log it is returning empty data. Please find the attached screenshot for reference log image
Please help me in understanding what is the mistake.
Thank you.
Your app needs to be running in a VM to use Custom Log Analytics in that manner. Just ensure you've properly installed and configured the OMS agent according the steps documented in https://learn.microsoft.com/en-us/azure/azure-monitor/platform/data-sources-custom-logs.
Since you're using an App Service, there isn't Custom Log Analytics available. There is, however, Log Analytics integration for App Services which is currently in preview and supports the following types:
AppServiceHTTPLogs
AppServiceConsoleLogs
AppServiceAppLogs
AppServiceFileAuditLogs
AppServiceAuditLogs
You can also leverage this SDK to write your custom log messages to application insights.

Deploy application on Amazon AWS using BeanStalk API and LoadBalancing API

I am trying to add my application to amazon aws using the Beanstalk API.
I have a few webpages along with a backend in php and database in MYSQL which is called from the webpages using AJAX.
I want to deploy this on Amazon aws using the Beanstalk API and loadbalance it using the LoadBalancing API. I don't seem to find any tutorial online which would help me host my application.
Can someone guide me to how I should go about deploying my application ?
Amazon Elastic Beanstalk for PHP is somehow documented here.
As for your setup, here are the basic steps:
1. create an RDS instance manually. don't set Elastic Beanstalk do it for you as it poorly manages it. in the Beanstalk setup wizard make sure you use your preset RDS and not let the wizard create one.
2. start the Elastic Beanstalk wizard, define it as a web server and ensure the Environment type is Load Balancing, autoscaling. This will automatically create the load balancing configuration so don't worry about that.
3. from there I'd recommend continuing with the sample application just to make sure everything is setup correctly.
4. After the application launches and you're able to access it from the web, you should go ahead and git aws.push your own application. some doc here.
A fair warning - Amazon Elastic Beanstalk isn't easy to set up. If you are signed up to their support - use it. a lot :)

How to deploy Question2Answer to the cloud via a Google App Engine instance?

I'm trying to deploy Question2Answer (Q2A) by following this official install guide - where we need to set up
A web server to push Q2A source code to - uploading application folder to App Engine instance matched with this.
A MySQL database and the according log-in account - this is matched by creating and configuring a Cloud SQL instance to work with our app engine instance.
Though I failed to get Q2A run on Google's cloud - as browing the deployed web I get the error as below snapshot.
How would you guys get it deployed successfully?
p.s.
Steps I have made to Q2A's PHP source code
Entering MySQL database access credentials (by following this guide)
Adding app.yaml file so as Google App Engine SDK would deploy Q2A application
The Q2A source code folder I'm working with is as below.
You just need to remove the root password and leave it like this:
define('QA_MYSQL_PASSWORD', '');
You can find at the documentation that "when you connect from App Engine, you can use the root user and no password"
Hope it helps.

Categories