<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CI/CD DevOps &#8211; Pauls Blog</title>
	<atom:link href="https://sterl.org/category/cloud/ci-cd-devops/feed/" rel="self" type="application/rss+xml" />
	<link>https://sterl.org</link>
	<description></description>
	<lastBuildDate>Tue, 09 May 2023 08:06:35 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>Azure Bicep CLI and functions cheet sheet</title>
		<link>https://sterl.org/2023/03/azure-bicep-cli-functions-cheet-sheet/</link>
					<comments>https://sterl.org/2023/03/azure-bicep-cli-functions-cheet-sheet/#respond</comments>
		
		<dc:creator><![CDATA[Paul Sterl]]></dc:creator>
		<pubDate>Fri, 31 Mar 2023 15:06:05 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[CI/CD DevOps]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[bicep]]></category>
		<category><![CDATA[ci/cd]]></category>
		<category><![CDATA[IaC]]></category>
		<category><![CDATA[infrastructure-as-code]]></category>
		<guid isPermaLink="false">https://sterl.org/?p=890</guid>

					<description><![CDATA[Overall Azure bicep is the best repalcement for AWS CDK currently available (2023) and the recommended way to express infrastructure-as-code in the aure universe. Bicep CLI All command require azure CLI and PowerShell 7.x.x Select subscription by name / set context Set default Run bicep deployment Read resource group List resource groups Bicep functions Random&#8230;]]></description>
										<content:encoded><![CDATA[
<p>Overall Azure <code>bicep</code> is the best repalcement for <code>AWS CDK</code> currently available (2023) and the recommended way to express infrastructure-as-code in the aure universe.</p>



<h2 class="wp-block-heading">Bicep CLI</h2>



<p>All command require azure CLI and PowerShell 7.x.x</p>



<h3 class="wp-block-heading">Select subscription by name / set context</h3>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;file&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;powershell&quot;,&quot;mime&quot;:&quot;application/x-powershell&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;PowerShell&quot;,&quot;language&quot;:&quot;PowerShell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;powershell&quot;}">$context = Get-AzSubscription -SubscriptionName '&lt;name of the subscription&gt;'
Set-AzContext $context</pre></div>



<h3 class="wp-block-heading">Set default </h3>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;powershell&quot;,&quot;mime&quot;:&quot;application/x-powershell&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;PowerShell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;powershell&quot;}">Set-AzDefault -ResourceGroupName &lt;resource-group-name&gt;</pre></div>



<h3 class="wp-block-heading">Run bicep deployment</h3>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;powershell&quot;,&quot;mime&quot;:&quot;application/x-powershell&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;PowerShell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;powershell&quot;}">New-AzResourceGroupDeployment -TemplateFile main.bicep</pre></div>



<h3 class="wp-block-heading">Read resource group</h3>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;powershell&quot;,&quot;mime&quot;:&quot;application/x-powershell&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;PowerShell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;powershell&quot;}">Get-AzResourceGroupDeployment -ResourceGroupName &lt;resource-group-name&gt; | Format-Table</pre></div>



<h3 class="wp-block-heading">List resource groups</h3>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;powershell&quot;,&quot;mime&quot;:&quot;application/x-powershell&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;PowerShell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;powershell&quot;}">Get-AzResourceGroup</pre></div>



<h2 class="wp-block-heading">Bicep functions</h2>



<h3 class="wp-block-heading">Random unique name <a href="https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-functions-string#uniquestring" target="_blank" rel="noreferrer noopener">uniqueString</a></h3>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">param fooUniceName string = 'fooo${uniqueString('constant-seed-value')}'</pre></div>



<h2 class="wp-block-heading">Create resource group with bicep</h2>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;yaml&quot;,&quot;mime&quot;:&quot;text/x-yaml&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;YAML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;yaml&quot;}">targetScope = 'subscription'
param location string = deployment().location

resource rg 'Microsoft.Resources/resourceGroups@2022-09-01' = {
    name: 'myName'
    location: location
}</pre></div>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;powershell&quot;,&quot;mime&quot;:&quot;application/x-powershell&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;PowerShell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;powershell&quot;}">az deployment create --location westeurope  --template-file .\main.bicep</pre></div>



<h3 class="wp-block-heading">Links</h3>



