Skip to content

Commit cfa2611

Browse files
committed
minor #7145 Microsoft Azure update step by step article and screenshots for the new Microsoft Azure Portal (sudoloic, javiereguiluz)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #7145). Discussion ---------- Microsoft Azure update step by step article and screenshots for the new Microsoft Azure Portal This is an update of the Symfony deployment on Microsoft Azure for the new portal. Screenshots and some steps were outdated. Commits ------- 50c33a8 Make some long lines shorter to fit our soft limit of 80 chars per line 9724caf Microsoft Azure update step by step article and screenshots for the new Microsoft Azure Portal
2 parents b5587f0 + 50c33a8 commit cfa2611

19 files changed

+57
-76
lines changed
189 KB
Loading
-27 KB
Loading
82.2 KB
Loading
75 KB
Loading
51.9 KB
Loading
17.5 KB
Loading
76.3 KB
Loading
50.8 KB
Loading
-43.7 KB
Loading
31.7 KB
Loading
119 KB
Loading
27.6 KB
Loading
43.8 KB
Loading
212 KB
Loading
-145 KB
Loading
-376 Bytes
Loading
-120 KB
Binary file not shown.
-121 KB
Binary file not shown.

deployment/azure-website.rst

+57-76
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ Deploying to Microsoft Azure Website Cloud
77
This step by step article describes how to deploy a small Symfony web
88
application to the Microsoft Azure Website cloud platform. It will explain how
99
to set up a new Azure website including configuring the right PHP version and
10-
global environment variables. The document also shows how to you can leverage
10+
global environment variables. The document also shows how you can leverage
1111
Git and Composer to deploy your Symfony application to the cloud.
1212

1313
Setting up the Azure Website
1414
----------------------------
1515

1616
To set up a new Microsoft Azure Website, first `sign up with Azure`_ or sign in
1717
with your credentials. Once you're connected to your `Azure Portal`_ interface,
18-
scroll down to the bottom and select the **New** panel. On this panel, click
19-
**Web Site** and choose **Custom Create**:
18+
select the **New** panel. On this panel, use the search bar, search for
19+
**Web App + MySQL** and choose **Web App + MySQL** by **Microsoft** and
20+
click **Create**:
2021

2122
.. image:: /_images/deployment/azure-website/step-01.png
2223
:alt: Create a new custom Azure Website
@@ -29,58 +30,51 @@ Here, you will be prompted to fill in some basic information.
2930
.. image:: /_images/deployment/azure-website/step-02.png
3031
:alt: Setup the Azure Website
3132

32-
For the URL, enter the URL that you would like to use for your Symfony application,
33-
then pick **Create new web hosting plan** in the region you want. By default, a
34-
*free 20 MB SQL database* is selected in the database dropdown list. In this
35-
tutorial, the Symfony app will connect to a MySQL database. Pick the
36-
**Create a new MySQL database** option in the dropdown list. You can keep
37-
the **DefaultConnection** string name. Finally, check the box
38-
**Publish from source control** to enable a Git repository and go to the
39-
next step.
33+
For the URL, enter the URL that you would like to use for your Symfony
34+
application, then select your **Subscription**, **Create a new Resource Group**
35+
(which is a collection of resources that share the same lifecycle, permissions
36+
and policies). Pick ClearDB as a **Database Provider**. Create a new **App
37+
Service plan/Location** you will be prompted to set up your app service plan
38+
with a name, a region and a pricing tier. Then create a new **Database**, you
39+
will be prompted to set up your MySQL database storage with a database name and
40+
a region. The MySQL database storage is provided by Microsoft in partnership
41+
with ClearDB. Choose the same region you selected for App Service plan.
4042

41-
Step 2: New MySQL Database
42-
~~~~~~~~~~~~~~~~~~~~~~~~~~
43+
Click Create to continue.
4344

