<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mark Roxberry</title>
    <description>The latest articles on DEV Community by Mark Roxberry (@roxberry).</description>
    <link>https://dev.to/roxberry</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F184283%2Ff5831c6c-fa91-42a3-b8b3-1f6bd1583ff0.jpg</url>
      <title>DEV Community: Mark Roxberry</title>
      <link>https://dev.to/roxberry</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/roxberry"/>
    <language>en</language>
    <item>
      <title>Why do we need all of this data? OWASP Privacy Risks - P-10</title>
      <dc:creator>Mark Roxberry</dc:creator>
      <pubDate>Fri, 22 Oct 2021 19:36:08 +0000</pubDate>
      <link>https://dev.to/roxberry/why-do-we-need-all-of-this-data-owasp-privacy-risks-p-10-57b9</link>
      <guid>https://dev.to/roxberry/why-do-we-need-all-of-this-data-owasp-privacy-risks-p-10-57b9</guid>
      <description>&lt;h2&gt;
  
  
  P-10 Collection of data not required for the user-consented purpose
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://owasp.org/www-project-top-10-privacy-risks/"&gt;OWASP Top 10 Privacy Risks Project&lt;/a&gt; identifies the top 10 privacy risks in web applications, the cloud and the global online ecosystem.  In September of 2021, version 2 of the project was released. I'm going to work through the list and discuss each risk, with references and mitigation countermeasures, if they exist.&lt;/p&gt;

&lt;p&gt;The P-10 risk, "Collection of data not required for the user-consented purpose" on the list is the collection of too much data from users.&lt;/p&gt;

&lt;h2&gt;
  
  
  Companies are collecting more data than they need
&lt;/h2&gt;

&lt;p&gt;“Most companies are collecting data these days on all the interactions, on all the places that they touch customers in the normal course of doing business,” says Elea Feit, senior fellow at Wharton Customer Analytics and a Drexel marketing professor. (from &lt;a href="https://knowledge.wharton.upenn.edu/article/data-shared-sold-whats-done/"&gt;Your Data Is Shared and Sold…What’s Being Done About It?&lt;/a&gt; - Knowledge@Wharton)&lt;/p&gt;

&lt;p&gt;From Security.org, a review of privacy policies reveals that they have granted themselves liberal access to user data.  From &lt;a href="https://www.security.org/resources/data-tech-companies-have/"&gt;The Data Big Tech Companies Have On You&lt;/a&gt;.  Reviewing companies and their grades from that article:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google gets an F&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In addition to data they collect from user interactions, their policy allows for data collection  on users from local newspapers, third party marketing partners, or advertisers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Facebook's Grade: C&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By design, Facebook operates off of user data.  But how do they make money?  "Facebook makes the majority of its money through its advertisers"&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon Grade: B-&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Amazon collects a ton of data from users and shares data with millions of Marketplace sellers, it does not by default send PII to those sellers.  Additionally, Amazon provides opt-out for any information sent to 3rd parties.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do to mitigate P-10
&lt;/h2&gt;

&lt;p&gt;I recommend that you look into making a "Lean Data Commitment", following Mozilla's "Lean Data Practices" guide to help define your organization's privacy best practices.  "Lean Data Practices" can be found &lt;a href="https://www.mozilla.org/en-US/about/policy/lean-data/"&gt;here&lt;/a&gt;.  Particulary note the 3 tenets of lean data practices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Stay Lean" - review your data collection&lt;/li&gt;
&lt;li&gt;"Build Security" - protect customer data&lt;/li&gt;
&lt;li&gt;"Engage Your Users" - inform your users, keep your practices transparent. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Scan your site for Privacy issues at &lt;a href="https://privacyscore.org/"&gt;PRIVACYSCORE&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://owasp.org/www-project-top-10-privacy-risks/"&gt;OWASP Top 10 Privacy Risks Project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://knowledge.wharton.upenn.edu/article/data-shared-sold-whats-done/"&gt;Your Data Is Shared and Sold…What’s Being Done About It?&lt;/a&gt; - Knowledge@Wharton&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.security.org/resources/data-tech-companies-have/"&gt;The Data Big Tech Companies Have On You&lt;/a&gt; - Security.org&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://techcrunch.com/2019/10/10/your-mass-consumer-data-collection-is-destroying-consumer-trust/"&gt;Your mass consumer data collection is destroying consumer trust&lt;/a&gt; - Tech Crunch&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.forbes.com/sites/forbestechcouncil/2020/12/14/the-rising-concern-around-consumer-data-and-privacy/?sh=7658a1c487e8"&gt;The Rising Concern Around Consumer Data And Privacy&lt;/a&gt; - Forbes&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>privacy</category>
      <category>security</category>
      <category>owasp</category>
      <category>data</category>
    </item>
    <item>
      <title>Github Action for Gatsby Publish</title>
      <dc:creator>Mark Roxberry</dc:creator>
      <pubDate>Tue, 27 Jul 2021 21:29:22 +0000</pubDate>
      <link>https://dev.to/roxberry/github-action-for-gatsby-publish-4khn</link>
      <guid>https://dev.to/roxberry/github-action-for-gatsby-publish-4khn</guid>
      <description>&lt;h2&gt;
  
  
  Why?
