<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Microsoft Azure Open Source Development Support Team Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/azureossds/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/azureossds/feed.xml</link>
    <description>Support for Open Source Technologies on Microsoft Azure App Service</description>
    <lastBuildDate>Tue, 28 May 2019 05:37:12 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>How to send emails through Azure Web Apps using Google / Gmail</title>
      <link>https://docs.microsoft.com/archive/blogs/azureossds/how-to-send-emails-through-azure-web-apps-using-google-gmail</link>
      <pubDate>Sat, 02 Feb 2019 12:29:38 GMT</pubDate>
      <dc:creator><![CDATA[Brad Edwards (MICROSOFT)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/azureossds/?p=5895</guid>
      <description><![CDATA[How to send emails through Azure Web Apps using Google / Gmail
Part I – Configuring Google to use...]]></description>
      <content:encoded><![CDATA[<h1><strong><u>How to send emails through Azure Web Apps using Google / Gmail</u></strong></h1>
<h3><u>Part I – Configuring Google to use App Passwords</u></h3>
&nbsp;

<em><strong>Two quick notes before proceeding: This is not a ‘once and done’ secret or app generation concept, this is unique to the gmail address and will need to be done for each and every email address that you wish to send emails from.</strong></em>

<em><strong>Next, this sample uses the C# Open Source MailKit library. You can find more details about this here:</strong></em>

<em><strong><a target="_blank" href="https://github.com/jstedfast/MailKit" rel="noopener">https://github.com/jstedfast/MailKit</a></strong></em>

&nbsp;

Step 1 – Login to your google account and setup your Google App Password through the security center.

<span><a href="https://gmail.com">https://gmail.com</a></span> then click in the upper right on your avatar and click “Google Account”

<a href="https://msdnshared.blob.core.windows.net/media/2019/02/Gmail_Account_Display.png"><img src="https://msdnshared.blob.core.windows.net/media/2019/02/Gmail_Account_Display-300x179.png" alt="" width="300" height="179" class="alignnone size-medium wp-image-5935" /></a>

Click Security. If you already have 2 step verification and app passwords enabled, click on App Passwords to generate a new one. If you do not, then you will need to enable these to complete this walkthrough / guide.

<a href="https://msdnshared.blob.core.windows.net/media/2019/02/Google_Security_Display.png"><img src="https://msdnshared.blob.core.windows.net/media/2019/02/Google_Security_Display-221x300.png" alt="Google profile details" width="221" height="300" class="size-medium wp-image-5925" /></a>

<strong><u>On the step below if you do not have 2 factor authentication enabled and verified with your phone, you will need to do that, first.</u></strong>

&nbsp;

Next you will need to generate the password to use:

<a href="https://msdnshared.blob.core.windows.net/media/2019/02/Gmail_Security_Center.png"><img src="https://msdnshared.blob.core.windows.net/media/2019/02/Gmail_Security_Center-300x160.png" alt="" width="300" height="160" class="alignnone size-medium wp-image-5905" /></a>

Now to generate the actual password. Use whichever name you are comfortable with.

<a href="https://msdnshared.blob.core.windows.net/media/2019/02/Gmail_Security_Center_Generate_Code.png"><img src="https://msdnshared.blob.core.windows.net/media/2019/02/Gmail_Security_Center_Generate_Code-300x190.png" alt="" width="300" height="190" class="alignnone size-medium wp-image-5915" /></a>

Take note of the password (put it in your clipboard or notepad of choice). It will look like this:

<a href="https://msdnshared.blob.core.windows.net/media/2019/02/App_Password.png"><img src="https://msdnshared.blob.core.windows.net/media/2019/02/App_Password-300x260.png" alt="" width="300" height="260" class="alignnone size-medium wp-image-5945" /></a>

Step 2 – Install Visual Studio (if needed).
<h3><u>Part II – Copying / Programming</u></h3>
Step 1 – Clone the GitHub Repository <a target="_blank" href="https://github.com/bledwards1/MailKit_AzureWebApps_Demo" rel="noopener"><span>https://github.com/bledwards1/MailKit_AzureWebApps_Demo</span></a>

Step 2 – Update the variables inside of the code sample downloaded as shown in the screenshots. The only file you should have to modify is the Default.aspx

Lines to modify: 30, 31, and 32 (optional), 37. Feel free to edit any of the others if you’d like to modify such as the subject line, etc. They are also commented clearly in the repository above if you forget...

Step 3 – Run the code and check for an email sample!]]></content:encoded>
    </item>
    <item>
      <title>Azure App Service Linux - Adding PHP Extensions</title>
      <link>https://docs.microsoft.com/archive/blogs/azureossds/azure-app-service-linux-adding-php-extensions</link>
      <pubDate>Tue, 29 Jan 2019 12:14:34 GMT</pubDate>
      <dc:creator><![CDATA[Toan Nguyen-Azure]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/azureossds/?p=5885</guid>
      <description><![CDATA[Customers that need to install PHP extensions that are not available on the provided PHP images on...]]></description>
      <content:encoded><![CDATA[Customers that need to install PHP extensions that are not available on the provided PHP images on Azure App Services Linux can perform the following steps below to install their extensions.
<h4>Install PHP extensions-</h4>
<ol>
 	<li> Go to your KUDU console https://&lt;sitename&gt;.scm.azurewebsites.net</li>
 	<li> Select SSH.</li>
 	<li> In your SSH session, run the command highlighted in yellow.</li>
</ol>
<blockquote>
<pre> root@3628690f5888:/home/site/wwwroot# pear config-show
 Configuration (channel pear.php.net):
 =====================================
 Auto-discover new Channels     auto_discover    &lt;not set&gt;
 Default Channel                default_channel  pear.php.net
 HTTP Proxy Server Address      http_proxy       &lt;not set&gt;
 PEAR server [DEPRECATED]       master_server    pear.php.net
 Default Channel Mirror         preferred_mirror pear.php.net
 Remote Configuration File      remote_config    &lt;not set&gt;
 PEAR executables directory     bin_dir          /usr/local/bin
 PEAR documentation directory   doc_dir          /usr/local/lib/php/doc
 PHP extension directory        ext_dir          /usr/local/lib/php/extensions/no-debug-non-zts-20151012
 PEAR directory                 php_dir          /usr/local/lib/php
 PEAR Installer cache directory cache_dir        /tmp/pear/cache
 PEAR configuration file        cfg_dir          /usr/local/lib/php/cfg</pre>
</blockquote>
<p style="padding-left: 30px">4.  In the output above, the path for ext_dir is where your extension will be downloaded.  Note the path for later use.</p>
<p style="padding-left: 30px">5.  To install an extension, perform the following.  I'll be installing the PHP extension "redis" in this example.</p>

<blockquote>
<pre> root@3628690f5888:/home/site/wwwroot# pecl install redis
 downloading redis-4.1.1.tgz ...
 Starting to download redis-4.1.1.tgz (220,894 bytes)
 ..............................................done: 220,894 bytes
 25 source files, building
 running: phpize
 Configuring for:
 PHP Api Version:         20151012
 Zend Module Api No:      20151012
 Zend Extension Api No:   320151012
 enable igbinary serializer support? [no] :
 enable lzf compression support? [no] :
 ……
 Build process completed successfully
 <span style="color: #008000">Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20151012/redis.so'</span>
 install ok: channel://pecl.php.net/redis-4.1.1
 configuration option "php_ini" is not set to php.ini location
 You should add "extension=redis.so" to php.ini</pre>
</blockquote>
<p style="padding-left: 30px">6. You'll notice the path to the newly installed extension (highlighted in green) is also returned after it's installed and matches the "ext_dir" path returned from the Pear configurations.</p>
<p style="padding-left: 30px">7.  Now that the extension is installed, we'll need to create an "ext" directory under "/home/site" and copy the extension to that directory so that the extension persists if the container is restarted.  Below are the commands to do this.</p>

<blockquote>
<pre> root@9a793907fbb0:/home/site/wwwroot# mkdir /home/site/ext
 root@9a793907fbb0:/home/site/wwwroot# cp /home/site/ext /usr/local/lib/php/extensions/no-debug-non-zts-20151012/redis.so /home/site/ext
</pre>
</blockquote>
<p style="padding-left: 30px"> <span style="color: #ff0000">Note</span>:  The text may continue and look *garbled.  Don't worry, keep entering the command.</p>
<p style="padding-left: 30px">8.  The command highlighted in yellow creates the "ext" directory and the one in green copies the files from the installation location to the new directory.</p>
<p style="padding-left: 30px">9.  Once this is done, perform the steps provided at <a href="https://blogs.msdn.microsoft.com/azureossds/2019/01/29/azure-app-service-linux-update-php-settings/">App Service Linux - Update PHP Settings</a>.</p>

<h4>Recompiling PHP extensions -</h4>
If you need to reconfigure an extension such as GD, please use the following steps.
<ol>
 	<li>SSH into your container and run the following</li>
 	<li>"docker-php-ext-configure gd --with-freetype-dir=/usr --with-jpeg-dir=/usr"</li>
 	<li>"docker-php-ext-install gd"</li>
 	<li>cp /usr/local/lib/php/extensions/no-debug-non-zts-20151012/gd.so /home/site/ext</li>
</ol>
To test, run "service apache2 reload" then go your PHP info page to see if the "freetype" is listed under GD.  If so, update the "extensions.ini" as shown in the "Adding the Extension" section.  We will need to make some further modifications to avoid a conflict with the GD extension if the site were to be rebooted.  In your Application Settings, add the following so that the "extensions.ini" is loaded before the ones under "/usr/local/etc/php/conf.d"

Additionally, you can perform the additional steps to move the other INI files to the "/home/site/ini" directory.  In step 3, we'll rename the INI for GD so that it doesn't load the original GD extension on startup but continues to load other extensions.
<ol>
 	<li>cp /usr/local/etc/php/conf.d/* /home/site/ini</li>
 	<li>cd /home/site/ini</li>
 	<li>mv docker-php-ext-gd.ini docker-php-ext-gd.old</li>
</ol>
<h4>Adding the Extension-</h4>
Once the steps performed at <a href="https://blogs.msdn.microsoft.com/azureossds/2019/01/29/azure-app-service-linux-update-php-settings/">App Service Linux - Updating PHP settings</a> are complete, you'll have an "extensions.ini" in your "/home/site/ini" directory.  Below are some options for modifying the extensions.ini file to include our new PHP extension.
<h5>Option #1 - Echo</h5>
<ol>
 	<li>Change directories to /home/site/ini.</li>
 	<li>Type the following.</li>
</ol>
<blockquote>
<pre> echo "extensions=/home/site/ext/redis.so" &gt;&gt; extensions.ini</pre>
</blockquote>
<h5>Option #2 - Vi</h5>
<ol>
 	<li>Change directories to /home/site/ini.</li>
 	<li>Perform the following</li>
</ol>
<p style="padding-left: 60px"> a) vi extensions.ini
b) Press "i" on your keyboard to start editing and add the following.</p>

<blockquote>
<pre style="padding-left: 90px"> extension=/home/site/ext/redis.so</pre>
</blockquote>
<p style="padding-left: 60px">c) Press "Esc", then ":wq!" and enter to save.</p>
Once you're done, restart the site using the Azure Portal and you'll now see the extension installed in your PHPInfo page.]]></content:encoded>
    </item>
    <item>
      <title>Azure App Service Linux - Update PHP Settings</title>
      <link>https://docs.microsoft.com/archive/blogs/azureossds/azure-app-service-linux-update-php-settings</link>
      <pubDate>Tue, 29 Jan 2019 11:50:06 GMT</pubDate>
      <dc:creator><![CDATA[Toan Nguyen-Azure]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/azureossds/?p=5875</guid>
      <description><![CDATA[Azure App Service Linux provides PHP images with preconfigured settings and extensions.  If you need...]]></description>
      <content:encoded><![CDATA[Azure App Service Linux provides PHP images with preconfigured settings and extensions.  If you need to adjust your PHP settings, follow the steps provided below.

&nbsp;

<b>Updating PHP Settings-</b>

&nbsp;

Settings such as upload_max_filesize, expose_php, and others can be modified using a custom "ini" file. You can use either SSH or Bash to accomplish this.

&nbsp;
<ol>
 	<li>Go to your KUDU site <a href="https://%3csitename%3e.scm.azurewebsites.net/">https://&lt;sitename&gt;.scm.azurewebsites.net</a>.</li>
 	<li>Select Bash or SSH from the top menu.</li>
 	<li>In Bash/SSH, go to your "/home/site" directory.</li>
 	<li>Create a directory called "ini" (i.e. mkdir ini)</li>
 	<li>Change directories to "ini".</li>
 	<li>We'll need to create an "ini" file to add our settings to. In this example, I'm using "extensions.ini". There are no file editors such as Vi, Vim, or Nano so we'll simply use echo to add the settings to the file. I'm changing the "upload_max_filesize" from 2M to 50M. Below is the command that I used to add the setting and create an "extensions.ini" file if one doesn't already exist.</li>
</ol>
&nbsp;

NOTE: If you already have an extensions.ini file, you can use the same command which will add the new setting to the file.
<blockquote>
<pre>/home/site/ini&gt;echo "upload_max_filesize=50M" &gt;&gt; extensions.ini

/home/site/ini&gt;cat extensions.ini

upload_max_filesize=50M

/home/site/ini&gt;</pre>
</blockquote>
If using SSH, you can use vi to create/edit the extensions file using the following commands.

a) vi extensions.ini

b) Press "i" on your keyboard to start editing and add the following.
<blockquote>
<pre>upload_max_filesize=50M</pre>
</blockquote>
c) Press "Esc", then ":wq!" and enter to save.

&nbsp;

<b>Add an Application Setting-</b>

&nbsp;

We'll now need to go to the Azure Portal and add an Application Setting to scan the "ini" directory that we just created to apply the change for upload_max_filesize.

&nbsp;
<ol>
 	<li>Go to the Azure Portal (<a href="https://portal.azure.com/">https://portal.azure.com</a>) and select your App Service Linux PHP application.</li>
 	<li>Select Application Settings for the app.</li>
 	<li>Under the Application settings section, press the "+ Add new setting".</li>
 	<li>For the App Setting Name, enter "PHP_INI_SCAN_DIR".</li>
 	<li>For the value, enter "/usr/local/etc/php/conf.d:/home/site/ini"</li>
</ol>
&nbsp;

<b>NOTE</b>: If you're you've recompiled a PHP extension such as GD, perform the steps at "Recompiling PHP Extensions" at <a href="https://blogs.msdn.microsoft.com/azureossds/2019/01/29/azure-app-service-linux-adding-php-extensions/">Azure App Service - Adding PHP Extensions</a> and enter a value of "/home/site/ini" and omit the "/usr/local/etc/php/conf.d:" portion.

&nbsp;
<ol>
 	<li>The first portion of the value is the location of other ini files that come with the Docker container and the second part (after the ":") is the directory that contains our new ini file.</li>
 	<li>Press the save button.</li>
</ol>
&nbsp;

<b>Testing- </b>
<p style="padding-left: 30px">1. You should now see the upload_max_filesize increase from 2M to 50M if you have a PHP info page. If not, create one by going to your /home/site/wwwroot directory and perform the following.</p>

<blockquote>
<pre>echo "&lt;?php phpinfo();" &gt;&gt; info.php</pre>
</blockquote>
<p style="padding-left: 30px">2. You should now see the values by going to <a href="https://%3csitename%3e.azurewebsites.net/info.php">https://&lt;sitename&gt;.azurewebsites.net/info.php</a></p>
&nbsp;

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Building Python Functions App that use Native Modules – Custom Docker</title>
      <link>https://docs.microsoft.com/archive/blogs/azureossds/building-python-functions-app-that-use-native-modules-custom-docker</link>
      <pubDate>Wed, 31 Oct 2018 14:23:43 GMT</pubDate>
      <dc:creator><![CDATA[Chris Maldonado (MS OSS)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/azureossds/?p=5805</guid>
      <description><![CDATA[Prerequisites
To build and test locally, you will need to:

 	Install Python 3.6
 	Install...]]></description>
      <content:encoded><![CDATA[<h2>Prerequisites</h2>
To build and test locally, you will need to:
<ul>
 	<li>Install <a href="https://www.python.org/downloads/">Python 3.6</a></li>
 	<li>Install <a href="https://docs.docker.com/docker-for-windows/install/">Docker</a></li>
 	<li>Install <a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local">Azure Functions Core Tools</a> version 2.0.3 or later</li>
</ul>
To install Azure Functions Core tools you will need also these requirements:
<ol start="2">
 	<li>Install <a href="https://www.microsoft.com/net/download">.NET Core 2.1 for Windows</a>.</li>
 	<li>Install <a href="https://docs.npmjs.com/getting-started/installing-node#osx-or-windows">Node.js</a>, which includes npm. For version 2.x of the tools, only Node.js 8.5 and later versions are supported.</li>
 	<li>Install the Core Tools package:
<strong>npm install -g azure-functions-core-tools</strong></li>
</ol>
<h2>Create and activate a virtual environment</h2>
To create a Functions project, it is required that you work in a Python 3.6 virtual environment. Run the following commands to create and activate a virtual environment named env.

# In Bash
python3.6 -m venv env
source env/bin/activate

# In PowerShell
py -3.6 -m venv env
env\scripts\activate

# In CMD
python -m venv env
env\scripts\activate
<h2>Create a local Functions Project</h2>
To create a Functions project, it is required that you work in a Python 3.6 virtual environment. Run the following commands to create and activate a virtual environment named env. In the terminal window or from a command prompt, run the following command:
<p style="padding-left: 30px">func init MyFunctionProj --worker-runtime python –docker
func init . --worker-runtime python --docker</p>
You will see something like the following output.
<p style="padding-left: 30px">Installing wheel package
Installing azure-functions==1.0.0a5 package
Installing azure-functions-worker==1.0.0a6 package
Running pip freeze
Writing .funcignore
Writing .gitignore
Writing host.json
Writing local.settings.json
Writing D:\__Documents\WebAppProjects\functions-python-3\.vscode\extensions.json
Writing Dockerfile</p>
This generates a Dockerfile with the following content:
<p style="padding-left: 30px">FROM mcr.microsoft.com/azure-functions/python:2.0</p>
<p style="padding-left: 30px">COPY . /home/site/wwwroot</p>
<p style="padding-left: 30px">RUN cd /home/site/wwwroot &amp;&amp; \</p>
<p style="padding-left: 30px">    pip install -r requirements.txt</p>

<h2>Create a function</h2>
<a href="https://github.com/Azure/azure-functions-python-worker/wiki/Create-your-first-Python-function#create-a-function">https://github.com/Azure/azure-functions-python-worker/wiki/Create-your-first-Python-function#create-a-function</a>
<h2>Run the function locally</h2>
<a href="https://github.com/Azure/azure-functions-python-worker/wiki/Create-your-first-Python-function#run-the-function-locally">https://github.com/Azure/azure-functions-python-worker/wiki/Create-your-first-Python-function#run-the-function-locally</a>
<h2>Run locally as Docker container</h2>
Using Docker, run the following command.
Replace &lt;imagename&gt; and &lt;tag&gt; with preferred names.
<p style="padding-left: 30px">docker build . --tag &lt;imagename&gt;:&lt;tag&gt;
(example) docker build . -- pythonfunction:v1</p>
<a href="https://msdnshared.blob.core.windows.net/media/2018/10/dockerbuild.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/10/dockerbuild.png" alt="" width="1000" height="168" class="alignnone wp-image-5815 size-full" /></a>

Once image has been build you could run the following command to start the image:
<p style="padding-left: 30px">docker run -p &lt;portexposed&gt;:&lt;portusedinside&gt; &lt;imagename&gt;:&lt;tag&gt;
(example) docker run -p 8080:80 pythonfunction:v1</p>
Once started, you could browse to <a href="https://localhost:8080">https://localhost:8080</a> (using example) to view your function running.

<a href="https://msdnshared.blob.core.windows.net/media/2018/10/localtest.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/10/localtest.png" alt="" width="597" height="350" class="alignnone wp-image-5825 size-full" /></a>
<h2>Deploy your function app</h2>
You could use Docker Hub or Azure Container Registry to deploy your Docker image.
<h4>Push image to Docker Hub</h4>
<a href="https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal#push-image-to-acr">https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal#push-image-to-acr</a>
<h4>First Create a container registry<a href="https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal#create-a-container-registry"></a></h4>
<a href="https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal#create-a-container-registry">https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal#create-a-container-registry</a>
<h4>Log in to ACR</h4>
<a href="https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal#create-a-container-registry">https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal#create-a-container-registry</a>
<h4>Push image to ACR</h4>
<a href="https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal#push-image-to-acr">https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal#push-image-to-acr</a>
<h4>Create function app via Azure Portal</h4>
Select the <strong>New</strong> button found on the upper left-hand corner of the Azure portal, then select <strong>Compute &gt; Function App</strong>.

<a href="https://msdnshared.blob.core.windows.net/media/2018/10/createnew.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/10/createnew.png" alt="" width="624" height="629" class="alignnone wp-image-5835 size-full" /></a>

When configuring the settings, select <strong>Linux (Preview)</strong> for OS and <strong>Docker Image</strong> for Publish.

Under Configure Container, select either <strong>Azure container Registry</strong> or <strong>Docker Hub</strong> depending on how you deployed your Docker image.

<a href="https://msdnshared.blob.core.windows.net/media/2018/10/functionapp.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/10/functionapp.png" alt="" width="249" height="700" class="wp-image-5845 size-full alignnone" /></a>

Once deployed, you will be able to access the Function Apps page

<a href="https://msdnshared.blob.core.windows.net/media/2018/10/functionapppage.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/10/functionapppage.png" alt="" width="1000" height="399" class="alignnone wp-image-5855 size-full" /></a>

Once deployed, you can test your Function App:

Be sure to change &lt;functionappname&gt; and &lt;function-name&gt; with your functions values.

https://&lt;functionappname&gt;.azurewebsites.com/api/&lt;function-name&gt;]]></content:encoded>
    </item>
    <item>
      <title>Restrict access to login for the WordPress running on Azure web app container</title>
      <link>https://docs.microsoft.com/archive/blogs/azureossds/restrict-access-to-login-for-the-wordpress-running-on-azure-web-app-container</link>
      <pubDate>Fri, 12 Oct 2018 19:17:52 GMT</pubDate>
      <dc:creator><![CDATA[Yi Wang (MS OSS)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/azureossds/?p=5765</guid>
      <description><![CDATA[For WordPress sites that running on Apache server in Azure web app for containers, here is sample...]]></description>
      <content:encoded><![CDATA[For WordPress sites that running on Apache server in Azure web app for containers, here is sample code to restrict access to login pages, such as wp-login.php or wp-admin

1. FTP to files in /home/site/wwwroot, find the file ".htaccess" (create one if it does not exist)

<a href="https://msdnshared.blob.core.windows.net/media/2018/10/ftp21.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/10/ftp21-500x306.png" alt="" width="500" height="306" class="alignnone wp-image-5785 size-mediumlarge" /></a>

2. Add the code below to ".htaccess", replace the IP "xx.xx.xx.xx" by that you allow to access wp-login.php
<pre>&lt;Files wp-login.php&gt;
Order Deny,Allow
Deny from all
SetENVIf X-Client-IP "xx.xx.xx.xx" AllowAccess
Allow from env=AllowAccess
&lt;/Files&gt;</pre>
Note: Since /wp-admin will direct to wp-login.php, no need to define the rule for wp-admin]]></content:encoded>
    </item>
    <item>
      <title>RewriteRule sample for WordPress in subdirectory</title>
      <link>https://docs.microsoft.com/archive/blogs/azureossds/web-config-sample-for-wordpress-nested-in-subdirectory</link>
      <pubDate>Mon, 01 Oct 2018 13:45:27 GMT</pubDate>
      <dc:creator><![CDATA[Yi Wang (MS OSS)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/azureossds/?p=5735</guid>
      <description><![CDATA[In the case you installed another instance of WordPress in a subdirectory of main WordPress site in...]]></description>
      <content:encoded><![CDATA[In the case you installed another instance of WordPress in a subdirectory of main WordPress site in Azure web app for Windows, your WordPress installation may be like this, <a href="https://msdnshared.blob.core.windows.net/media/2018/10/wordpress2.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/10/wordpress2-500x289.png" alt="" width="500" height="289" class="alignnone wp-image-5755 size-mediumlarge" /></a>   if use "Post name" Permalink setting, with default web.config, articles in subdirectory might give 404 (not found), for example, <a href="https://msdnshared.blob.core.windows.net/media/2018/10/notfound.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/10/notfound-500x190.png" alt="" width="500" height="190" class="alignnone wp-image-5745 size-mediumlarge" /></a>   For this problem, you can modify web.config to exclude subdirectory "blogs" from main site rewrite rules, here is sample web.config,
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;configuration&gt;
&lt;system.webServer&gt;
  &lt;rewrite&gt;
  &lt;rules&gt;
    &lt;rule name="Imported Rule 1" stopProcessing="true"&gt;
      &lt;match url="^index.php$" ignoreCase="false" /&gt;
      &lt;action type="None" /&gt;
    &lt;/rule&gt;
    &lt;rule name="Imported Rule 2" stopProcessing="true"&gt;
      &lt;match url="." ignoreCase="false" /&gt;
      &lt;conditions&gt;
        &lt;!--# Include in the next line all folders to exclude--&gt;
        &lt;add input="{URL}" pattern="(blogs)" negate="true" /&gt;
        &lt;add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /&gt;
        &lt;add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /&gt;
      &lt;/conditions&gt;
      &lt;action type="Rewrite" url="/index.php" /&gt;
    &lt;/rule&gt;
  &lt;/rules&gt;
  &lt;/rewrite&gt;
&lt;/system.webServer&gt;
&lt;/configuration&gt;</pre>
&nbsp;

If the WordPress sites are hosted on Apache on Azure web app for containers, modify wwwroot/.htaccess, for example,
<pre># BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]</pre>
# Include in the next line all folders to exclude
RewriteCond %{REQUEST_URI} !(blogs) [NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress]]></content:encoded>
    </item>
    <item>
      <title>How to change memory_limit on Wordpress Web App for Linux on Azure</title>
      <link>https://docs.microsoft.com/archive/blogs/azureossds/how-to-change-memory_limit-on-wordpress-web-app-for-linux-on-azure</link>
      <pubDate>Thu, 27 Sep 2018 12:41:37 GMT</pubDate>
      <dc:creator><![CDATA[Brad Edwards (MICROSOFT)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/azureossds/?p=5645</guid>
      <description><![CDATA[Do you need to edit the memory_limit and post_max_size PHP settingson your Linux Web App hosted with...]]></description>
      <content:encoded><![CDATA[Do you need to edit the memory_limit and post_max_size PHP settingson your Linux Web App hosted with MS Azure? I can show you how to do this without needing to install anything via SSH (which by the way is not recommended. Read up on why <a href="https://blogs.msdn.microsoft.com/waws/2017/09/08/things-you-should-know-web-apps-and-linux/#InstallGone">here</a>).

<strong>Step 1: Login to the portal and go to the "Advanced Tools" section and go to the SSH option.</strong>

<strong>Step 2: Copy these entries and place them in the .htaccess file located at /home/site/wwwroot/ using your preferred method. I prefer to use vi.</strong>

php_value memory_limit 256M

php_value post_max_size 256M

php_value upload_max_filesize 128M

<strong>Step 3: Save the file using vi to add these entries into the .htaccess file. It should look something like this once you are done:</strong>

<a href="https://msdnshared.blob.core.windows.net/media/2018/09/SSH-Htaccess-Entry.png"><img width="500" height="238" class="alignnone wp-image-5655 size-mediumlarge" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/SSH-Htaccess-Entry-500x238.png" /></a>

<strong>Step 4: Confirm they have been set by creating a phpinfo.php file and make sure the settings are correct. Or, you can check in the Wordpress Media Upload tool:</strong> <a href="https://msdnshared.blob.core.windows.net/media/2018/09/Wordpress-Upload-Dialog.png"><img width="500" height="105" class="alignnone wp-image-5665 size-mediumlarge" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/Wordpress-Upload-Dialog-500x105.png" /></a>

You can see that these settings have now been updated and no need to make a custom Docker image just to edit a few PHP variables.

&nbsp;

Let me know what other interesting settings work in our .htaccess files in the comments below!]]></content:encoded>
    </item>
    <item>
      <title>How to set node version for Windows node.js webapp from Azure Portal</title>
      <link>https://docs.microsoft.com/archive/blogs/azureossds/how-to-set-node-version-for-windows-node-js-webapp-from-azure-portal</link>
      <pubDate>Tue, 25 Sep 2018 16:35:42 GMT</pubDate>
      <dc:creator><![CDATA[Milind Belhe]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/azureossds/?p=5675</guid>
      <description><![CDATA[Create the Azure WebApp

 	Create new WebApp using Azure portal



&nbsp;

 	Set the App...]]></description>
      <content:encoded><![CDATA[<h2>Create the Azure WebApp</h2>
<ul>
 	<li>Create new WebApp using Azure portal</li>
</ul>
<a href="https://msdnshared.blob.core.windows.net/media/2018/09/blog1.jpg"><img width="462" height="350" class="alignnone size-mediumlarge wp-image-5685" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/blog1-462x350.jpg" /></a>

&nbsp;
<ul>
 	<li>Set the App name, Resource Group and click "Create"</li>
</ul>
<a href="https://msdnshared.blob.core.windows.net/media/2018/09/blog2.jpg"><img width="617" height="868" class="alignnone size-full wp-image-5695" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/blog2.jpg" /></a>

&nbsp;
<ul>
 	<li>Wait for deployment to succeed and then click on Application Settings for the new Webapp.</li>
 	<li>Add a new setting with <strong>App Setting Name</strong> "WEBSITE_NODE_DEFAULT_VERSION" and <strong>Value</strong> "8.9.4" and click Save. If you would like to use a different version of node, please refer to the section "<em><strong>How to find available node.js versions for Windows Webapps</strong></em>" below.</li>
</ul>
<a href="https://msdnshared.blob.core.windows.net/media/2018/09/blog3.jpg"><img width="879" height="512" class="alignnone size-large wp-image-5705" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/blog3-1024x596.jpg" /></a>
<ul>
 	<li>You can now start developing your node.js application in Azure Environment.</li>
</ul>
<h2>How to find available node.js versions for Windows Webapps.</h2>
For nodejs release schedule, please refer to

<a href="https://github.com/nodejs/Release">https://github.com/nodejs/Release</a>

To find current nodejs versions available in Azure Windows WebApps, navigate to this link:

<a href="https://%3cwebappname%3e.scm.azurewebsites.net/api/diagnostics/runtime">https://&lt;yourwebappname&gt;.scm.azurewebsites.net/api/diagnostics/runtime</a>

You can only use the versions available in this list.

New versions are added regularly, so please check for newer versions using the <em>/api/diagnostics/runtime</em> url above.

<a href="https://msdnshared.blob.core.windows.net/media/2018/09/blog4.jpg"><img width="246" height="300" class="alignnone size-medium wp-image-5715" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/blog4-246x300.jpg" /></a>
<h2>Common Error that indicates the node.js version is missing or incorrect.</h2>
If your application is getting the following error, please check whether <span style="float: none;background-color: transparent;color: #333333;cursor: text;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size: 16px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;text-align: left;text-decoration: none;text-indent: 0px">WEBSITE_NODE_DEFAULT_VERSION</span> is set to a valid value.
<pre>Application has thrown an uncaught exception and is terminated:
SyntaxError: Unexpected token {
<span>at Module._compile (module.js:</span><span>434</span><span>:</span><span>25</span><span>)</span>
<span>at Object..js (module.js:</span><span>464</span><span>:</span><span>10</span><span>)</span>
<span>at Module.load (module.js:</span><span>353</span><span>:</span><span>31</span><span>)</span>
<span>at Function._load (module.js:</span><span>311</span><span>:</span><span>12</span><span>)</span>
<span>at Module.require (module.js:</span><span>359</span><span>:</span><span>17</span><span>)</span>
<span>at require (module.js:</span><span>375</span><span>:</span><span>17</span><span>)</span>
<span>at Object.&lt;anonymous&gt; (D:\Program Files (x86)\iisnode\interceptor.js:</span><span>459</span><span>:</span><span>1</span><span>)</span>
<span>at Module._compile (module.js:</span><span>446</span><span>:</span><span>26</span><span>)</span>
<span>at Object..js (module.js:</span><span>464</span><span>:</span><span>10</span><span>)</span>
<span>at Module.load (module.js:</span><span>353</span><span>:</span><span>31</span><span>)</span></pre>]]></content:encoded>
    </item>
    <item>
      <title>Configuring node.js application on Azure App Service with Azure Blob Storage</title>
      <link>https://docs.microsoft.com/archive/blogs/azureossds/configuring-node-js-application-on-azure-app-service-with-azure-blob-storage</link>
      <pubDate>Thu, 30 Aug 2018 05:39:51 GMT</pubDate>
      <dc:creator><![CDATA[Kruthi Villivalam]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/azureossds/?p=5625</guid>
      <description><![CDATA[In this article, we will learn about configuring the node js applications deployed on Azure App...]]></description>
      <content:encoded><![CDATA[<p><br><p>In this article, we will learn about configuring the node js applications deployed on Azure App Services with the <b>Azure blob storage</b>.<p>If you would like to store the application logs in a blob storage on azure for the node.js applications, you would need to follow the steps below. It basically includes 2 main steps:<ol><li><b><i>Enabling from Portal</i></b><li><b><i>Configuring from the code</i></b></li></ol><p><b><font size="3">Enabling from Portal</font></b><p>· Navigate to your webapp from the azure portal<p>· Choose the Diagnostic Logs blade. For application level logging, choose <b>Blob storage </b>as shown below<b>. </b>If you would like to choose file system, please check out the blog post <a href="https://blogs.msdn.microsoft.com/azureossds/2018/08/03/debugging-node-js-apps-on-azure-app-services/">here</a><p><a href="https://msdnshared.blob.core.windows.net/media/2018/08/clip_image00210.jpg"><img width="460" height="344" title="clip_image002" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/2018/08/clip_image002_thumb8.jpg" border="0"></a><p><b><font size="3">Configuring from the code</font></b><p><b></b><ul><li>In your application, install the packages <strong><font size="2">winston &amp; winston-azure-blob-transport</font></strong> by the running the commands below<b></b></li></ul><p><b></b><blockquote><p><b>npm install winston</b></p></blockquote><blockquote><p><b>npm install winston-azure-blob-transport</b></p></blockquote><p><b></b><ul><li>Now, use the code below in order to configure them from the application<b></b></li></ul><p><b></b><table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td width="623" valign="top"><table border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top"><p><font face="Consolas" size="2">var winston = require("winston");</font><p><font face="Consolas" size="2">require("winston-azure-blob-transport");</font><p><font face="Consolas" size="2">var logger = new (winston.Logger)({</font><p><font face="Consolas" size="2">&nbsp;&nbsp;&nbsp; transports: [</font><p><font face="Consolas" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new (winston.transports.AzureBlob)({</font><p><font face="Consolas" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; account: {</font><p><font face="Consolas" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name: process.env.ACCOUNT_NAME,</font><p><font face="Consolas" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; key: process.env.ACCOUNT_KEY</font><p><font face="Consolas" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },</font><p><font face="Consolas" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; containerName: process.env.CONTAINER_NAME,</font><p><font face="Consolas" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; blobName: "<b>test.log</b>",</font><p><font face="Consolas" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; level: "info"</font><p><font face="Consolas" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; })</font><p><font face="Consolas" size="2">&nbsp;&nbsp;&nbsp; ]</font><p><font face="Consolas" size="2">&nbsp; });</font><p><b><font face="Consolas" size="2">logger.info("Hello!");</font></b></p></td>
</tr>
</tbody>
</table>
<p><br></p></td></tr></tbody></table><p><b></b><p><b></b><ul><li><b>test.log</b> in the above code snippet is the name of the blob where the logs get stored.<li>You would be able to get the <b>Account name</b>, <b>Account key</b> and the <b>container name</b> from the Azure storage account view<li>You would need to make use of <b>Storage Explorer</b> in order to check the log file as shown below.</li></ul><p><a href="https://msdnshared.blob.core.windows.net/media/2018/08/clip_image0041.gif"><img width="505" height="148" title="clip_image004" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/2018/08/clip_image004_thumb1.gif" border="0"></a>]]></content:encoded>
    </item>
    <item>
      <title>Debugging Node.js applications on Azure App Services Linux/containers</title>
      <link>https://docs.microsoft.com/archive/blogs/azureossds/debugging-node-js-applications-on-azure-app-services-linux-containers</link>
      <pubDate>Thu, 30 Aug 2018 03:50:42 GMT</pubDate>
      <dc:creator><![CDATA[Kruthi Villivalam]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/azureossds/?p=5405</guid>
      <description><![CDATA[&nbsp;

This is the continuation of the earlier post where I had explained how to enable logging...]]></description>
      <content:encoded><![CDATA[&nbsp;

This is the continuation of the earlier post where I had explained how to enable logging for node applications on <a href="https://blogs.msdn.microsoft.com/azureossds/2018/08/03/debugging-node-js-apps-on-azure-app-services/">App Service Windows</a>.  In this blog, you will learn how to debug the node.js applications that are hosted on Azure App Service Linux / Azure webapp for containers.

Enabling logs on linux offerings of AppService is fairly easier and pretty straight forward when compared to Windows.

<b><span style="font-size: medium">Enable Logging on Linux</span></b>

<b></b>
<ul>
 	<li>Navigate to your webapp from the azure portal</li>
</ul>
<ul>
 	<li>Choose the Diagnostic Logs blade. Here we have only one option to enable logs which is docker container logs unlike in Windows, where we have the storage option as well. As of today, we do not have the option of storing the logs to blob storage in App Service Linux.</li>
 	<li>Choose File System, specify the retention period of your choice. This will delete the logs that are older than specified number of days</li>
</ul>
<b></b>

<a href="https://msdnshared.blob.core.windows.net/media/2018/08/clip_image0013.jpg"><img width="597" height="340" title="clip_image001" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/2018/08/clip_image001_thumb3.jpg" border="0" /></a><b></b>

<b></b>
<ul>
 	<li>This will gather all the <b>STDOUT</b> and <b>STDERR</b> logs of the container into <b>/home/LogFiles</b> folder</li>
 	<li>Once you have configured using above step, you will be able to access these log files by following the steps below</li>
</ul>
<ol>
 	<li>  Go to your file system by browsing <a href="https://%7bwebapp_name%7d.scm.azurewebsites.net">https://{webapp_name}.scm.azurewebsites.net</a> url (called as kudu site)</li>
 	<li>  Click on <b>Debug Console –&gt;</b><b> Bash</b>. If it is app service Linux, you can alternatively choose <b>SSH</b> option</li>
 	<li>  Please note that <b>SSH</b> works only for App Service Linux. But for Webapp Containers, you would need to configure it by following the official documentation <a href="https://docs.microsoft.com/en-us/azure/app-service/containers/app-service-linux-ssh-support">here</a></li>
 	<li>  Navigate to the <b>LogFiles</b> folder by running the command “<b>cd LogFiles</b>”</li>
 	<li>  Now run the command “<b>ls -lrt</b>” to list all the log files with the latest one in the bottom. The <b>stderr</b> and <b>stdout</b> logs are stored in the file that ends with <b>default_docker.log</b> as shown below</li>
</ol>
<a href="https://msdnshared.blob.core.windows.net/media/2018/08/clip_image0029.jpg"><img width="651" height="320" title="clip_image002" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/2018/08/clip_image002_thumb7.jpg" border="0" /></a>
<ul>
 	<li>You can view this by running the command <b>cat &lt;filename&gt;</b>. If your application has any <b>stdout/stderr</b> configured, it will be seen in this log file.</li>
</ul>
<a href="https://msdnshared.blob.core.windows.net/media/2018/08/clip_image0034.jpg"><img width="664" height="347" title="clip_image003" alt="clip_image003" src="https://msdnshared.blob.core.windows.net/media/2018/08/clip_image003_thumb4.jpg" border="0" /></a>
<ul>
 	<li>You can also download it using <b>FTP</b> and steps to follow are specified <a href="https://blogs.msdn.microsoft.com/kaushal/2014/08/01/microsoft-azure-web-site-connect-to-your-site-via-ftp-and-uploaddownload-files/">here</a></li>
 	<li>If you are only looking for the <b><i>latest docker logs</i></b>, the quickest way is to go to Kudu console and click on <b>Current Docker Logs</b> option as shown below. However, this will only give the information related to the container, but not the <b>stdout/stderr</b> logs.</li>
</ul>
<a href="https://msdnshared.blob.core.windows.net/media/2018/08/clip_image00410.jpg"><img width="544" height="358" title="clip_image004" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/2018/08/clip_image004_thumb10.jpg" border="0" /></a>
<ul>
 	<li>Once you click on this link, you will be redirected to a new page with all the details related to the latest docker logs</li>
</ul>
<a href="https://msdnshared.blob.core.windows.net/media/2018/08/clip_image0052.jpg"><img width="752" height="92" title="clip_image005" alt="clip_image005" src="https://msdnshared.blob.core.windows.net/media/2018/08/clip_image005_thumb2.jpg" border="0" class="" /></a>
<ul>
 	<li>Now, copy paste the link that is highlighted into the new tab and you should see the output as below</li>
</ul>
<a href="https://msdnshared.blob.core.windows.net/media/2018/08/clip_image0068.jpg"><img width="681" height="182" title="clip_image006" alt="clip_image006" src="https://msdnshared.blob.core.windows.net/media/2018/08/clip_image006_thumb7.jpg" border="0" class="" /></a>]]></content:encoded>
    </item>
  </channel>
</rss>