44-
On this step, you will be prompted to set up your MySQL database storage with a
45-
database name and a region. The MySQL database storage is provided by Microsoft
46-
in partnership with ClearDB. Choose the same region you selected for the hosting
47-
plan configuration in the previous step.
45+
Once you created the web site, select **All resources** in the left menu and
46+
choose the website you just created.
4847

49-
.. image:: /_images/deployment/azure-website/step-03.png
50-
:alt: Setup the MySQL database
51-
52-
Agree to the terms and conditions and click on the right arrow to continue.
53-
54-
Step 3: Where Is your Source Code
48+
Step 2: Where Is your Source Code
5549
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5650

57-
Now, on the third step, select a **Local Git repository** item and click
58-
on the right arrow to configure your Azure Website credentials.
51+
Now, select **Deployment options** under **APP DEPLOYMENT**, select **Choose
52+
Source** and choose **Local Git repository** to configure your Azure Website
53+
credentials. If you choose a different source like GitHub or Bitbucket you can
54+
ignore the next step.
5955

60-
.. image:: /_images/deployment/azure-website/step-04.png
56+
.. image:: /_images/deployment/azure-website/step-03.png
6157
:alt: Setup a local Git repository
6258

63-
Step 4: New Username and Password
64-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65-
66-
Great! You're now on the final step. Create a username and a secure password:
67-
these will become essential identifiers to connect to the FTP server and
68-
also to push your application code to the Git repository.
59+
Once you selected **Local Git repository**, click **Setup connection** you will
60+
be prompted to create a username and a secure password: these will become
61+
essential identifiers to connect to the FTP server and also to push your
62+
application code to the Git repository.
6963

70-
.. image:: /_images/deployment/azure-website/step-05.png
64+
.. image:: /_images/deployment/azure-website/step-04.png
7165
:alt: Configure Azure Website credentials
7266

7367
Congratulations! Your Azure Website is now up and running. You can check
7468
it by browsing to the Website url you configured in the first step. You should
7569
see the following display in your web browser:
7670

77-
.. image:: /_images/deployment/azure-website/step-06.png
71+
.. image:: /_images/deployment/azure-website/step-05.png
7872
:alt: Azure Website is running
7973

8074
The Microsoft Azure portal also provides a complete control panel for the Azure
8175
Website.
8276

83-
.. image:: /_images/deployment/azure-website/step-07.png
77+
.. image:: /_images/deployment/azure-website/step-06.png
8478
:alt: Azure Website Control Panel
8579

8680
Your Azure Website is ready! But to run a Symfony site, you need to configure
@@ -100,10 +94,10 @@ Even though Symfony only requires PHP 5.3.9 to run, it's always recommended
10094
to use the most recent PHP version whenever possible. PHP 5.3 is no longer
10195
supported by the PHP core team, but you can update it easily in Azure.
10296

103-
To update your PHP version on Azure, go to the **Configure** tab of the control
104-
panel and select the version you want.
97+
To update your PHP version on Azure, go to the **Application settings** under
98+
**SETTINGS** and select the version you want.
10599

106-
.. image:: /_images/deployment/azure-website/step-08.png
100+
.. image:: /_images/deployment/azure-website/step-07.png
107101
:alt: Enabling the most recent PHP runtime from Azure Website Control Panel
108102

109103
Click the **Save** button in the bottom bar to save your changes and restart
@@ -117,10 +111,10 @@ the web server.
117111
is no need to install and set up APC.
118112

119113
The following screenshot shows the output of a :phpfunction:`phpinfo` script
120-
run from an Azure Website to verify that PHP 5.5 is running with
114+
run from an Azure Website to verify that PHP 7.0 is running with
121115
OPCache enabled.
122116

123-
.. image:: /_images/deployment/azure-website/step-09.png
117+
.. image:: /_images/deployment/azure-website/step-08.png
124118
:alt: OPCache Configuration
125119

126120
Tweaking php.ini Configuration Settings
@@ -158,17 +152,16 @@ Website repository.
158152
Enabling the PHP intl Extension
159153
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160154