&lt;/h2&gt;

&lt;p&gt;The gatsby template includes scripting to deploy from whereever you cloned your code.  It works just fine and is reliable when everything is set up on my machine.  The package.json includes the deploy script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scripts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="p"&gt;...&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;deploy&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;gatsby build --prefix-paths &amp;amp;&amp;amp; gh-pages -d public&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, there are 2 drawbacks for my workflow (and my goal to start writing more):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You can deploy without a commit and push to the repository&lt;/li&gt;
&lt;li&gt;You can't deploy without running the deploy script, so any work on the site on Github or my iPad won't get deployed until I commit and push on one device and then pull and deploy to the same repo on my computer.  Ain't nobody got time for that.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I was using a Github Action for my Jekyll site, prior to moving to Gatsby, and that worked when I pushed to branch and kickoff the publish action.  This action was a bit more involved as I was using Azure for a host and it required a few more configuration hurdles to set it up.&lt;/p&gt;

&lt;p&gt;For my current site, I thought it has to be pretty simple - push to main branch, trigger an action, copy to gh-pages branch and that's that.  Turns out, that is that and I was able to get it working pretty fast.&lt;/p&gt;

&lt;p&gt;I documented my steps in case I need to go back and change anything - e.g. I would like to update the siteMetadata.version in the gatsby-config.js file at some point.  Here are the steps&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to publish a Gatsby site to gh-pages
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create a new workflow in the repository Actions section
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Gatsby Publish&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="s"&gt;main&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v1&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;enriikke/gatsby-gh-pages-action@v2&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;access-token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.ACCESS_TOKEN }}&lt;/span&gt;
          &lt;span class="na"&gt;deploy-branch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;gh-pages&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a personal access token (PAT), select the &lt;em&gt;repo&lt;/em&gt; permission.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.github.com/en/actions/reference/authentication-in-a-workflow"&gt;Authentication in a Github Action Workflow&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a Secret in the repo: ACCESS_TOKEN and use the new PAT token (note the workflow YAML file specifies the ACCESS_TOKEN parameter).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Build should kick in and go green&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Profit?&lt;/p&gt;