<ul class="wp-block-list">
<li><a href="https://learn.microsoft.com/en-us/powershell/module/az.resources">https://learn.microsoft.com/en-us/powershell/module/az.resources</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://sterl.org/2023/03/azure-bicep-cli-functions-cheet-sheet/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Azure DevOps Function App Deployment &#8222;No package found&#8220;</title>
		<link>https://sterl.org/2023/03/azure-devops-function-app-deployment-no-package-found/</link>
					<comments>https://sterl.org/2023/03/azure-devops-function-app-deployment-no-package-found/#comments</comments>
		
		<dc:creator><![CDATA[Paul Sterl]]></dc:creator>
		<pubDate>Fri, 10 Mar 2023 11:06:46 +0000</pubDate>
				<category><![CDATA[CI/CD DevOps]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure Function]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[FunctionApp]]></category>
		<guid isPermaLink="false">https://sterl.org/?p=863</guid>

					<description><![CDATA[Problem This error occurs using the default MS deployment example. Even if we have an uploaded artefact Solution The problem is, that we have a deployment step by default but the MS documentation is outdated and so is missing the download step: As so we have to: Deploy Node Function App using Azure DevOps The&#8230;]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Problem</h2>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">##[error]Error: No package found with specified pattern: /home/vsts/work/1/a/**/*.zip
Check if the package mentioned in the task is published as an artifact in the build or a previous stage and downloaded in the current job.
</pre></div>



<p>This error occurs using the default MS deployment example. Even if we have an uploaded artefact</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><a href="https://sterl.org/wp-content/uploads/2023/03/azure-package-deploy-function-app.png"><img decoding="async" src="https://sterl.org/wp-content/uploads/2023/03/azure-package-deploy-function-app.png" alt="" class="wp-image-866" width="237" height="129"/></a></figure></div>


<h2 class="wp-block-heading">Solution</h2>



<p>The problem is, that we have a deployment step by default but the MS documentation is outdated and so is missing the download step:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;yaml&quot;,&quot;mime&quot;:&quot;text/x-yaml&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;YAML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;yaml&quot;}">- task: DownloadBuildArtifacts@1
  inputs:
    buildType: 'current'
    downloadType: 'single'
    artifactName: 'drop'
    itemPattern: '**/*.zip'
    downloadPath: '$(System.ArtifactsDirectory)'</pre></div>



<p>As so we have to:</p>



<ol class="wp-block-list">
<li>build</li>



<li>publish -> <code>ArchiveFiles</code> &amp; <code>PublishBuildArtifacts</code></li>



<li><strong>download an artefact </strong>-> <code>DownloadBuildArtifacts</code></li>



<li>deploy: before we can trigger the deploy <code>AzureFunctionApp</code> task.</li>
</ol>



<h2 class="wp-block-heading">Deploy Node Function App using Azure DevOps</h2>



<p>The full build and deploy Azure DevOps scripts looks than like:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;yaml&quot;,&quot;mime&quot;:&quot;text/x-yaml&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;YAML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;yaml&quot;}"># Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
variables:
  # Azure service connection established during pipeline creation
  azureSubscription: '&lt;azure-subscription-name&gt;'
  appName: '&lt;azure-function-app-name&gt;'

trigger:
- master

pool:
  vmImage: ubuntu-latest

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '16.x'
  displayName: 'Install Node.js'
- script: |
    if [ -f extensions.csproj ]
    then
        dotnet build extensions.csproj --output ./bin
    fi
    npm install 
    npm run build --if-present
    npm prune --production  
- task: ArchiveFiles@2
  displayName: &quot;Archive files&quot;
  inputs:
    rootFolderOrFile: &quot;$(System.DefaultWorkingDirectory)&quot;
    includeRootFolder: false
    archiveFile: &quot;$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip&quot;
- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(System.DefaultWorkingDirectory)/build$(Build.BuildId).zip'
    artifactName: 'drop'
- task: DownloadBuildArtifacts@1
  inputs:
    buildType: 'current'
    downloadType: 'single'
    artifactName: 'drop'
    itemPattern: '**/*.zip'
    downloadPath: '$(System.ArtifactsDirectory)'
- task: AzureFunctionApp@1
  inputs:
    azureSubscription: $(azureSubscription)
    appType: functionAppLinux # default is functionApp
    appName: $(appName)
    package: '$(System.DefaultWorkingDirectory)/**/*.zip'
    runtimeStack: 'NODE|16' # this is optional
    deploymentMethod: 'auto' # auto is default
    #Uncomment the next lines to deploy to a deployment slot
    #Note that deployment slots is not supported for Linux Dynamic SKU
    #deployToSlotOrASE: true
    #resourceGroupName: '&lt;Resource Group Name&gt;'
    #slotName: '&lt;Slot name&gt;'</pre></div>



<h2 class="wp-block-heading">Links</h2>



<ul class="wp-block-list">
<li><a href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-how-to-azure-devops" target="_blank" rel="noreferrer noopener">CI/CD Microsoft Azure Pipeline Function App</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://sterl.org/2023/03/azure-devops-function-app-deployment-no-package-found/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
