Skip to content

Commit 9724caf

Browse files
Loïc Salanonxabbuh
Loïc Salanon
authored andcommitted
Microsoft Azure update step by step article and screenshots for the new Microsoft Azure Portal
1 parent b5587f0 commit 9724caf

19 files changed

+46
-74
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

+46-74
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
@@ -30,57 +31,46 @@ Here, you will be prompted to fill in some basic information.
3031
:alt: Setup the Azure Website
3132

3233
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.
40-
41-
Step 2: New MySQL Database
42-
~~~~~~~~~~~~~~~~~~~~~~~~~~
43-
44-
On this step, you will be prompted to set up your MySQL database storage with a
34+
then select your **Subscription**, **Create a new Resource Group** (which is a
35+
collection of resources that share the same lifecycle, permissions and policies).
36+
Pick ClearDB as a **Database Provider**. Create a new **App Service plan/Location**
37+
you will be prompted to set up your app service plan with a name, a region and a pricing tier.
38+
Then create a new **Database**, you will be prompted to set up your MySQL database storage with a
4539
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.
40+
in partnership with ClearDB. Choose the same region you selected for App Service plan.
4841

49-
.. image:: /_images/deployment/azure-website/step-03.png
50-
:alt: Setup the MySQL database
42+
Click Create to continue.
5143

52-
Agree to the terms and conditions and click on the right arrow to continue.
44+
Once you created the web site, select **All resources** in the left menu and choose the website you just created.
5345

54-
Step 3: Where Is your Source Code
46+
Step 2: Where Is your Source Code
5547
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5648

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.
49+
Now, select **Deployment options** under **APP DEPLOYMENT**, select **Choose Source** and choose
50+
**Local Git repository** to configure your Azure Website credentials. If you choose a different source
51+
like GitHub or Bitbucket you can ignore the next step.
5952

60-
.. image:: /_images/deployment/azure-website/step-04.png
53+
.. image:: /_images/deployment/azure-website/step-03.png
6154
:alt: Setup a local Git repository
6255

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.
56+
Once you selected **Local Git repository**, click **Setup connection** you will be prompted
57+
to create a username and a secure password: these will become essential identifiers
58+
to connect to the FTP server and also to push your application code to the Git repository.
6959

70-
.. image:: /_images/deployment/azure-website/step-05.png
60+
.. image:: /_images/deployment/azure-website/step-04.png
7161
:alt: Configure Azure Website credentials
7262

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

77-
.. image:: /_images/deployment/azure-website/step-06.png
67+
.. image:: /_images/deployment/azure-website/step-05.png
7868
:alt: Azure Website is running
7969

8070
The Microsoft Azure portal also provides a complete control panel for the Azure
8171
Website.
8272

83-
.. image:: /_images/deployment/azure-website/step-07.png
73+
.. image:: /_images/deployment/azure-website/step-06.png
8474
:alt: Azure Website Control Panel
8575

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

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

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

10998
Click the **Save** button in the bottom bar to save your changes and restart
@@ -117,10 +106,10 @@ the web server.
117106
is no need to install and set up APC.
118107

119108
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
109+
run from an Azure Website to verify that PHP 7.0 is running with
121110
OPCache enabled.
122111

123-
.. image:: /_images/deployment/azure-website/step-09.png
112+
.. image:: /_images/deployment/azure-website/step-08.png
124113
:alt: OPCache Configuration
125114

126115
Tweaking php.ini Configuration Settings
@@ -158,17 +147,13 @@ Website repository.
158147
Enabling the PHP intl Extension
159148
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160149

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.
150+
**The** ``intl`` **extension is now enabled by default. The following steps are no longer necessary.** You can check if the ``intl`` extension is enabled in the :phpfunction:`phpinfo` page.
166151

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

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.
154+
This is the tricky part of the guide! To enable the ``intl`` extension, there is no need to upload
155+
any DLL files as the ``php_intl.dll`` file already exists on Azure. In fact,
156+
this file just needs to be moved into the custom website extension directory.
172157

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

185-
.. image:: /_images/deployment/azure-website/step-10.png
170+
.. image:: /_images/deployment/azure-website/step-09.png
186171
:alt: The Kudu Panel
187172

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

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

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

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

215-
.. image:: /_images/deployment/azure-website/step-12.png
200+
.. image:: /_images/deployment/azure-website/step-11.png
216201
:alt: Registering custom PHP extensions
217202

218203
Hit "save" to confirm your changes and restart the web server. The PHP ``Intl``
219204
extension should now be available in your web server environment. The following
220205
screenshot of a :phpfunction:`phpinfo` page verifies the ``intl`` extension is
221206
properly enabled:
222207

223-
.. image:: /_images/deployment/azure-website/step-13.png
208+
.. image:: /_images/deployment/azure-website/step-12.png
224209
:alt: Intl extension is enabled
225210

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

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

248-
.. image:: /_images/deployment/azure-website/step-14.png
233+
.. image:: /_images/deployment/azure-website/step-13.png
249234
:alt: Git deployment panel
250235

251236
Now, you'll want to connect your local Symfony application with this remote
@@ -296,7 +281,7 @@ Git repository.
296281
The deployment with Git should produce an output similar to the screenshot
297282
below:
298283

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

302287
The code of the Symfony application has now been deployed to the Azure Website
@@ -316,7 +301,7 @@ of the Kudu application and execute the following commands in it:
316301
317302
$ cd site\wwwroot
318303
$ curl -sS https://getcomposer.org/installer | php
319-
$ php -d extension=php_intl.dll composer.phar install
304+
$ php composer.phar install
320305
321306
The ``curl`` command retrieves and downloads the Composer command line tool and
322307
installs it at the root of the ``site/wwwroot`` directory. Then, running
@@ -326,28 +311,20 @@ libraries.
326311
This may take a while depending on the number of third-party dependencies
327312
you've configured in your ``composer.json`` file.
328313

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.
336314

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

342-
.. image:: /_images/deployment/azure-website/step-16.png
320+
.. image:: /_images/deployment/azure-website/step-15.png
343321
:alt: Configuring Symfony global parameters
344322

345323
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.
324+
settings. You can get your MySQL database settings in the **Application settings** page. Simply click on the
325+
**Show connection string values** link to make them appear.
349326

350-
.. image:: /_images/deployment/azure-website/step-17.png
327+
.. image:: /_images/deployment/azure-website/step-16.png
351328
:alt: MySQL database settings
352329

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

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

422396
.. code-block:: xml
423397
424-
<!-- web.config -->
425-
<?xml version="1.0" encoding="UTF-8"?>
426398
<configuration>
427399
<system.webServer>
428400
<rewrite>
@@ -472,7 +444,7 @@ to implement. And as a bonus, Microsoft is continuing to reduce the number
472444
of steps needed so that deployment becomes even easier.
473445

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

0 commit comments

Comments
 (0)