161-
This is the tricky part of the guide! At the time of writing this article,
162-
Microsoft Azure Website provided the ``intl`` extension, but it's not enabled
163-
by default. To enable the ``intl`` extension, there is no need to upload
164-
any DLL files as the ``php_intl.dll`` file already exists on Azure. In fact,
165-
this file just needs to be moved into the custom website extension directory.
155+
**The** ``intl`` **extension is now enabled by default. The following steps are
156+
no longer necessary.** You can check if the ``intl`` extension is enabled in the
157+
:phpfunction:`phpinfo` page.
166158

167-
.. note::
159+
However if the ``intl`` extension is not enabled you can follow these steps.
168160

169-
The Microsoft Azure team is currently working on enabling the ``intl`` PHP
170-
extension by default. In the near future, the following steps will no
171-
longer be necessary.
161+
This is the tricky part of the guide! To enable the ``intl`` extension, there is
162+
no need to upload any DLL files as the ``php_intl.dll`` file already exists on
163+
Azure. In fact, this file just needs to be moved into the custom website
164+
extension directory.
172165

173166
To get the ``php_intl.dll`` file under your ``site/wwwroot`` directory, simply
174167
access the online **Kudu** tool by browsing to the following URL:
@@ -182,7 +175,7 @@ explorer, a command line prompt, a log stream and a configuration settings summa
182175
page. Of course, this section can only be accessed if you're logged in to
183176
your main Azure Website account.
184177

185-
.. image:: /_images/deployment/azure-website/step-10.png
178+
.. image:: /_images/deployment/azure-website/step-09.png
186179
:alt: The Kudu Panel
187180

188181
From the Kudu front page, click on the **Debug Console** navigation item in the
@@ -201,26 +194,26 @@ new directory must be created under the main directory ``site/wwwroot``.
201194
202195
The whole process and output should look like this:
203196

204-
.. image:: /_images/deployment/azure-website/step-11.png
197+
.. image:: /_images/deployment/azure-website/step-10.png
205198
:alt: Executing commands in the online Kudu Console prompt
206199

207200
To complete the activation of the ``php_intl.dll`` extension, you must tell
208201
Azure Website to load it from the newly created ``ext`` directory. This can be
209202
done by registering a global ``PHP_EXTENSIONS`` environment variable from
210-
the **Configure** tab of the main Azure Website Control panel.
203+
the **Application settings** page of the main Azure Website control panel.
211204

212205
In the **app settings** section, register the ``PHP_EXTENSIONS`` environment
213206
variable with the value ``ext\php_intl.dll`` as shown in the screenshot below:
214207

215-
.. image:: /_images/deployment/azure-website/step-12.png
208+
.. image:: /_images/deployment/azure-website/step-11.png
216209
:alt: Registering custom PHP extensions
217210

218211
Hit "save" to confirm your changes and restart the web server. The PHP ``Intl``
219212
extension should now be available in your web server environment. The following
220213
screenshot of a :phpfunction:`phpinfo` page verifies the ``intl`` extension is
221214
properly enabled:
222215

223-
.. image:: /_images/deployment/azure-website/step-13.png
216+
.. image:: /_images/deployment/azure-website/step-12.png
224217
:alt: Intl extension is enabled
225218

226219
Great! The PHP environment setup is now complete. Next, you'll learn how
@@ -242,10 +235,10 @@ following command in your terminal:
242235
Get your Git from the `git-scm.com`_ website and follow the instructions
243236
to install and configure it on your local machine.
244237

245-
In the Azure Website Control panel, browse the **Deployment** tab to get the
238+
In the Azure Website Control panel, browse the **Overview** tab to get the
246239
Git repository URL where you should push your code:
247240

248-
.. image:: /_images/deployment/azure-website/step-14.png
241+
.. image:: /_images/deployment/azure-website/step-13.png
249242
:alt: Git deployment panel
250243

251244
Now, you'll want to connect your local Symfony application with this remote
@@ -296,7 +289,7 @@ Git repository.
296289
The deployment with Git should produce an output similar to the screenshot
297290
below:
298291

