<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Jessica Deen on Technet</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/jessicadeen/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/jessicadeen/feed.xml</link>
    <description />
    <lastBuildDate>Fri, 12 Jan 2018 01:18:13 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Fixed! az.completion:10: command not found: complete</title>
      <link>https://docs.microsoft.com/archive/blogs/jessicadeen/fixed-az-completion10-command-not-found-complete</link>
      <pubDate>Thu, 11 Jan 2018 17:18:08 GMT</pubDate>
      <dc:creator><![CDATA[Jessica Deen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jessicadeen/?p=2665</guid>
      <description><![CDATA[I was hanging out with a colleague earlier today (name drop: Burke Holland) and he roped me into...]]></description>
      <content:encoded><![CDATA[I was hanging out with a colleague earlier today (name drop: Burke Holland) and he roped me into fixing his terminal. He had the awful "az.completion:10: command not found: complete" error stuck in his zsh environment for around 8 months and I thought, "He can't be the only one!" Enter: this blog post!

If you're like Burke, simply open your .zshrc file and add the following line before sourcing az.completion:
<pre class="lang:default decode:true ">autoload bashcompinit &amp;&amp; bashcompinit</pre>
To confirm, your az.completion section should now look like this:
<pre class="lang:default decode:true ">autoload bashcompinit &amp;&amp; bashcompinit
source '/Users/jessicadeen/lib/azure-cli/az.completion'</pre>
That's it! This is a known open issue on GitHub and is caused by using the curl method to install Az CLI when your default shell is set to zsh rather than bash.

Hope this helps!]]></content:encoded>
    </item>
    <item>
      <title>PowerShell Core and AzureRM.NetCore.Preview Module Install Scripts for Ubuntu and OS X</title>
      <link>https://docs.microsoft.com/archive/blogs/jessicadeen/powershell-core-and-azurerm-netcore-preview-module-install-scripts-for-ubuntu-and-os-x</link>
      <pubDate>Thu, 14 Dec 2017 10:46:50 GMT</pubDate>
      <dc:creator><![CDATA[Jessica Deen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jessicadeen/?p=1435</guid>
      <description><![CDATA[Note: This post is now old. Please use my latest installer from this blog post. 

Quick update...]]></description>
      <content:encoded><![CDATA[<img class="aligncenter size-medium wp-image-2416" src="http://jessicadeen.com/wp-content/uploads/2016/11/basic-powershell-commands-intro-840x420-300x150.png" alt="" width="300" height="150" />

<strong>Note: This post is now old. Please use <a href="http://jessicadeen.com/linux/powershell-core-master/">my latest installer from this blog post</a>. </strong>

Quick update today - I wrote a few new install scripts for PowerShell Core with the AzureRM.NetCore.Preview module and optional install of Azure CLI. You can access the scripts using the below links. Each script will install:
<ul>
 	<li>NET Core 1.1 (<a href="https://blogs.msdn.microsoft.com/dotnet/2016/11/16/announcing-net-core-1-1/" target="_blank" rel="noopener">Released today!</a>)</li>
 	<li>PowerShell Core Alpha 11</li>
 	<li>AzureRM.NetCore.Preview Module</li>
 	<li>Optional install of Azure CLI</li>
</ul>
<a href="https://raw.githubusercontent.com/jldeen/SVCC-AzureMgmtxplat/master/install/14.04/ps6.11_14.04_install.sh" target="_blank" rel="noopener">Linux Ubuntu 14.04</a>
<a href="https://raw.githubusercontent.com/jldeen/SVCC-AzureMgmtxplat/master/install/16.04/ps6.11_16.04_install.sh" target="_blank" rel="noopener">Linux Ubuntu 16.04</a>
<a href="https://raw.githubusercontent.com/jldeen/SVCC-AzureMgmtxplat/master/install/osx_10.11/ps6.11_osx_install.sh" target="_blank" rel="noopener">Mac OS X 10.11 and 10.12</a>

Note: As of the date of this writing (11/16/2016), it is recommended to use PowerShell Core alpha 11 because <a href="https://github.com/PowerShell/PowerShell/issues/2664" target="_blank" rel="noopener">PackageManagement is currently broken in alpha 12</a>; this is because <a href="https://github.com/OneGet/oneget/issues/239" target="_blank" rel="noopener">OneGet is broken</a>. I will update this post and the install scripts once the issue has been resolved.]]></content:encoded>
    </item>
    <item>
      <title>Badass Terminal: FCU WSL Edition (oh-my-zsh, powerlevel9k, tmux, and more!)</title>
      <link>https://docs.microsoft.com/archive/blogs/jessicadeen/badass-terminal-fcu-wsl-edition-oh-my-zsh-powerlevel9k-tmux-and-more</link>
      <pubDate>Wed, 08 Nov 2017 14:59:23 GMT</pubDate>
      <dc:creator><![CDATA[Jessica Deen]]></dc:creator>
      <guid
        isPermaLink="false">http://blogs.technet.microsoft.com/jessicadeen/?p=2626</guid>
      <description><![CDATA[It's that time again! The time to write another epic blog post, this time for WSL, also known as...]]></description>
      <content:encoded><![CDATA[It's that time again! The time to write another epic blog post, this time for WSL, also known as Windows Subsystem for Linux. One of my most popular posts is my badass terminal post for iTerm2/MacOS so I thought it was only fitting to try and recreate the same environment for WSL. The Windows 10 Fall Creator's Update (FCU) introduces a <a target="_blank" href="https://blogs.msdn.microsoft.com/commandline/2017/10/11/whats-new-in-wsl-in-windows-10-fall-creators-update/" rel="noopener">few new features to WSL</a>. Below are the key ones:
<ul>
 	<li>WSL is no longer a Beta feature</li>
 	<li>Install Linux distros via the Windows Store</li>
 	<li>WSL now runs multiple Linux distros</li>
 	<li>WSL no longer requires developer mode</li>
 	<li>WSL comes to Windows Server &amp; Microsoft Azure VM's!</li>
 	<li>WSL now supports USB/serial comms</li>
 	<li>Miscellaneous fixes and improvements</li>
 	<li>Deprecating the name "Bash on Windows"</li>
</ul>
Prior to the release, I had already planned on creating an automated install script for Linux / WSL to customize the terminal. With the new WSL release now available via the Windows Store, I'm even more excited for my script / this post. Key changes in WSL as part of the FCU now allows commands like "chsh" to work, which means we can use our favorite shell (zsh, fish, etc.) directly.

A few key points before we dive into the #badass customizations:
<ul>
 	<li>lxrun.exe is deprecated and is now considered legacy
<ul>
 	<li>This means your LXSS data no longer lives in <code>%USERPROFILE%\appdata\local\lxss</code>
<ul>
 	<li>Your data now lives in <code>%USERPROFILE%\appdata\local\Packages\CanonicalGroupLimited.UbuntuonWindows_[random-numbers-and-characters]\LocalState\rootfs\home</code></li>
</ul>
</li>
 	<li>This also means you no longer run <code>lxrun.exe /uninstall /full /y</code> to remove your WSL instance (when installed from the Windows Store). Instead, you would uninstall Ubuntu (WSL) the same way you would any other app - find the app in your start menu, right click, uninstall. Easy peasy.</li>
</ul>
</li>
</ul>
<strong>The Setup</strong>

Everything shown here is available on my Github in the <a target="_blank" href="https://github.com/jldeen/dotfiles/tree/wsl" rel="noopener">WSL branch of my dotfiles repo</a>. To start the configuration, including copying the current dotfiles I use, you would simply type the following from your WSL Ubuntu Console.
<pre class="lang:default decode:true">bash -c "$(curl -fsSL https://raw.githubusercontent.com/jldeen/dotfiles/wsl/configure.sh)"
</pre>
<strong>What will this install?</strong>
<ul>
 	<li>Update package lists</li>
 	<li>zsh</li>
 	<li>git completion</li>
 	<li>oh-my-zsh
<ul>
 	<li>zsh-completions plugin</li>
 	<li>zsh-autosuggestions plugin</li>
 	<li>zsh-syntax-highlighting plugin</li>
</ul>
</li>
 	<li>powerlevel9k</li>
 	<li>vimrc undle</li>
 	<li>pathogen</li>
 	<li>nerdtree</li>
 	<li>wombat vim colorsheme</li>
 	<li>midnight commander</li>
 	<li>bashrc colorscheme - solarized dark</li>
 	<li>optional: my dotfiles</li>
 	<li>optional: az cli 2.0</li>
 	<li>optional: change default shell to zsh</li>
</ul>
<strong>A few notes:</strong>
<ul>
 	<li>A clean install from this configuration.sh script (not using my dotfiles) looks like this. (See pic below)
<img class="aligncenter wp-image-2741 size-large" src="http://jessicadeen.com/wp-content/uploads/2017/10/no-presets-1024x662.png" alt="" width="1024" height="662" /></li>
 	<li><strong>you will need to enter your password during the oh-my-zsh install</strong>. You will also need to type "exit" after it completes so the remaining parts of the configuration.sh script can continue to install. (See pic below)
<img class="aligncenter wp-image-2740 size-large" src="http://jessicadeen.com/wp-content/uploads/2017/10/oh-my-zsh-1024x565.png" alt="" width="1024" height="565" /></li>
 	<li>You will be prompted if you want to use my dotfiles. If you hit yes, this will create symlinks to your the usual dotfiles and use the .dotfiles from my repo. To learn more, check out <a target="_blank" href="http://zachholman.com/2010/08/dotfiles-are-meant-to-be-forked/" rel="noopener">Zach Holman's blog post</a>, as I forked his repo and modified it accordingly. Side note: I started keeping a record of my dotfiles awhile back when I read <a target="_blank" href="https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/" rel="noopener">this blog post</a> from <a href="https://developer.atlassian.com/blog/authors/npaolucci">Nicola Paolucci</a>. This allowed me to duplicate my environment seamlessly as I moved from system to system. Zach's project is one Nicola moved to and I adapted as well. If you choose to use my dotfiles and the <a target="_blank" href="https://github.com/goreliu/wsl-terminal" rel="noopener">WSL Terminal Emulator</a> I suggest below, your terminal will look like this. (See pic below)
<img class="aligncenter size-large wp-image-2764" src="http://jessicadeen.com/wp-content/uploads/2017/10/presets-1-1024x652.png" alt="" width="1024" height="652" /></li>
</ul>
Now, my .tmux.conf file runs .sh scripts for the status bar. As of now, those scripts don't play nicely with Ubuntu WSL so I use a <a target="_blank" href="https://github.com/goreliu/wsl-terminal" rel="noopener">WSL Terminal Emulator</a>. Fear not, I wrote you an install script to get that going, too. From an <strong><span>Administrator</span></strong> PowerShell prompt, run the following:
<pre class="lang:default decode:true">Set-ExecutionPolicy Bypass; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/jldeen/dotfiles/wsl/wslterm.ps1'))</pre>
This will set up your <a target="_blank" href="https://github.com/goreliu/wsl-terminal" rel="noopener">WSL Terminal Emulator</a> and add a shortcut named "bash" to your desktop. I don't know why I named it 'bash' as I've been using ZSH for quite some time now, but alas, that's the name. Update the shortcut name if you wish.

<strong>Fonts and Themes:</strong>

You will need to install a font to use some of the Unicode characters I have in my configuration. Both WSL Terminal Emulator and Ubuntu WSL support mono fonts so you can choose whichever patched mono font you want. I recommend picking one from <a target="_blank" href="https://github.com/ryanoasis/nerd-fonts" rel="noopener">Nerd Fonts</a>. The one I'm using is <a target="_blank" href="https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/UbuntuMono/Regular/complete/Ubuntu%20Mono%20Nerd%20Font%20Complete%20Mono%20Windows%20Compatible.ttf" rel="noopener">Ubuntu Mono Regular for Windows</a>. It is also in my repo. You will also need to select a theme for the WSL Emulator. I am using <code>base16-solarized-dark.minttyrc</code>.

From there, you will need to ensure you select that font in your Ubuntu or WSL Terminal: Right-click on the title bar at top &gt; Properties &gt; Font (or Text). Similarly, you will do the same for Themes in WSL Emulator (Right-click on the title bar at top &gt; Options &gt; Select Theme (under Looks).

<img class="aligncenter wp-image-2757 size-large" src="http://jessicadeen.com/wp-content/uploads/2017/10/wsl-term-opt-1024x248.png" alt="" width="1024" height="248" /> <img class="aligncenter wp-image-2758 size-large" src="http://jessicadeen.com/wp-content/uploads/2017/10/wsl-ubun-opt-1024x527.png" alt="" width="1024" height="527" />

For quick visual reference, see my MacOS and WSL Terminal Emulated environments next to each other below.

<img class="aligncenter size-large wp-image-2766" src="http://jessicadeen.com/wp-content/uploads/2017/10/nerdtree-1024x650.png" alt="" width="1024" height="650" /> <img class="aligncenter wp-image-2693 size-large" src="http://jessicadeen.com/wp-content/uploads/2017/09/Screen-Shot-2017-09-19-at-17.02.51-1024x640.png" alt="" width="1024" height="640" />

Overall, I'm thrilled with the improvements WSL has made in the FCU. We are so much further ahead now than we were 18 months ago. I am able to nearly replicate my MacOS terminal entirely on my Window systems, which only allows for more productivity in development and operations... or DevOps!]]></content:encoded>
    </item>
    <item>
      <title>Automate Deployment to Docker Swarm and Kubernetes on Azure using Codefresh</title>
      <link>https://docs.microsoft.com/archive/blogs/jessicadeen/automate-deployment-to-docker-swarm-and-kubernetes-on-azure-using-codefresh</link>
      <pubDate>Thu, 12 Oct 2017 18:02:16 GMT</pubDate>
      <dc:creator><![CDATA[Jessica Deen]]></dc:creator>
      <guid
        isPermaLink="false">http://blogs.technet.microsoft.com/jessicadeen/?p=2615</guid>
      <description><![CDATA[I'm so excited to write this blog post so without further ado, let's jump right in: Codefresh and...]]></description>
      <content:encoded><![CDATA[I'm so excited to write this blog post so without further ado, let's jump right in: Codefresh and Microsoft.

Codefresh is a Docker-native CI/CD platform that allows you to instantly build, test, and deploy Docker images to both Swarm and Kubernetes clusters. Through its unique platform, Codefresh offers continuous unit, integration, and UI testing, as well as effortless and streamlined deployment to any cloud provider.

Today's post is going to walk through a few ways you can use Codefresh in conjunction with Docker Swarm, Docker Swarm Mode, and Kubernetes on Microsoft Azure. This past summer, I had the honor and privilege of working with Codefresh to bring support for Azure to their offering. Throughout the collaboration, I learned so much more about Azure and how our systems work, so I want to cover a few key details prior to jumping into the "how-to" deploy with Codefresh part.

First, there are three ways you can run a Docker Swarm cluster on Microsoft Azure:
<ol>
 	<li><a target="_blank" href="https://docs.microsoft.com/en-us/azure/container-service/dcos-swarm/container-service-swarm-walkthrough" rel="noopener noreferrer">Docker Swarm via Azure Container Service</a></li>
 	<li><a target="_blank" href="https://github.com/Azure/azure-quickstart-templates/tree/master/101-acsengine-swarmmode" rel="noopener noreferrer">Docker Swarm Mode via ACS Engine GitHub QuickStart 101 Template</a></li>
 	<li><a target="_blank" href="https://docs.microsoft.com/en-us/azure/container-service/dcos-swarm/container-service-swarm-mode-walkthrough" rel="noopener noreferrer">DockerCE (Preview) via Azure Container Service (requires AZ CLI 2.0)</a></li>
</ol>
The first way, which is the currently available production method as of the date of this post, is legacy Docker Swarm (pre version 1.12), which means Swarm Mode isn't supported, and therefore 'docker stack deploy' does not work. You can, however, do normal docker commands like:
<pre class=""><code>docker run -d --name ${{CONTAINER_NAME}} -p 80:80 ${{IMAGE_NAME}}</code></pre>
If you do have a Docker Swarm Mode cluster you deployed through either the GitHub QuickStart 101 ACS Engine Template or DockerCE (Preview), Swarm Mode is supported and you can do things like 'docker stack deploy'.

Luckily, Codefresh has made connecting to and deploying in all three scenarios really easy for us by creating an image we can use in our pipeline so we don't have to make our own, nor do we have to write any code to handle the <a target="_blank" href="http://jessicadeen.com/tech/azure-container-service-how-to-create-an-ssh-tunnel/" rel="noopener noreferrer">SSH tunnel</a> to our Swarm clusters. All we have to do is specify the 'ncodefresh/remote-docker:azure' image in our codefresh.yml files and then specify the necessary environment variables. I have the documentation written for both scenarios below:

<a target="_blank" href="https://github.com/jldeen/codefresh/blob/master/Swarm.md" rel="noopener noreferrer">Legacy Docker Swarm (Pre version 1.12)</a>
<a target="_blank" href="https://github.com/jldeen/codefresh/blob/master/Swarm-mode.md" rel="noopener noreferrer">Docker Swarm Mode (Version 1.12+)</a>
<h4>Swarm</h4>
For Legacy Swarm (Pre 1.12), your deployment scenario would look similar to this:

<img class="aligncenter wp-image-2703 size-full" src="http://jessicadeen.com/wp-content/uploads/2017/09/Screen-Shot-2017-09-29-at-17.34.55.png" alt="" width="986" height="833" />

I also created a demo 'codefreshswarm' repo with a generic codefresh.yml file you can use <a target="_blank" href="https://github.com/jldeen/codefreshswarm/blob/master/codefresh.yml" rel="noopener noreferrer">here</a>.
<h4>Swarm Mode</h4>
Your Codefresh Swarm Mode deployment would look similar, only you will specify a STACK_NAME instead of a CONTAINER_NAME, or IMAGE_NAME. <strong>(This assumes you are doing a '<em>docker stack deploy'</em> as opposed to just running a single image in a single container.)</strong>
<pre class="lang:default decode:true">docker stack deploy --compose-file docker-stack.yml ${{STACK_NAME}}</pre>
<img class="wp-image-2726 alignnone" src="http://jessicadeen.com/wp-content/uploads/2017/10/Screen-Shot-2017-10-06-at-22.16.23-1024x751.png" alt="" width="500" height="367" />

A demo codefresh.yml file for a swarm mode deployment can be found <a target="_blank" href="https://github.com/jldeen/cfswarmmode" rel="noopener noreferrer">here</a>.

Now, one thing I want to reiterate is how you <span>do not</span> have to create an ssh tunnel to connect to your Docker Swarm Cluster on Azure like you do with other CI/CD tools I've written about. Codefresh has taken the challenging parts and automated them for you so all you have to do is fill in the blanks. Throughout this process, as I learned more about the intricacies of Azure, I also learned how scalable Codefresh is and yet simultaneously simple, powerful and robust.

Finally, my favorite part of CI/CD with Codefresh is their new, currently in Beta, Kubernetes integration. This stuff is really cool and the best part is it works with Kubernetes on Azure, too!

To document how deployment to Kubernetes in Azure with Codefresh works, I actually recorded a short video.

https://www.youtube.com/watch?v=zuH9BkGh4nQ]]></content:encoded>
    </item>
    <item>
      <title>Tmux 2.6 copy/paste and bind tips and tricks!</title>
      <link>https://docs.microsoft.com/archive/blogs/jessicadeen/tmux-2-6-copypaste-and-bind-tips-and-tricks</link>
      <pubDate>Wed, 20 Sep 2017 08:46:54 GMT</pubDate>
      <dc:creator><![CDATA[Jessica Deen]]></dc:creator>
      <guid
        isPermaLink="false">http://blogs.technet.microsoft.com/jessicadeen/?p=2605</guid>
      <description><![CDATA[I recently updated my tmux install to the latest version 2.6-rc3. I hadn't updated since prior to...]]></description>
      <content:encoded><![CDATA[I recently updated my tmux install to the latest version 2.6-rc3. I hadn't updated since prior to April. When I did update, my former .tmux.conf I mentioned in my <a target="_blank" href="http://jessicadeen.com/tech/macos-ohmyzsh-tmux-vim-iterm2-powerlevel9k-badass-terminal/" rel="noopener noreferrer">macOS ohmyzsh + tmux + vim + iTerm2 + Powerlevel9k = Badass terminal</a> blog post had several errors due to breaking changes. This post will address the ones that took me a little while to solve.

The simple explanation of what broke is copy/paste from within tmux and most bind-key commands.

In short, I learned key tables changed dramatically from version 2.3 to version 2.4. As quoted in <a target="_blank" href="https://raw.githubusercontent.com/tmux/tmux/master/CHANGES" rel="noopener noreferrer">tmux's changes.md</a>:
<pre class="lang:default decode:true">Mode key tables are no longer separate from the main key tables. All mode key tables have been removed,
together with the -t flag to bind-key and unbind-key.

The emacs-edit, vi-edit, emacs-choose and vi-choose tables have been replaced
by fixed key bindings in the command prompt and choose modes. The mode-keys
and status-keys options remain.

The emacs-copy and vi-copy tables have been replaced by the copy-mode and
copy-mode-vi tables. Commands are sent using the -X and -N flags to
send-keys. So the following:

bind -temacs-copy C-Up scroll-up
bind -temacs-copy -R5 WheelUpPane scroll-up

Becomes:

<strong>bind -Tcopy-mode C-Up send -X scroll-up
bind -Tcopy-mode WheelUpPane send -N5 -X scroll-up</strong></pre>
There are also new commands with send -X now such as copy-pipe-and-cancel, which we will use shortly. As a result, I couldn't copy and paste anymore from either a mouse drag or using keys. I updated my file to the following configuration:
<pre class="lang:default decode:true "># Mouse support ------------------------------------------------
set -g mouse on

bind-key -T copy-mode-vi WheelUpPane send -X scroll-up
bind-key -T copy-mode-vi WheelDownPane send -X scroll-down

# # Vi copypaste
setw -g mode-keys vi
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" \; display-message "highlighted selection copied to system clipboard"

# End Mouse support --------------------------------------------</pre>
As you'll see, I am now using the new "copy-pipe-and-cancel" command, I am specifying MouseDragEnd1Pane, and I even include a confirmation message to confirm a successful copy to the clipboard.

I hope this saves someone time as it took me several hours of searching to discover the solution to fix the broken copy paste function. On the same topic of broken configurations, I also learned my scroll ability was broken from within vim (and probably other parts of my terminal). I could scroll down, but not up; when I would attempt, I could get command history, not the actual buffer window scroll. First, I discovered I could temporarily fix this by holding shift as I scroll, but that was not a long-term solution. At last, I discovered from <a target="_blank" href="https://github.com/bpython/bpython/issues/517" rel="noopener noreferrer">this GitHub issue thread</a> I could press 'Command+r' to reset the terminal state, which fixed the problem.

For those interested, you can view my .vimrc, .zshrc, and .tmux.conf files <a target="_blank" href="https://github.com/jldeen/bad-ass-terminal" rel="noopener noreferrer">here</a>.]]></content:encoded>
    </item>
    <item>
      <title>Azure ARM Templates - How to embed full scripts in your JSON templates!</title>
      <link>https://docs.microsoft.com/archive/blogs/jessicadeen/azure-arm-templates-how-to-embed-full-scripts-in-your-json-templates</link>
      <pubDate>Tue, 05 Sep 2017 12:19:37 GMT</pubDate>
      <dc:creator><![CDATA[Jessica Deen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jessicadeen/?p=2545</guid>
      <description><![CDATA[Earlier today a colleague and I discovered a pretty neat trick when dissecting a broken ARM...]]></description>
      <content:encoded><![CDATA[Earlier today a colleague and I discovered a pretty neat trick when dissecting a broken ARM template; we learned you can encode complete scripts and embed them in your templates. This post will explain how to do so. First, some assumptions:
<ul>
 	<li>You have a Linux/Unix based machine available (terminal on Mac works fine, as does Bash on Windows 10)</li>
 	<li>You are familiar with JSON and ARM templates</li>
 	<li>You are familiar with shell scripts on some level</li>
</ul>
Using base64 and gzip you can encode and decode strings, which can then be used in your templates. Here's an example:
<pre class="lang:default decode:true ">H4sIAIY0qlkAAyvJyCxWAKJEhZLU4hIuABITBXIPAAAA</pre>
The above output says, "This is a test" without any quotations. To get that output, from your terminal, you would type:
<pre class="lang:default decode:true">echo 'this is a test' | gzip | base64</pre>
The above command takes your string, uses gzip to compress it, and base64 to binarily encode it. The output you receive should be similar to the one above. To decode you would type a similar command, but in reverse:
<pre class="lang:default decode:true ">echo 'H4sIAIY0qlkAAyvJyCxWAKJEhZLU4hIuABITBXIPAAAA' | base64 -D | gunzip</pre>
Like the encoding command, you're taking your binary base64 string, decoding it, and decompressing the output using gunzip. Note the '-D' switch in your base64 - that tells base64 to decrypt your string from binary data in ASCII string format to standard output.

Let's say you have a file you want to compress and encoding. To do so, you would cat the file, pipe the output to gzip to compress, and another pipe to base64 to encoding. Here are two examples:
<pre class="lang:default decode:true">cat test.sh | gzip | base64</pre>
or
<pre class="lang:default decode:true">a=$(cat test.sh)

echo $a | gzip | base64</pre>
Now, the next question is, "How do I use that string in my ARM template?"  The answer is you take the output provided and use that in your custom data section. Be sure to use the '\n' (no quotes) to specify the new line character after the end of the output string. Here's an example:
<pre class="lang:default decode:true">"customData": "[base64(concat('#cloud-config\n\nwrite_files:\n -  encoding: gzip\n    content: !!binary |\n        H4sIAIY0qlkAAyvJyCxWAKJEhZLU4hIuABITBXIPAAAA\n    path: /opt/azure/configure-test-template.sh\n    permissions: \"0744\"\n\n',variables('agentRunCmdFile'),variables('agentRunCmd')))]"</pre>
As you can see, the example specifies base64 binary content and tells us our data is encoded using gzip. After each section, we see the '\n' to specify a break in our custom data. When the template deploys, the encoded script/command used will be decrypted and decompressed on the fly, and then either copied to the location or executed accordingly. You will want to update your template file as necessary to reference the appropriate paths and variables of course, but the above gives you a general example.

To view a complete example, you can check out the JSON template I updated <a href="https://github.com/Azure/azure-quickstart-templates/blob/master/101-acsengine-swarmmode/azuredeploy.json" target="_blank" rel="noopener">here</a> - specifically lines 945 and 1181.]]></content:encoded>
    </item>
    <item>
      <title>Complete pipeline with Jenkins, ACS (Docker Swarm), and Azure Container Registry</title>
      <link>https://docs.microsoft.com/archive/blogs/jessicadeen/complete-pipeline-with-jenkins-acs-docker-swarm-and-azure-container-registry</link>
      <pubDate>Thu, 24 Aug 2017 09:28:05 GMT</pubDate>
      <dc:creator><![CDATA[Jessica Deen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jessicadeen/?p=2475</guid>
      <description><![CDATA[In this blog post, we will walk through a demonstration of a complete pipeline of a deployment to...]]></description>
      <content:encoded><![CDATA[In this blog post, we will walk through a demonstration of a complete pipeline of a deployment to Docker Swarm on Azure Container Service (ACS) using Jenkins (hosted on Azure) and Azure Container Registry (ACR).

You can grab the demo file used on my GitHub <a href="https://github.com/jldeen/jenkinsacr" target="_blank" rel="noopener">here</a>.

Pro tip! If you're using BitBucket and you have your access credentials I recommend storing said creds in your credentials store through the <a href="https://wiki.jenkins.io/display/JENKINS/Credentials+Plugin" target="_blank" rel="noopener">Credentials Plugin</a>. After you have stored your credentials, you can simply call them using the following code:
<pre class="lang:default decode:true">git branch: 'test', credentialsId: 'bb-login', url: 'https://bitbucket.org/[name-goes-here]/[sample].git'</pre>
If you have one stage for pulling code into your Jenkins build server, your full stage code would look like this:
<pre class="lang:default decode:true">// Mark the code checkout 'stage'....
        stage('Checkout From BitBucket') {
            git branch: 'develop', credentialsId: 'bb-login', url: 'https://bitbucket.org/[name-goes-here]/[sample].git'
        }</pre>
In the demo I have on GitHub, I've used a previous GitHub repo to keep this simple. Just as a sampling, my stage for pulling code from a <strong><span style="text-decoration: underline">public</span></strong> Git repo looks like this.
<pre class="lang:default decode:true ">stage('Checkout from GitHub') {
            git url: 'https://github.com/jldeen/swampup2017'
        }</pre>
The next and perhaps most important step we want to focus on is creating credentials for our Azure Container Registry.

Microsoft does have instructions on how to do this <a href="https://docs.microsoft.com/en-us/azure/container-registry/container-registry-authentication" target="_blank" rel="noopener">here</a>, but we will walk through it as well. Essentially we want to create an SPN (service principal), assign it to our registry, and use it for basic Docker authentication. For security reasons, I wouldn't recommend using the registry admin account in your Jenkinsfile. As I have blogged about in <a href="http://jessicadeen.com/tech/updated-non-interactive-authentication-to-microsoft-azure-w-azure-cli-2-0-now-ga/" target="_blank" rel="noopener">previous posts</a>, we can use an SPN creation script to handle this process for us. I have updated my previous script to streamline this process in conjunction with ACR. The <strong>NEW</strong> ACR SPN creation script can be found <a href="https://raw.githubusercontent.com/jldeen/jenkinsacr/master/create_acr_spn.sh" target="_blank" rel="noopener">here</a>. As always, please read any script thoroughly BEFORE running it on your local system.

After you run the script, create a new credentials entry in Jenkins with the output (username and password) the script provides.

We can now use our Docker pipeline plugin to access our newly defined registry with the credentials we just created. To do this we use the "<em>docker.withRegistry"</em>' variable. Our Jenkinsfile for ACR login with the new ACR SPN credentials will then look something like this:
<pre class="lang:default decode:true">docker.withRegistry('https://acrjdtest.azurecr.io', 'acr_credentials')</pre>
For a list of all Docker global variables, as well as brief descriptions, you can access the pipeline syntax from any pipeline job page and click "Global Variables Reference."

Now, we can start piecing these sections together. In short, we are going to have 4 stages for our pipeline:
<ol>
 	<li>Checkout code from public or private repo (GitHub / BitBucket in my demos)</li>
 	<li>Build and push to Azure Container Registry</li>
 	<li>SSH Tunnel to Azure Container Service Docker Swarm Cluster</li>
 	<li>ACS Docker pull (from ACR) and run</li>
</ol>
We have already gone through our first stage. Our second stage will be simple enough now that we have stored our ACR credentials.
<pre class="lang:default decode:true">// Build and Deploy to ACR 'stage'... 
        stage('Build and Push to Azure Container Registry') {
                app = docker.build('acrjdtest.azurecr.io/node-demo')
                docker.withRegistry('https://acrjdtest.azurecr.io', 'acr_credentials') {
                app.push("${env.BUILD_NUMBER}")
                app.push('latest')
                }
        }</pre>
As you can see, we create a variable entitled <em>"app"</em> for our image with the docker.build command and specify the name of our image. We set our credentials for ACR by using "<em>docker.withRegistry</em>" and follow up with app.push to push two versions of our image to our ACR;  one is tagged with the build number and the second is tagged as the latest version.

Our 3rd stage is our SSH tunnel to our ACS Docker Swarm cluster. I've <a href="http://jessicadeen.com/tech/azure-container-service-how-to-create-an-ssh-tunnel/" target="_blank" rel="noopener">blogged on this</a> before so I'm not going to deep dive into this section again.

Our 4th stage is pulling/running our newly built and previously pushed app from our private Docker repo in ACR.
<pre class="lang:default decode:true">// Pull, Run, and Test on ACS 'stage'... 
        stage('ACS Docker Pull and Run') {
           app = docker.image('acrjdtest.azurecr.io/node-demo:latest')
           docker.withRegistry('https://acrjdtest.azurecr.io', 'acr_credentials') {
           app.pull()
           app.run('--name node-demo -p 80:8000')</pre>
We define our image name again in our "<em>app</em>" variable and include the latest tag. We then login to ACR, again, using <em>"docker.</em>withRegistry<em>". </em>We need to do this again because this time we are logging into our ACR from our Docker Swarm cluster and not our Jenkins build server. Finally, we pull our image using app.pull() and run it in a detached container by using <em>"app.run('--name node-demo -p 80:8000')"</em>. In the parenthesis of <em>app.run</em> we add any additional args needed for our app. My node app uses port 8000, but you will want to update these ports to suit your environment.

That's it for today! Comment below with any tips or feedback! I'd love to hear from you.]]></content:encoded>
    </item>
    <item>
      <title>Outlook for Mac search returns "No Results," and task items are not displayed? Here's the fix!</title>
      <link>https://docs.microsoft.com/archive/blogs/jessicadeen/outlook-for-mac-search-returns-no-results-and-task-items-are-not-displayed-heres-the-fix</link>
      <pubDate>Tue, 22 Aug 2017 15:42:42 GMT</pubDate>
      <dc:creator><![CDATA[Jessica Deen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jessicadeen/?p=2456</guid>
      <description><![CDATA[This morning I went to search for an email in Outlook and received the dreaded "No results" message...]]></description>
      <content:encoded><![CDATA[This morning I went to search for an email in Outlook and received the dreaded "No results" message instead of search results. I also discovered my task items disappeared. I've had this issue before, but I couldn't remember how I solved it.

Bam! Here's a quick blog post if for no other reason than my own reference in the future. Microsoft does have a KB article <a href="https://support.microsoft.com/en-us/help/2741535/outlook-for-mac-search-returns-no-results--and-task-items-are-not-disp" target="_blank" rel="noopener">here</a>, but there isn't really a set of "fix the problem" steps provided. In short, we have to force a reindex of the Outlook 15 Profile folder - it's likely corrupt.

1. With Outlook closed, confirm you have the following folder:
<pre class="lang:default decode:true ">/Users/[user-goes-here]/Library/Group Containers/UBF8T346G9.Office/Outlook 15 Profiles</pre>
2. Open System Preferences, click on "Spotlight."

3. Click on the Privacy tab.

4. Click the "+" at the bottom and add the folder I mentioned above. (You can also simply drag that folder over into the list below. If the folder already exists in the list, remove it.

5. Close System Preferences, re-open System Preferences and click Spotlight again.

6. Click the Privacy tab, select the folder you added, and click the "-" to remove the folder.

7. Close System Preferences and wait about 10 minutes. Open Outlook and try to search. The spotlight reindex of your Outlook Profile folder should be finished and you should be able to search/view tasks again.]]></content:encoded>
    </item>
    <item>
      <title>Pro tip: Jenkins and Docker build server</title>
      <link>https://docs.microsoft.com/archive/blogs/jessicadeen/pro-tip-jenkins-and-docker-build-server</link>
      <pubDate>Fri, 18 Aug 2017 17:01:43 GMT</pubDate>
      <dc:creator><![CDATA[Jessica Deen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/jessicadeen/?p=2445</guid>
      <description><![CDATA[I'm currently sitting at a coffee shop with a Microsoft partner and we just spent the last hour...]]></description>
      <content:encoded><![CDATA[I'm currently sitting at a coffee shop with a Microsoft partner and we just spent the last hour banging our head against the table over the following error as part of our Jenkins pipeline project when running our docker.build command:
<pre class="lang:default decode:true">got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: xxxxx</pre>
We finally figured out the issue by looking at my own Jenkins build server history commands (shout out to 'history | grep usermod' FTW) and I had to stop and blog about the solution immediately, if for no other reason than my own reference:
<pre class="lang:sh decode:true">sudo usermod -aG docker $USER
sudo usermod -aG docker jenkins</pre>
As part of Docker's own <a href="https://docs.docker.com/engine/installation/linux/linux-postinstall/" target="_blank" rel="noopener">post-install documentation</a>, we know that we need to run the first command. However, the second command isn't documented thoroughly enough, especially since it's NOT the name of whatever your system user is (or Jenkins user for that matter - I.E jenkinsuser or jenkinsadmin or bob), it's simply "jenkins."]]></content:encoded>
    </item>
    <item>
      <title>Updated! PowerShell Core [Beta] 6.04, AzureRM.NetCore Module, and Az CLI 2.0 Install Scripts for Ubuntu and OS X</title>
      <link>https://docs.microsoft.com/archive/blogs/jessicadeen/updated-powershell-core-beta-6-04-azurerm-netcore-module-and-az-cli-2-0-install-scripts-for-ubuntu-and-os-x</link>
      <pubDate>Wed, 02 Aug 2017 13:26:53 GMT</pubDate>
      <dc:creator><![CDATA[Jessica Deen]]></dc:creator>
      <guid
        isPermaLink="false">http://blogs.technet.microsoft.com/jessicadeen/?p=2426</guid>
      <description><![CDATA[Quick update today – I previously wrote new install scripts for PowerShell Core Versions 6.11...]]></description>
      <content:encoded><![CDATA[<div class="entry">

<img class="aligncenter size-medium wp-image-2416" src="https://i1.wp.com/jessicadeen.com/wp-content/uploads/2016/11/basic-powershell-commands-intro-840x420.png?resize=300%2C150" alt="" width="300" height="150" />
Quick update today – I previously wrote new install scripts for PowerShell Core Versions 6.11 and 6.14 with the AzureRM.NetCore.Preview module and optional install of Azure CLI (1.0).

<strong>Today, I have updated them!</strong><span> </span>The below scripts have been modified to install the current, as of today (8/2/2017), version of PowerShell Core (Beta 6.04), an optional install of updated AzureRM.NetCore, and Azure CLI 2.0. You can access the scripts using the below links. As always, please read the script prior to running it on your system – you should NEVER run a script without reading it first, no matter who authored it.

<a target="_blank" href="https://github.com/jldeen/SVCC-AzureMgmtxplat/blob/master/install/14.04/betaps6.04_14.04_install.sh" rel="noopener noreferrer">Linux Ubuntu 14.04</a>
<a target="_blank" href="https://github.com/jldeen/SVCC-AzureMgmtxplat/blob/master/install/16.04/betaps6.04_16.04_install.sh" rel="noopener noreferrer">Linux Ubuntu 16.04</a>
<a target="_blank" href="https://github.com/jldeen/SVCC-AzureMgmtxplat/blob/master/install/osx_10.11/betaps6.04_osx_install.sh" rel="noopener noreferrer">Mac OS X 10.11 and 10.12</a>

Please comment if you have any questions, comments, tips, or just want to say hi!

</div>
<div class="html-after-content"><strong>Reminder:</strong><span> </span>All of my posts are provided "AS IS", imply no warranties, and confer no rights or special privileges. Use of included postings, code samples, and other works are subject to the terms specified at Microsoft. For more information, click<span> </span><a href="https://www.microsoft.com/legal/copyright/default.aspx">here</a>.</div>]]></content:encoded>
    </item>
  </channel>
</rss>