<?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: Evgeny Rudinsky</title>
    <description>The latest articles on DEV Community by Evgeny Rudinsky (@erudinsky).</description>
    <link>https://dev.to/erudinsky</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%2F115964%2F3278784a-87cc-4b28-bc2b-0ee3cddf34e2.png</url>
      <title>DEV Community: Evgeny Rudinsky</title>
      <link>https://dev.to/erudinsky</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/erudinsky"/>
    <language>en</language>
    <item>
      <title>How to change default branch in SonarQube Community Edition</title>
      <dc:creator>Evgeny Rudinsky</dc:creator>
      <pubDate>Fri, 30 Sep 2022 09:31:59 +0000</pubDate>
      <link>https://dev.to/erudinsky/how-to-change-default-branch-in-sonarqube-community-edition-4p1m</link>
      <guid>https://dev.to/erudinsky/how-to-change-default-branch-in-sonarqube-community-edition-4p1m</guid>
      <description>&lt;p&gt;Default Branch name in Community Edition&lt;br&gt;
The default branch in SonarQube Community Edition is still locked to master. If you want to change that in SonarQube then there is no user interface option available, as is in higher editions under Administration –&amp;gt; Branches and Pull Requests.&lt;/p&gt;

&lt;p&gt;You can use this url to get to the same page for your project and change the name there: &lt;a href="https://sonarqube.server.url/project/branches?id=" rel="noopener noreferrer"&gt;https://sonarqube.server.url/project/branches?id=&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sonarqube</category>
      <category>sast</category>
    </item>
    <item>
      <title>How to deploy to Azure with GitLab (authentication in Azure and YAML pipeline example)</title>
      <dc:creator>Evgeny Rudinsky</dc:creator>
      <pubDate>Tue, 09 Aug 2022 05:43:00 +0000</pubDate>
      <link>https://dev.to/erudinsky/how-to-deploy-to-azure-with-gitlab-authentication-credentials-store-runner-config-yaml-pipeline-example-37bp</link>
      <guid>https://dev.to/erudinsky/how-to-deploy-to-azure-with-gitlab-authentication-credentials-store-runner-config-yaml-pipeline-example-37bp</guid>
      <description>&lt;p&gt;In this short post you'll find how to prepare your GitLab to deploy to Azure.&lt;/p&gt;

&lt;h2&gt;
  
  
  1 - Service Principal
&lt;/h2&gt;

&lt;p&gt;Generate Service Principal (aka App Registration) using azure CLI (either builtin shell or local terminal, you must be logged in with &lt;code&gt;Owner&lt;/code&gt; role credentials since we need to assign role to the scope):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az ad sp create-for-rbac &lt;span class="nt"&gt;--name&lt;/span&gt; GitLabServicePrincipalName &lt;span class="nt"&gt;--role&lt;/span&gt; Owner &lt;span class="nt"&gt;--scopes&lt;/span&gt; /

&lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"appId"&lt;/span&gt;: &lt;span class="s2"&gt;"&amp;lt;REDACTED&amp;gt;"&lt;/span&gt;,
  &lt;span class="s2"&gt;"displayName"&lt;/span&gt;: &lt;span class="s2"&gt;"GitLabServicePrincipalName"&lt;/span&gt;,
  &lt;span class="s2"&gt;"password"&lt;/span&gt;: &lt;span class="s2"&gt;"&amp;lt;REDACTED&amp;gt;"&lt;/span&gt;,
  &lt;span class="s2"&gt;"tenant"&lt;/span&gt;: &lt;span class="s2"&gt;"&amp;lt;REDACTED&amp;gt;"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feel free to change scopes and role (i.e. custom role or subscription scope instead). Learn more how to generate SPN &lt;a href="https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2 - Store credentials in GitLab
&lt;/h2&gt;

&lt;p&gt;Safe &lt;code&gt;appId&lt;/code&gt;, &lt;code&gt;password&lt;/code&gt;, &lt;code&gt;tenant&lt;/code&gt; and subscription ID in GitLab =&amp;gt; Settings =&amp;gt; CI/CD =&amp;gt; Variables (make sure to enable checkbox &lt;a href="https://docs.gitlab.com/ee/ci/variables/index.html#mask-a-cicd-variable" rel="noopener noreferrer"&gt;Mask variable&lt;/a&gt; for each secret so the values won't end up in the logs of the job).&lt;/p&gt;

&lt;h2&gt;
  
  
  3 - Configure YAML
&lt;/h2&gt;

&lt;p&gt;Example of &lt;code&gt;.gitlab-ci.yml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;...&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;REDACTED&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt; &lt;span class="s"&gt;...&lt;/span&gt;

&lt;span class="na"&gt;deploy-job&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mcr.microsoft.com/azure-cli&lt;/span&gt;
  &lt;span class="na"&gt;variables&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;appId&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;$appId&lt;/span&gt;
    &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;$password&lt;/span&gt;
    &lt;span class="na"&gt;tenant&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;$tenant&lt;/span&gt;
    &lt;span class="na"&gt;subId&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;$subId&lt;/span&gt;
  &lt;span class="na"&gt;stage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;deploy&lt;/span&gt;
  &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;az login --service-principal -u $appId -p $password -t $tenant&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;az account set -s $subId&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;az group list&lt;/span&gt;

&lt;span class="nn"&gt;...&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;REDACTED&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt; &lt;span class="s"&gt;...&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Resources and notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Microsoft offers &lt;a href="https://hub.docker.com/_/microsoft-azure-cli?tab=description" rel="noopener noreferrer"&gt;docker image with latest and greatest Azure CLI&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;Variables are not available automatically after adding them in GUI, we have to assign them to environment variables, that's why we have &lt;code&gt;variables&lt;/code&gt; block in the YAML.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;az account set -s $subId&lt;/code&gt; is used to make sure that the proper target subscription is set for our operations (important in case of multiple subscriptions within tenant).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Feel free to explore this &lt;a href="https://gitlab.com/evgenyrudinsky/once-upon-an-app" rel="noopener noreferrer"&gt;public repo&lt;/a&gt; to see the entire example. &lt;/p&gt;

&lt;p&gt;Let me know what you think. If you liked my content, follow me on twitter at &lt;a href="https://twitter.com/evgenyrudinsky" rel="noopener noreferrer"&gt;@evgenyrudinsky&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Until next post! 👋&lt;/p&gt;

</description>
      <category>gitlab</category>
      <category>azure</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