299-
.. image:: /_images/deployment/azure-website/step-15.png
292+
.. image:: /_images/deployment/azure-website/step-14.png
300293
:alt: Deploying files to the Git Azure Website repository
301294

302295
The code of the Symfony application has now been deployed to the Azure Website
@@ -316,7 +309,7 @@ of the Kudu application and execute the following commands in it:
316309
317310
$ cd site\wwwroot
318311
$ curl -sS https://getcomposer.org/installer | php
319-
$ php -d extension=php_intl.dll composer.phar install
312+
$ php composer.phar install
320313
321314
The ``curl`` command retrieves and downloads the Composer command line tool and
322315
installs it at the root of the ``site/wwwroot`` directory. Then, running
@@ -326,28 +319,21 @@ libraries.
326319
This may take a while depending on the number of third-party dependencies
327320
you've configured in your ``composer.json`` file.
328321

329-
.. note::
330-
331-
The ``-d`` switch allows you to quickly override/add any ``php.ini`` settings.
332-
In this command, we are forcing PHP to use the ``intl`` extension, because
333-
it is not enabled by default in Azure Website at the moment. Soon, this
334-
``-d`` option will no longer be needed since Microsoft will enable the
335-
``intl`` extension by default.
336322

337323
At the end of the ``composer install`` command, you will be prompted to fill in
338324
the values of some Symfony settings like database credentials, locale, mailer
339325
credentials, CSRF token protection, etc. These parameters come from the
340326
``app/config/parameters.yml.dist`` file.
341327

342-
.. image:: /_images/deployment/azure-website/step-16.png
328+
.. image:: /_images/deployment/azure-website/step-15.png
343329
:alt: Configuring Symfony global parameters
344330

345331
The most important thing in this article is to correctly set up your database
346-
settings. You can get your MySQL database settings on the right sidebar of the
347-
**Azure Website Dashboard** panel. Simply click on the
348-
**View Connection Strings** link to make them appear in a pop-in.
332+
settings. You can get your MySQL database settings in the **Application
333+
settings** page. Simply click on the **Show connection string values** link to
334+
make them appear.
349335

350-
.. image:: /_images/deployment/azure-website/step-17.png
336+
.. image:: /_images/deployment/azure-website/step-16.png
351337
:alt: MySQL database settings
352338

353339
The displayed MySQL database settings should be something similar to the code
@@ -377,9 +363,6 @@ doesn't provide a built-in mailer service. You should consider configuring
377363
the host-name and credentials of some other third-party mailing service if
378364
your application needs to send emails.
379365

380-
.. image:: /_images/deployment/azure-website/step-18.png
381-
:alt: Configuring Symfony
382-
383366
Your Symfony application is now configured and should be almost operational. The
384367
final step is to build the database schema. This can easily be done with the
385368
command line interface if you're using Doctrine. In the online **Console** tool
@@ -421,8 +404,6 @@ application, configure it with the following content:
421404

422405
.. code-block:: xml
423406
424-
<!-- web.config -->
425-
<?xml version="1.0" encoding="UTF-8"?>
426407
<configuration>
427408
<system.webServer>
428409
<rewrite>
@@ -472,7 +453,7 @@ to implement. And as a bonus, Microsoft is continuing to reduce the number
472453
of steps needed so that deployment becomes even easier.
473454

474455
.. _`sign up with Azure`: https://signup.live.com/signup.aspx
475-
.. _`Azure Portal`: https://manage.windowsazure.com
456+
.. _`Azure Portal`: https://portal.azure.com
476457
.. _`PHP MSDN documentation`: http://blogs.msdn.com/b/silverlining/archive/2012/07/10/configuring-php-in-windows-azure-websites-with-user-ini-files.aspx
477458
.. _`git-scm.com`: http://git-scm.com/download
478459
.. _`SymfonyAzureEdition`: https://github.com/beberlei/symfony-azure-edition/

0 commit comments

Comments
 (0)