&lt;p&gt;And lo and behold, my site is passing (hopefully this shows it's passing):&lt;br&gt;
&lt;a href="https://github.com/roxberry/gatsby-roxberry/actions/workflows/main.yml"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e7cWFWwK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://github.com/roxberry/gatsby-roxberry/actions/workflows/main.yml/badge.svg" alt="Gatsby Publish"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Next things
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Improve this post with images from Github&lt;/li&gt;
&lt;li&gt;[ ] Add embedded gist for the main.yml&lt;/li&gt;
&lt;li&gt;[ ] Config version update (need to think about - should only happen on non posts)&lt;/li&gt;
&lt;li&gt;[ ] Create a tweet with the title if a post&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://gist.github.com/roxberry/f6f58e2212346fd8c699c1d8c8cf8bcf.js"&gt;https://gist.github.com/roxberry/f6f58e2212346fd8c699c1d8c8cf8bcf.js&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gatsby</category>
      <category>github</category>
      <category>devops</category>
    </item>
    <item>
      <title>Dev Note - HttpClient in Salesforce Commerce Cloud  SFRA</title>
      <dc:creator>Mark Roxberry</dc:creator>
      <pubDate>Tue, 27 Jul 2021 21:26:02 +0000</pubDate>
      <link>https://dev.to/roxberry/dev-note-httpclient-in-salesforce-commerce-cloud-sfra-2pkg</link>
      <guid>https://dev.to/roxberry/dev-note-httpclient-in-salesforce-commerce-cloud-sfra-2pkg</guid>
      <description>&lt;h2&gt;
  
  
  Using HttpClient in Salesforce Commerce Cloud
&lt;/h2&gt;

&lt;p&gt;I needed a quick way to get a model for a view.  For our API calls, I created services, profiles and credentials that are managed by SFCC.  But that's overkill for a one off call.  HttpClient is a way to make external calls, in SFCC/SFRA there's a little twist.  Code to use the TypeScript HTTPClient in cartridge code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;callExternalUrl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;HTTPClient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dw/net/HTTPClient&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;Logger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dw/system/Logger&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;empty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;userId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;httpClient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;HTTPClient&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nx"&gt;httpClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;httpClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GET&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;httpClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;httpClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;statusCode&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;//confirm response&lt;/span&gt;
            &lt;span class="nx"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getLogger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;shop&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="nx"&gt;httpClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;
            &lt;span class="p"&gt;);&lt;/span&gt;

            &lt;span class="c1"&gt;// do something with response object&lt;/span&gt;
            &lt;span class="c1"&gt;// var sourceObject = JSON.parse(httpClient.text);&lt;/span&gt;

            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// error handling&lt;/span&gt;
            &lt;span class="nx"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getLogger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;shop&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;An error occured with status code &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; 
                &lt;span class="nx"&gt;httpClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;statusCode&lt;/span&gt;
            &lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="c1"&gt;// var parameters = {&lt;/span&gt;
&lt;span class="c1"&gt;//     url: "",&lt;/span&gt;
&lt;span class="c1"&gt;//     userId: "",&lt;/span&gt;
&lt;span class="c1"&gt;//     password: ""&lt;/span&gt;
&lt;span class="c1"&gt;// }&lt;/span&gt;
&lt;span class="c1"&gt;// callExternalUrl(parameters)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>sfcc</category>
      <category>sfra</category>
      <category>javascript</category>
      <category>salesforce</category>
    </item>
    <item>
      <title>     SQL Server on Linux via Docker</title>
      <dc:creator>Mark Roxberry</dc:creator>
      <pubDate>Fri, 11 Jun 2021 00:09:19 +0000</pubDate>
      <link>https://dev.to/roxberry/sql-server-on-linux-via-docker-efd</link>
      <guid>https://dev.to/roxberry/sql-server-on-linux-via-docker-efd</guid>
      <description>&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Get &lt;a href="https://www.docker.com/"&gt;Docker&lt;/a&gt; (if it is not already running)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Get the SQL Server on Linux for Docker Engine image&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I'm running Docker on MacOS, I will use the SQL Server on Linux for Docker Engine at &lt;a href="https://hub.docker.com/r/microsoft/mssql-server-linux/"&gt;Docker Hub&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   docker pull microsoft/mssql-server-linux
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Set the settings and start the container&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;SQL Server on Linux for Docker Engine requires an environment setting to accept the EULA and set a strong SA password:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   ACCEPT_EULA = Y
   SA_PASSWORD = &amp;lt;your password&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run this in the terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 -d microsoft/mssql-server-linux
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Copy a backup to the container
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   docker cp '/tmp/DatabaseName.bak' mssql-server-linux:/tmp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Restore the backup
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   RESTORE DATABASE DatabaseName FROM DISK='/tmp/DatabaseName.bak'
   WITH MOVE 'DatabaseName' TO '/var/opt/mssql/data/DatabaseName.MDF',
   MOVE 'DatabaseName_log' TO '/var/opt/mssql/data/DatabaseName_log.ldf'
   Go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Connect with a docker command or an IDE like &lt;a href="https://www.jetbrains.com/datagrip/"&gt;DataGrip&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C9c92zXZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3qq79gwuc4at1eukk9n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C9c92zXZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3qq79gwuc4at1eukk9n.png" alt="JetBrains DataGrip IDE"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using SQL Server for Linux in Docker has allowed me to continue to develop using a Linux distro or macOS without needing to set up a VM to run the database backend.&lt;/p&gt;

</description>
      <category>sqlserver</category>
      <category>linux</category>
      <category>docker</category>
    </item>
  </channel>
</rss>
