tag:blogger.com,1999:blog-31715269302019974882024-03-13T17:23:56.378+01:00Azure And Web Developmentsome handy tips for me working in and with Microsoft platformPouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comBlogger123125tag:blogger.com,1999:blog-3171526930201997488.post-89948598093277031412021-09-22T11:19:00.000+02:002021-09-22T11:19:09.889+02:00Get Function Token CLI<p> Notice the name of the token which is created as <b>App keys</b> in the function.</p><p>function GetFunctionToken {</p><p> param (</p><p> [string[]]$funcResGroupName,<br /> [string[]]$funcName</p><p> )</p><p> </p><p> # Get function token<br /> $url = "/subscriptions/$subscriptionId/resourceGroups/$funcResGroupName/providers/Microsoft.Web/sites/$funcName/host/default/listKeys?api-version=2018-11-01"</p><p> $functionCode = az rest --method post --uri $url --query functionKeys.<b>appkeyName</b> --output tsv<br /> return $functionCode</p><p>}</p>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-39958543904785024562021-05-27T09:54:00.001+02:002021-05-27T10:19:06.699+02:00Publish packages to nuget.org<p>You can follow different path in order to publish your package into nuget.org. The prerequisites and the steps are described in <a href="https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-visual-studio?tabs=netcore-cli" target="_blank">Microsoft documentation page</a>. </p><blockquote><p>If you get an <b>Error 403 </b>(The specified API Key is invalid, has expired, or does not have permission to access the specified package.) it simply indicates that the package name you chose has already been published and you are not allowed to overwrite it. Which makes sense when you upload yours and do not want other people make changes to it without you providing them an API Key.</p></blockquote><p>One good practice is to create packages using a different API key than upgrading to a new version. This will make sure that your deployment pipeline will fail if the name does not exist and it would create a new package every time you deploy it.</p><p>When publishing a nuget package to <b>Azure DevOps Artifacts</b> you do similarly using <b>nuget push</b> command:</p><div style="background-color: #fffffe; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;"><div> - <span style="color: teal;">task</span>: <span style="color: #0451a5;">DotNetCoreCLI@2</span></div><div> <span style="color: teal;">displayName</span>: <span style="color: #0451a5;">'dotnet push'</span></div><div> <span style="color: teal;">inputs</span>:</div><div> <span style="color: teal;">command</span>: <span style="color: #0451a5;"><b>push</b></span></div><div> <span style="color: teal;">packagesToPush</span>: <span style="color: #0451a5;">'$(Build.ArtifactStagingDirectory)/*.nupkg'</span></div><div> <span style="color: teal;">nuGetFeedType</span>: <span style="color: #0451a5;">'internal'</span></div><div> <span style="color: teal;">publishVstsFeed</span>: <span style="color: #0451a5;">'feed</span><span style="color: #0451a5;">-name-or-id'</span></div><div> <span style="color: teal;">condition</span>: <span style="color: #0451a5;">and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))</span></div></div>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-55318681380235216752021-05-26T23:01:00.004+02:002021-05-26T23:01:49.230+02:00Test & Feedback extension<p> This extension can be installed on Chrome, Edge and FireFox in any operating systems. You simply connect the extension to your organization Azure Devops. It helps you write notes, take screenshots and add a bug when you exploring the website your team is responsible for.</p><p>See more: <a href="https://docs.microsoft.com/en-us/azure/devops/test/perform-exploratory-tests?view=azure-devops">https://docs.microsoft.com/en-us/azure/devops/test/perform-exploratory-tests?view=azure-devops</a> </p><p>You can even work in <b><a href="https://docs.microsoft.com/en-us/azure/devops/test/standalone-mode-exploratory-testing?view=azure-devops" target="_blank">Standalone mode</a> </b>which makes the report in your Download folder of the browser.</p>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-69713563834313315102021-05-26T10:24:00.004+02:002021-05-26T10:24:49.316+02:00Azure Synapse Analytics Day<p>This page summarizes some highlights from the Azure Immersion Workshop on Analytics.</p><p>On GitHub:</p><p></p><ul style="text-align: left;"><li>Microsft Cloud Workshop<br /><a href="https://github.com/Microsoft/MCW">https://github.com/Microsoft/MCW</a><br /><br /></li><li>Synapse Analytics and AI<br /><a href="https://github.com/microsoft/MCW-Azure-Synapse-Analytics-and-AI">https://github.com/microsoft/MCW-Azure-Synapse-Analytics-and-AI</a><br /><br /></li><li>Lab Guide<br /> <a href="https://github.com/solliancenet/azure-synapse-analytics-day" style="font-family: "Segoe UI Light", sans-serif; font-size: 10pt;">https://github.com/solliancenet/azure-synapse-analytics-day</a></li></ul><p>What is <b>Delta Lake</b>: from <a href="https://docs.microsoft.com/en-us/azure/synapse-analytics/spark/apache-spark-what-is-delta-lake">docs.microsoft.com</a> <br /></p><p></p><blockquote>Delta Lake is an open-source storage layer that brings ACID (atomicity, consistency, isolation, and durability) transactions to <b>Apache Spark</b> and big data workloads.</blockquote><p></p><p>It supports many features lie ACID, Time Travel and Open format which enables <b>Apache Parquet</b> into baseline</p><p>Comparing Synapse Analytics versus Azure Data Factory<br /><a href="https://docs.microsoft.com/en-us/azure/synapse-analytics/data-integration/concepts-data-factory-differences" target="_blank">https://docs.microsoft.com/en-us/azure/synapse-analytics/data-integration/concepts-data-factory-differences </a></p><p>Tutorial: Get Started <br /><a href="https://docs.microsoft.com/en-us/azure/synapse-analytics/get-started">https://docs.microsoft.com/en-us/azure/synapse-analytics/get-started</a></p><p>White Paper: POLARIS - The Distributed SQL Engine in Azure Synapse<br /><a href="https://www.vldb.org/pvldb/vol13/p3204-saborit.pdf">https://www.vldb.org/pvldb/vol13/p3204-saborit.pdf</a> </p><p>Unleash Your SAP Data<br /><a href="https://go.qlik.com/Qlik-Unleash-Your-SAP-Data.html">https://go.qlik.com/Qlik-Unleash-Your-SAP-Data.html</a></p><p>Experience with free account<br /><a href="https://azure.microsoft.com/en-us/free/synapse-analytics/">https://azure.microsoft.com/en-us/free/synapse-analytics/</a></p><p><br /></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwA1TP43MxMpQNhPyzrqA4vH_8ac5g9Fpt5mfBqDYScKjHVHf26AMrXjpjeV2YL7rdMxo6oIAihaw1NUZKhYziTxSqdllguHx_NhBnbZ6FlSDh5jqf5NEBLaYuEZyeWp7ZMYCRIg-cRYe8/" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img alt="" data-original-height="644" data-original-width="1186" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwA1TP43MxMpQNhPyzrqA4vH_8ac5g9Fpt5mfBqDYScKjHVHf26AMrXjpjeV2YL7rdMxo6oIAihaw1NUZKhYziTxSqdllguHx_NhBnbZ6FlSDh5jqf5NEBLaYuEZyeWp7ZMYCRIg-cRYe8/w400-h217/image.png" width="400" /></a></div><br /><br /><p></p><p><br /></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTcs6hl9sIWq9WQ39WLBA6yyL1TY_0l7jQj5FtUws2BnPhDblUbEHoVfrotwjJuWjn3igOf2Q0o_WiMJ8Rm4NKHGyWCZ1sxg3yvHqj3AkrKT4EPSu3nbQoK76vXvMWihLThcf6w-KCJOP9/" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="676" data-original-width="1214" height="223" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTcs6hl9sIWq9WQ39WLBA6yyL1TY_0l7jQj5FtUws2BnPhDblUbEHoVfrotwjJuWjn3igOf2Q0o_WiMJ8Rm4NKHGyWCZ1sxg3yvHqj3AkrKT4EPSu3nbQoK76vXvMWihLThcf6w-KCJOP9/w400-h223/image.png" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLzXTPLg_J-NO_LKMjYpcXJ7FeByHVdGL5iikDSjU7uQ7726bEqHoC-Jml6TDTCqYG7qSXtGLN1YLEMwDXFf3MHjrUHiZq_ukQxPkObd4fhxlelHeLB8dEY2dQw4gw-0Ws_K_py56V0C62/" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img alt="" data-original-height="637" data-original-width="1262" height="203" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLzXTPLg_J-NO_LKMjYpcXJ7FeByHVdGL5iikDSjU7uQ7726bEqHoC-Jml6TDTCqYG7qSXtGLN1YLEMwDXFf3MHjrUHiZq_ukQxPkObd4fhxlelHeLB8dEY2dQw4gw-0Ws_K_py56V0C62/w400-h203/image.png" width="400" /></a></div><br /><br /><br /><p></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm_S1WT8_kDFoRJXw3H_YFG-IGg11_5BJyGphw5lqlpF0QaiaETUAymeGMM5HNAu5V1YCEp5J5DXiQ07CMnQmGjbRvQVQGxcLV7lF2AN0sskoXdTrGgovML1JGLZn3IBFBYJZEJenX3Mw2/" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="588" data-original-width="1235" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm_S1WT8_kDFoRJXw3H_YFG-IGg11_5BJyGphw5lqlpF0QaiaETUAymeGMM5HNAu5V1YCEp5J5DXiQ07CMnQmGjbRvQVQGxcLV7lF2AN0sskoXdTrGgovML1JGLZn3IBFBYJZEJenX3Mw2/w400-h190/image.png" width="400" /></a></div><br /><br /><p></p>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-39301466131869570592021-05-21T09:18:00.004+02:002021-05-21T09:18:38.359+02:00Application Insights - Sampling<p> </p><div class="p-space-md" style="background-color: white; box-sizing: border-box; color: #3c3b37; font-family: "sf pro text", -apple-system, BlinkMacSystemFont, Roboto, "segoe ui", Helvetica, Arial, sans-serif, "apple color emoji", "segoe ui emoji", "segoe ui symbol"; font-size: 16px; margin: 0px; padding: 24px;"><div class="article-asset--content--1dAQ9" data-purpose="safely-set-inner-html:rich-text-viewer:html" style="box-sizing: border-box; margin: 0px; padding: 0px;"><h4 style="box-sizing: border-box; color: inherit; font-size: 24px; font-weight: 400; line-height: 1.1; margin: 0px; max-width: 60rem; padding: 0px;"><span style="font-size: 18px;">In Application Insights, using sampling is an effective way to reduce the amount of telemetry data that is sent to Application Insights. If you are worried about high storage costs if all telemetry data gets sent to Application Insights, you can make use of sampling in Application Insights.</span></h4><p style="box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;">By default Application Insights sampling is already enabled when you use the ASP.NET, ASP.NET Core software development kits.</p><p style="box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;">For ASP.Net applications you can configure adaptive sampling by tuning parameters in the ApplicationInsights.config file. Some of the settings are</p><p style="box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;"><span style="box-sizing: border-box; font-weight: 700; margin: 0px; padding: 0px;"><MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond></span></p><p style="box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;">This will ensure to limit the number of items that are sent to Application Insights</p><p style="box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;"><span style="box-sizing: border-box; font-weight: 700; margin: 0px; padding: 0px;"><EvaluationInterval>00:00:15</EvaluationInterval></span></p><p style="box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;">This is the interval at which the current rate of telemetry is reevaluated</p><p style="box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;"><span style="box-sizing: border-box; font-weight: 700; margin: 0px; padding: 0px;"><InitialSamplingPercentage>100</InitialSamplingPercentage></span></p><p style="box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;">This is the amount of telemetry data that is sent when the application is started</p><p style="box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;">In ASP.Net Core applications, there is no ApplicationInsights.config file, so the configuration is done via code.</p><p style="box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;">Adaptive sampling is enabled by default for all ASP.NET Core applications</p><p style="box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;">For more information on adaptive sampling, you can use the below link</p><p style="box-sizing: border-box; font-size: 18px; margin: 0px 0px 20px; max-width: 60rem; padding: 0px;">https://docs.microsoft.com/en-us/azure/azure-monitor/app/sampling</p></div></div>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-53183892302741353192021-05-20T10:52:00.001+02:002021-05-20T10:52:34.974+02:00Azure Active Directory Commands<p>You may request to read registrations in AAD even if you have not enough permissions to do that from the Azure Portal. You can, for example request the name of the groups you are in, or even the members of a group or an application.</p><p>First thing you need to do in PowerShell is to make sure you have Azure AD module installed. Then you need to log into your Azure AD</p><p><span class="token token" style="background-color: #f4f5f7; color: #505f79; font-family: var(--code-font-family-italic); font-size: 14px; font-style: italic; white-space: pre;">## Connect to Azure AD<br /></span><span style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;"></span><span class="token token" style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;">Connect-AzureAD</span><span style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;">
</span><span class="linenumber react-syntax-highlighter-line-number" style="background-color: #f4f5f7; box-sizing: border-box; color: #505f79; display: block; flex-shrink: 0; font-family: var(--code-font-family-italic); font-size: 14px; font-style: italic; margin-right: 8px; min-width: calc(2ch + 16px); padding-left: 8px; padding-right: 8px; text-align: right; user-select: none; white-space: pre;"><br /></span><span style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;"></span><span class="token token" style="background-color: #f4f5f7; color: #505f79; font-family: var(--code-font-family-italic); font-size: 14px; font-style: italic; white-space: pre;"># In case Connect-AzureAD is not recognized as a cpommandlet, install it:<br /></span><span style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;"></span><span class="token token" style="background-color: #f4f5f7; color: #505f79; font-family: var(--code-font-family-italic); font-size: 14px; font-style: italic; white-space: pre;"># Install-Module AzureAD -Force</span></p><p>Now you can query the AAD. The following are some samples:</p><p><span class="token token" style="background-color: #f4f5f7; color: #505f79; font-family: var(--code-font-family-italic); font-size: 14px; font-style: italic; white-space: pre;"># Get the name of applications that I have been part of?<br /></span><span style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;"></span><span class="token token" style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;">Get-AzureADUser</span><span style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;"> </span><span class="token token" style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;">-</span><span style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;">SearchString </span><span class="token token" style="background-color: #f4f5f7; color: #006644; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;">"Pouya Panahy"</span><span style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;"> </span><span class="token token" style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;">|</span><span style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;"> </span><span class="token token" style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;">Get-AzureADUserAppRoleAssignment</span><span style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;"> </span><span class="token token" style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;">-</span><span style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;">All </span><span class="token token" style="background-color: #f4f5f7; color: #0747a6; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;">$true</span></p><p><span class="token token" style="background-color: #f4f5f7; color: #0747a6; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;"><span class="token token" style="color: #172b4d;"><i># Get the list of groups that I am part of</i>
Get-AzureADUser</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">-</span><span style="color: #172b4d;">SearchString </span><span class="token token" style="color: #006644;">"Pouya Panahy"</span><span style="color: #172b4d;"> `
</span><span class="token token" style="color: #172b4d;"> |</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">Get-AzureADUserMembership</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">-</span><span style="color: #172b4d;">All </span><span class="token token">$true</span><span style="color: #172b4d;"> `
</span><span class="token token" style="color: #172b4d;"> |</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">Sort-Object</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">-</span><span style="color: #172b4d;">Property DisplayName </span></span></p><p><span class="token token" style="background-color: #f4f5f7; color: #0747a6; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;"><span class="token token" style="color: #172b4d;"><i># Where am I direct descendent from</i>
Get-AzRoleAssignment</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">-</span><span style="color: #172b4d;">SignInName </span><span class="token token" style="color: #006644;">'p.panahy@company.nl'</span></span></p><p><span class="token token" style="background-color: #f4f5f7; color: #0747a6; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;"><span class="token token" style="color: #172b4d;"><i># Show all rights I've got
</i>Get-AzRoleAssignment</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">-</span><span style="color: #172b4d;">SignInName </span><span class="token token" style="color: #006644;">'p.panahy@company.nl'</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">-</span><span style="color: #172b4d;">ExpandPrincipalGroups `</span><span style="color: #172b4d;"><br /></span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">|</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">Sort-Object</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">-</span><span style="color: #172b4d;">Property DisplayName `<br /></span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">|</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">Select-Object</span><span style="color: #172b4d;"> ObjectType</span><span class="token token" style="color: #172b4d;">,</span><span style="color: #172b4d;"> RoleDefinitionName</span><span class="token token" style="color: #172b4d;">,</span><span style="color: #172b4d;"> DisplayName</span><span class="token token" style="color: #172b4d;">,</span><span style="color: #172b4d;"> Scope `<br /></span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">|</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">Format-Table</span></span></p><p><span class="token token" style="background-color: #f4f5f7; color: #0747a6; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;"><span class="token token" style="color: #172b4d;"><i># Is my application registered?
</i>Get-AzureADUser</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">-</span><span style="color: #172b4d;">SearchString </span><span class="token token" style="color: #006644;">"Pouya Panahy"</span><span style="color: #172b4d;"> `</span><span style="color: #172b4d;"><br /></span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">|</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">Get-AzureADUserCreatedObject</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">-</span><span style="color: #172b4d;">All </span><span class="token token">$true</span><span style="color: #172b4d;"> `</span><span style="color: #172b4d;"><br /></span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">|</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">Sort-Object</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">-</span><span style="color: #172b4d;">Property ObjectType `</span><span style="color: #172b4d;"><br /></span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">|</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">Select-Object</span><span style="color: #172b4d;"> ObjectType</span><span class="token token" style="color: #172b4d;">,</span><span style="color: #172b4d;"> AppId</span><span class="token token" style="color: #172b4d;">,</span><span style="color: #172b4d;"> DisplayName</span><span class="token token" style="color: #172b4d;">,</span><span style="color: #172b4d;"> HomePage</span><span class="token token" style="color: #172b4d;">,</span><span style="color: #172b4d;"> IdentifierUris `</span><span style="color: #172b4d;"><br /></span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">|</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">Format-Table</span></span></p><p><span class="token token" style="background-color: #f4f5f7; color: #0747a6; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;"><span class="token token" style="color: #172b4d;"><i># Looking for an application that some one else have registered
</i>Get-AzureADServicePrincipal</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">-</span><span style="color: #172b4d;">All </span><span class="token token">$true</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">-</span><span class="token token" style="color: #0052cc; font-weight: bolder;">Filter</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #006644;">"startswith(DisplayName, 'AppName')"</span></span></p><p><span class="token token" style="background-color: #f4f5f7; color: #0747a6; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;"><span class="token token" style="color: #172b4d;"><i># Who has access to my resources in a given resource group?
</i>Get-AzRoleAssignment</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">-</span><span style="color: #172b4d;">Scope </span><span class="token token" style="color: #006644;">"/subscriptions/xxxxxxxx-xxxx-xxxx-dxxx-xxxxxxxxxxxx/resourceGroups/res-grp-name"</span><span style="color: #172b4d;"> `</span><span style="color: #172b4d;"><br /></span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">|</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">Sort-Object</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">-</span><span style="color: #172b4d;">Property RoleDefinitionName</span><span class="token token" style="color: #172b4d;">,</span><span style="color: #172b4d;"> DisplayName `</span><span style="color: #172b4d;"><br /></span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">|</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">Select-Object</span><span style="color: #172b4d;"> ObjectType</span><span class="token token" style="color: #172b4d;">,</span><span style="color: #172b4d;"> RoleDefinitionName</span><span class="token token" style="color: #172b4d;">,</span><span style="color: #172b4d;"> DisplayName</span><span class="token token" style="color: #172b4d;">,</span><span style="color: #172b4d;"> Scope `</span><span style="color: #172b4d;"><br /></span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">|</span><span style="color: #172b4d;"> </span><span class="token token" style="color: #172b4d;">Format-Table</span></span></p><p><span class="token token" style="background-color: #f4f5f7;"><span class="token token" style="font-size: 14px; white-space: pre;"><span style="color: #172b4d; font-family: SFMono-Medium, SF Mono, Segoe UI Mono, Roboto Mono, Ubuntu Mono, Menlo, Consolas, Courier, monospace;"><i># List the members of a group
</i>Get-AzureAdGroup -All $true -SearchString 'Group Name' | Get-AzureADGroupMember </span></span></span></p>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-37107892691537187562021-05-14T17:45:00.001+02:002021-05-16T13:16:10.232+02:00OWASP test in Release Pipeline<p> In this page we are going to add some tasks in Azure Release pipeline to do the tests.</p><h2 style="text-align: left;">Prerequisites</h2><p>There is already a docker image containing Zap2 files and a Python file called <span style="font-family: courier;">zap-baseline.py </span>to run the process. The image is called owasp/zap2docker-stable requires a shared folder to put the report in it. To mount a file share I use a storage account in azure containing the shared location called <b>security</b>. I generate the Key to access the shared location and start the process.</p><p>When process has been completed you need to have a file called OWASPToNUnit3.xslt to convert the report into an NUnit file that can be published as a test result.</p><h4 style="text-align: left;">OWASP Stage Tasks</h4><p> There are 3 tasks in this stage:</p><p></p><ol style="text-align: left;"><li>OWASP in Azure CLI <br />which stes up a Container Instance that runs the tests<br /><br /></li><li> Transforming PowerShell Script<br />which uses a PowerShell script to transform the result into NUnit<br /><br /></li><li>Publish Test Results<br />which makes the result visible in the pipeline as Test Results</li></ol><h3 style="text-align: left;">Stage Tasks Yaml</h3><div><span style="background-color: white; font-size: 14px; white-space: pre;"><span style="font-family: courier;">steps:
- task: AzureCLI@2
displayName: 'OWASP in Azure CLI '
inputs:
azureSubscription: 'Owasp_grp_sp'
scriptType: ps
scriptLocation: inlineScript
inlineScript: |
$key='"<b>the-Key-to-Storage-Account-shared-location==</b>"'
$ZAP_COMMAND="/zap/<b>zap-baseline.py</b> -t """"<b>https://the-url-to-test.something</b>"""" -x OWASP-ZAP-Report.xml"
az container create </span></span><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;">`</span></div><div><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;"> </span><span style="background-color: white;"><span style="font-family: courier;"><span style="font-size: 14px; white-space: pre;">--resource-group owasp_grp </span></span></span><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;">`</span></div><div><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;"> </span><span style="background-color: white; font-size: 14px; white-space: pre;"><span style="font-family: courier;">--name owasp `
--image owasp/zap2docker-stable `
--ip-address public </span></span><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;">`</span></div><div><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;"> </span><span style="background-color: white; font-size: 14px; white-space: pre;"><span style="font-family: courier;">--ports 8080 </span></span><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;">`</span></div><div><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;"> </span><span style="background-color: white; font-size: 14px; white-space: pre;"><span style="font-family: courier;">--azure-file-volume-account-name owaspstore1000 </span></span><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;">`</span></div><div><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;"> </span><span style="background-color: white; font-size: 14px; white-space: pre;"><span style="font-family: courier;">--azure-file-volume-account-key $key </span></span><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;">`</span></div><div><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;"> </span><span style="background-color: white; font-size: 14px; white-space: pre;"><span style="font-family: courier;">--azure-file-volume-share-name security </span></span><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;">`</span></div><div><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;"> </span><span style="background-color: white; font-size: 14px; white-space: pre;"><span style="font-family: courier;">--azure-file-volume-mount-path /zap/wrk/ </span></span><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;">`</span></div><div><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;"> </span><span style="background-color: white; font-size: 14px; white-space: pre;"><span style="font-family: courier;">--command-line $ZAP_COMMAND
az storage file download </span></span><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;">`</span></div><div><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;"> </span><span style="background-color: white; font-size: 14px; white-space: pre;"><span style="font-family: courier;">--account-name owaspstore1000 </span></span><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;">`</span></div><div><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;"> </span><span style="background-color: white; font-size: 14px; white-space: pre;"><span style="font-family: courier;">--account-key $key </span></span><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;">`</span></div><div><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;"> </span><span style="background-color: white; font-size: 14px; white-space: pre;"><span style="font-family: courier;">-s security </span></span><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;">`</span></div><div><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;"> </span><span style="background-color: white; font-size: 14px; white-space: pre;"><span style="font-family: courier;">-p OWASP-ZAP-Report.xml </span></span><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;">`</span></div><div><span style="background-color: white; font-family: courier; font-size: 14px; white-space: pre;"> </span><span style="background-color: white; font-size: 14px; white-space: pre;"><span style="font-family: courier;">--dest %SYSTEM_DEFAULTWORKINGDIRECTORY%\OWASP-ZAP-Report.xml
</span></span></div><div><span style="font-family: courier;"><span style="background-color: white; font-size: 14px; white-space: pre;">- powershell: |
## The powershell task for converting the test report
$XslPath = "$($Env:SYSTEM_DEFAULTWORKINGDIRECTORY)\_Managed-Security/<b>OWASPToNUnit3.xslt</b>"
$XmlInputPath = "$($Env:SYSTEM_DEFAULTWORKINGDIRECTORY)\OWASP-ZAP-Report.xml"
$XmlOutputPath = "$($Env:SYSTEM_DEFAULTWORKINGDIRECTORY)\Converted-OWASP-ZAP-Report.xml"
$XslTransform = New-Object System.Xml.Xsl.XslCompiledTransform
$XslTransform.Load($XslPath)
$XslTransform.Transform($XmlInputPath, $XmlOutputPath)
displayName: 'Transforming PowerShell Script'</span><span style="background-color: white; font-size: 14px; white-space: pre;">
</span></span></div><div><span style="background-color: white; font-size: 14px; white-space: pre;"><span style="font-family: courier;"><br /></span></span></div><div><span style="font-family: courier;"><span style="background-color: white; font-size: 14px; white-space: pre;">- task: PublishTestResults@2
displayName: 'Publish Test Results Converted-OWASP-ZAP-Report.xml'
inputs:
testResultsFormat: NUnit
testResultsFiles: 'Converted-OWASP-ZAP-Report.xml'</span><span style="background-color: white; font-size: 14px; white-space: pre;">
</span></span></div><div><span style="background-color: white; font-family: "Segoe UI VSS (Regular)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Helvetica, Ubuntu, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px; white-space: pre;"><br /></span></div><p></p>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-17251264188845847542021-05-12T17:19:00.015+02:002021-05-14T17:23:56.933+02:00Docker and Webapp<p> <span style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">In this page we will create a WebApp that serves a Docker image and see how to put it in CI/CD.</span></p><h2 data-renderer-start-pos="100" id="Create-a-Web-App" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1.43em; font-weight: normal; letter-spacing: -0.008em; line-height: 1.2; margin: 1.8em 0px 0px; padding: 0px; white-space: pre-wrap;">Create a Web App<span class="heading-anchor-wrapper" role="presentation" style="height: 1.2em; margin-left: 6px; position: absolute;"><button class="sc-eXEjpC rYMDH" style="border-color: initial; border-style: none; border-width: initial; color: #42526e; cursor: pointer; display: inline; font-family: inherit; opacity: 0; outline: none; padding-left: 0px; padding-right: 0px; right: 0px; transform: translate(-8px, 0px); transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;"><span aria-label="copy" class="css-1i2mldy" role="img" style="display: inline-block; flex-shrink: 0; height: 24px; line-height: 1; width: 24px;"><svg height="24" role="presentation" viewbox="0 0 24 24" width="24"><g fill-rule="evenodd" fill="currentColor"><path d="M12.856 5.457l-.937.92a1.002 1.002 0 000 1.437 1.047 1.047 0 001.463 0l.984-.966c.967-.95 2.542-1.135 3.602-.288a2.54 2.54 0 01.203 3.81l-2.903 2.852a2.646 2.646 0 01-3.696 0l-1.11-1.09L9 13.57l1.108 1.089c1.822 1.788 4.802 1.788 6.622 0l2.905-2.852a4.558 4.558 0 00-.357-6.82c-1.893-1.517-4.695-1.226-6.422.47"></path><path d="M11.144 19.543l.937-.92a1.002 1.002 0 000-1.437 1.047 1.047 0 00-1.462 0l-.985.966c-.967.95-2.542 1.135-3.602.288a2.54 2.54 0 01-.203-3.81l2.903-2.852a2.646 2.646 0 013.696 0l1.11 1.09L15 11.43l-1.108-1.089c-1.822-1.788-4.802-1.788-6.622 0l-2.905 2.852a4.558 4.558 0 00.357 6.82c1.893 1.517 4.695 1.226 6.422-.47"></path></g></svg></span></button></span></h2><p data-renderer-start-pos="118" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">If you are creating a web app in Azure portal, start with selecting <strong data-renderer-mark="true">Docker Container</strong> as Publish property in Basics tab. Choose <strong data-renderer-mark="true">Linux</strong> as Operating System. For this example a <strong data-renderer-mark="true">Standard SKU</strong> would just do fine.<br />Next, on the Docker-tab select your existing <a class="sc-gFaPwZ pTAJq" data-renderer-mark="true" href="http://azurecr.io/" style="color: #0052cc; text-decoration-line: none;" title="http://azurecr.io">azurecr.io</a> container registry and specify the <strong data-renderer-mark="true">Image:Tag </strong> you want to serve. </p><p data-renderer-start-pos="447" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">My tempate looks something inline with the following:</p><p data-renderer-start-pos="447" style="background-color: white; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px;"><span style="color: #6554c0; font-family: SFMono-Medium, SF Mono, Segoe UI Mono, Roboto Mono, Ubuntu Mono, Menlo, Consolas, Courier, monospace;"><span style="font-size: 14px; white-space: pre;">"resources": [
{
"apiVersion": "2018-11-01",
"name": "[parameters('name')]",
"type": "Microsoft.Web/sites",
"location": "[parameters('location')]",
"tags": {},
"dependsOn": [
"[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
],
"properties": {
"name": "[parameters('name')]",
"siteConfig": {
"appSettings": [
{
"name": "DOCKER_REGISTRY_SERVER_URL",
"value": "[parameters('dockerRegistryUrl')]"
},
{
"name": "DOCKER_REGISTRY_SERVER_USERNAME",
"value": "[parameters('dockerRegistryUsername')]"
},
{
"name": "DOCKER_REGISTRY_SERVER_PASSWORD",
"value": "[parameters('dockerRegistryPassword')]"
},
{
"name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE",
"value": "false"
}
],
"linuxFxVersion": "[parameters('linuxFxVersion')]",
"appCommandLine": "",
"alwaysOn": "[parameters('alwaysOn')]"
},
"serverFarmId": "[concat('/subscriptions/', parameters('subscriptionId'),'/resourcegroups/', parameters('serverFarmResourceGroup'), '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]",
"clientAffinityEnabled": false
}
},
{
"apiVersion": "2018-11-01",
"name": "[parameters('hostingPlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "West Europe",
"kind": "linux",
"tags": {},
"dependsOn": [],
"properties": {
"perSiteScaling": false,
"maximumElasticWorkerCount": 1,
"isSpot": false,
"reserved": true,
"isXenon": false,
"hyperV": false,
"targetWorkerCount": 0,
"targetWorkerSizeId": 0
},
"sku": {
"Tier": "Standard",
"Name": "S1",
"size": "S1",
"family": "S",
"capacity": 1
}
}</span></span></p><p data-renderer-start-pos="447" style="background-color: white; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px;"><span style="background-color: #deebff; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">As a </span><u data-renderer-mark="true" style="background-color: #deebff; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">security matter</u><span style="background-color: #deebff; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;"> I have to point out the fact that the Web App is connecting to Azure Container Registry using 3 configuration items i.e. Server Url, Server Username and Server </span><strong data-renderer-mark="true" style="background-color: #deebff; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">Password</strong><span style="background-color: #deebff; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">. These items are visible in Azure Portal Configuration:</span><br style="background-color: #deebff; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;" /><span class="code" data-renderer-mark="true" style="-webkit-box-decoration-break: clone; background-color: rgba(9, 30, 66, 0.08); border-radius: 3px; border-style: none; box-shadow: rgba(9, 30, 66, 0.08) -4px 0px 0px 0px, rgba(9, 30, 66, 0.08) 4px 0px 0px 0px; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 13.712px; letter-spacing: -0.08px; margin: 0px 4px; overflow: auto; padding: 2px 0px; white-space: pre-wrap;">DOCKER_REGISTRY_SERVER_URL</span><span style="background-color: #deebff; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">, </span><span class="code" data-renderer-mark="true" style="-webkit-box-decoration-break: clone; background-color: rgba(9, 30, 66, 0.08); border-radius: 3px; border-style: none; box-shadow: rgba(9, 30, 66, 0.08) -4px 0px 0px 0px, rgba(9, 30, 66, 0.08) 4px 0px 0px 0px; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 13.712px; letter-spacing: -0.08px; margin: 0px 4px; overflow: auto; padding: 2px 0px; white-space: pre-wrap;">DOCKER_REGISTRY_SERVER_USERNAME</span><span style="background-color: #deebff; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">, </span><span class="code" data-renderer-mark="true" style="-webkit-box-decoration-break: clone; background-color: rgba(9, 30, 66, 0.08); border-radius: 3px; border-style: none; box-shadow: rgba(9, 30, 66, 0.08) -4px 0px 0px 0px, rgba(9, 30, 66, 0.08) 4px 0px 0px 0px; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 13.712px; letter-spacing: -0.08px; margin: 0px 4px; overflow: auto; padding: 2px 0px; white-space: pre-wrap;">DOCKER_REGISTRY_SERVER_PASSWORD</span></p><h2 data-renderer-start-pos="3449" id="Deploy-Docker-Image" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1.43em; font-weight: normal; letter-spacing: -0.008em; line-height: 1.2; margin: 1.8em 0px 0px; padding: 0px; white-space: pre-wrap;">Deploy Docker Image<span class="heading-anchor-wrapper" role="presentation" style="height: 1.2em; margin-left: 6px; position: absolute;"><button class="sc-eXEjpC rYMDH" style="border-color: initial; border-style: none; border-width: initial; color: #42526e; cursor: pointer; display: inline; font-family: inherit; opacity: 0; outline: none; padding-left: 0px; padding-right: 0px; right: 0px; transform: translate(-8px, 0px); transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;"><span aria-label="copy" class="css-1i2mldy" role="img" style="display: inline-block; flex-shrink: 0; height: 24px; line-height: 1; width: 24px;"><svg height="24" role="presentation" viewbox="0 0 24 24" width="24"><g fill-rule="evenodd" fill="currentColor"><path d="M12.856 5.457l-.937.92a1.002 1.002 0 000 1.437 1.047 1.047 0 001.463 0l.984-.966c.967-.95 2.542-1.135 3.602-.288a2.54 2.54 0 01.203 3.81l-2.903 2.852a2.646 2.646 0 01-3.696 0l-1.11-1.09L9 13.57l1.108 1.089c1.822 1.788 4.802 1.788 6.622 0l2.905-2.852a4.558 4.558 0 00-.357-6.82c-1.893-1.517-4.695-1.226-6.422.47"></path><path d="M11.144 19.543l.937-.92a1.002 1.002 0 000-1.437 1.047 1.047 0 00-1.462 0l-.985.966c-.967.95-2.542 1.135-3.602.288a2.54 2.54 0 01-.203-3.81l2.903-2.852a2.646 2.646 0 013.696 0l1.11 1.09L15 11.43l-1.108-1.089c-1.822-1.788-4.802-1.788-6.622 0l-2.905 2.852a4.558 4.558 0 00.357 6.82c1.893 1.517 4.695 1.226 6.422-.47"></path></g></svg></span></button></span></h2><p data-renderer-start-pos="3470" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">In both cases where the Docker image gets pulled from Container Registry, you need to <strong data-renderer-mark="true">restart the instance </strong>in Container Instance and also in Web App Docker instance.</p><p data-renderer-start-pos="447" style="background-color: white; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px;"><span class="code" data-renderer-mark="true" style="-webkit-box-decoration-break: clone; background-color: rgba(9, 30, 66, 0.08); border-radius: 3px; border-style: none; box-shadow: rgba(9, 30, 66, 0.08) -4px 0px 0px 0px, rgba(9, 30, 66, 0.08) 4px 0px 0px 0px; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 13.712px; letter-spacing: -0.08px; margin: 0px 4px; overflow: auto; padding: 2px 0px; white-space: pre-wrap;"></span></p><p data-renderer-start-pos="3637" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">An other option would be to move the pull task into Azure Pipeline using. My example is defined as follows:</p><p data-renderer-start-pos="3637" style="background-color: white; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px;"><span style="color: #172b4d; font-family: courier;"><span style="letter-spacing: -0.08px; white-space: pre-wrap;">steps:
- task: AzureRmWebAppDeployment@4
displayName: 'Deploy Azure App Service'
inputs:
azureSubscription: '$(Parameters.ConnectedServiceName)'
appType: 'Web App for Containers (Linux)'
WebAppName: '$(Parameters.WebAppName)'
DockerNamespace: 'https://securedcontainerregistry.azurecr.io'
DockerRepository: 'https://securedcontainerregistry.azurecr.io/securedazurelib'
DockerImageTag: 'latest'
StartupCommand: ''
</span></span></p><div><br /></div>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-58930267742075753962021-05-10T17:06:00.010+02:002021-05-14T17:23:14.159+02:00Docker and Container Registry in Azure<p> <span face="-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif" style="background-color: white; color: #172b4d; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">The purpose of this page is to show the steps to create a simple webapp running as a docker container in Azure.</span></p><div data-layout-section="true" style="background-color: white; clear: both; display: flex; flex-direction: row; margin: 20px 0px 0px; padding: 0px;"><div data-column-width="66.66" data-layout-column="true" style="flex: 1 1 66.66%; margin: 0px; min-width: 0px; padding: 0px;"><div class="sc-kfGgVZ jkDYQF" style="margin: 0px; padding: 0px; position: relative; width: 902.672px;"><h2 data-renderer-start-pos="116" id="Create-Container-Registry" style="color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1.43em; font-style: inherit; font-weight: normal; letter-spacing: -0.008em; line-height: 1.2; margin: 1.8em 0px 0px; padding: 0px; white-space: pre-wrap;">Create Container Registry<span class="heading-anchor-wrapper" role="presentation" style="height: 1.2em; margin-left: 6px; position: absolute;"><button class="sc-eXEjpC rYMDH" style="border-color: initial; border-style: none; border-width: initial; color: #42526e; cursor: pointer; display: inline; font-family: inherit; opacity: 0; outline: none; padding-left: 0px; padding-right: 0px; right: 0px; transform: translate(-8px, 0px); transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;"><span aria-label="copy" class="css-1i2mldy" role="img" style="display: inline-block; flex-shrink: 0; height: 24px; line-height: 1; width: 24px;"><svg height="24" role="presentation" viewbox="0 0 24 24" width="24"><g fill-rule="evenodd" fill="currentColor"><path d="M12.856 5.457l-.937.92a1.002 1.002 0 000 1.437 1.047 1.047 0 001.463 0l.984-.966c.967-.95 2.542-1.135 3.602-.288a2.54 2.54 0 01.203 3.81l-2.903 2.852a2.646 2.646 0 01-3.696 0l-1.11-1.09L9 13.57l1.108 1.089c1.822 1.788 4.802 1.788 6.622 0l2.905-2.852a4.558 4.558 0 00-.357-6.82c-1.893-1.517-4.695-1.226-6.422.47"></path><path d="M11.144 19.543l.937-.92a1.002 1.002 0 000-1.437 1.047 1.047 0 00-1.462 0l-.985.966c-.967.95-2.542 1.135-3.602.288a2.54 2.54 0 01-.203-3.81l2.903-2.852a2.646 2.646 0 013.696 0l1.11 1.09L15 11.43l-1.108-1.089c-1.822-1.788-4.802-1.788-6.622 0l-2.905 2.852a4.558 4.558 0 00.357 6.82c1.893 1.517 4.695 1.226 6.422-.47"></path></g></svg></span></button></span></h2><p data-renderer-start-pos="143" style="color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">I am using a new Azure Container Registry in my resource group called SecuredContainerRegistry which I will refer to throughout this page. I have created this using a Basic SKU which is sufficient enough for this purpose. If you need a <strong data-renderer-mark="true">private endpoint</strong> you need to change he SKU to premium.</p><p data-renderer-start-pos="143" style="font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;"><span class="token token" face="SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace" style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;"><span face="SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace" style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">"resources": [
{
"type": "Microsoft.ContainerRegistry/registries",
"apiVersion": "2020-11-01-preview",
"name": "SecuredContainerRegistry",
"location": "[resourceGroup().location]",
"dependsOn": [],
"tags": "[variables('tagsArray')]",
"sku": {
"name": "Basic",
"tier": "Basic"
},
"properties": {
"adminUserEnabled": true,
"publicNetworkAccess": "Enabled",
"zoneRedundancy": "Disabled"
}
}</span><span style="color: #006644;"><b>
</b></span></span><br /></p><p data-renderer-start-pos="1040" style="color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">The main change after creating the Container Registry using Default options is to <strong data-renderer-mark="true">enable Admin user</strong> which allows us to login used by docker.</p><p data-renderer-start-pos="1182" style="color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">Next important change we do on this resource is to register this resource in AAD by giving it a <strong data-renderer-mark="true">System assigned Identity</strong> using the portal.</p><h2 data-renderer-start-pos="1322" id="Add-Service-connection" style="color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1.43em; font-style: inherit; font-weight: normal; letter-spacing: -0.008em; line-height: 1.2; margin: 1.8em 0px 0px; padding: 0px; white-space: pre-wrap;">Add Service connection<span class="heading-anchor-wrapper" role="presentation" style="height: 1.2em; margin-left: 6px; position: absolute;"><button class="sc-eXEjpC rYMDH" style="border-color: initial; border-style: none; border-width: initial; color: #42526e; cursor: pointer; display: inline; font-family: inherit; opacity: 0; outline: none; padding-left: 0px; padding-right: 0px; right: 0px; transform: translate(-8px, 0px); transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;"><span aria-label="copy" class="css-1i2mldy" role="img" style="display: inline-block; flex-shrink: 0; height: 24px; line-height: 1; width: 24px;"><svg height="24" role="presentation" viewbox="0 0 24 24" width="24"><g fill-rule="evenodd" fill="currentColor"><path d="M12.856 5.457l-.937.92a1.002 1.002 0 000 1.437 1.047 1.047 0 001.463 0l.984-.966c.967-.95 2.542-1.135 3.602-.288a2.54 2.54 0 01.203 3.81l-2.903 2.852a2.646 2.646 0 01-3.696 0l-1.11-1.09L9 13.57l1.108 1.089c1.822 1.788 4.802 1.788 6.622 0l2.905-2.852a4.558 4.558 0 00-.357-6.82c-1.893-1.517-4.695-1.226-6.422.47"></path><path d="M11.144 19.543l.937-.92a1.002 1.002 0 000-1.437 1.047 1.047 0 00-1.462 0l-.985.966c-.967.95-2.542 1.135-3.602.288a2.54 2.54 0 01-.203-3.81l2.903-2.852a2.646 2.646 0 013.696 0l1.11 1.09L15 11.43l-1.108-1.089c-1.822-1.788-4.802-1.788-6.622 0l-2.905 2.852a4.558 4.558 0 00.357 6.82c1.893 1.517 4.695 1.226 6.422-.47"></path></g></svg></span></button></span></h2><p data-renderer-start-pos="1346" style="color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">Next you need to add a service connection in your Azure Devops project using <strong data-renderer-mark="true">service principal authentication</strong> that to get access to Azure Container Registry. In the popup select <em data-renderer-mark="true">Azure Container registery</em> as Registry type, then select your azure container registry and give the service connection a name.</p></div></div><div data-column-width="33.33" data-layout-column="true" style="color: #172b4d; flex: 1 1 33.33%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; margin: 0px 0px 0px 32px; min-width: 0px; padding: 0px; white-space: pre-wrap;"><div class="sc-kfGgVZ jkDYQF" style="margin: 0px; padding: 0px; position: relative; width: 451.328px;"><div style="margin: 0px; padding: 0px; position: absolute; width: 451.328px;"></div><div class="sc-ibxdXY kHcKFC" style="margin: 0px; padding: 0px;"></div><p data-renderer-start-pos="1670" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px;"> </p></div></div></div><h2 data-renderer-start-pos="1687" id="Buid-and-Deploy-Docker-project" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1.43em; font-weight: normal; letter-spacing: -0.008em; line-height: 1.2; margin: 1.8em 0px 0px; padding: 0px; white-space: pre-wrap;">Buid and Deploy Docker project<span class="heading-anchor-wrapper" role="presentation" style="height: 1.2em; margin-left: 6px; position: absolute;"><button class="sc-eXEjpC rYMDH" style="border-color: initial; border-style: none; border-width: initial; color: #42526e; cursor: pointer; display: inline; font-family: inherit; opacity: 0; outline: none; padding-left: 0px; padding-right: 0px; right: 0px; transform: translate(-8px, 0px); transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;"><span aria-label="copy" class="css-1i2mldy" role="img" style="display: inline-block; flex-shrink: 0; height: 24px; line-height: 1; width: 24px;"><svg height="24" role="presentation" viewbox="0 0 24 24" width="24"><g fill-rule="evenodd" fill="currentColor"><path d="M12.856 5.457l-.937.92a1.002 1.002 0 000 1.437 1.047 1.047 0 001.463 0l.984-.966c.967-.95 2.542-1.135 3.602-.288a2.54 2.54 0 01.203 3.81l-2.903 2.852a2.646 2.646 0 01-3.696 0l-1.11-1.09L9 13.57l1.108 1.089c1.822 1.788 4.802 1.788 6.622 0l2.905-2.852a4.558 4.558 0 00-.357-6.82c-1.893-1.517-4.695-1.226-6.422.47"></path><path d="M11.144 19.543l.937-.92a1.002 1.002 0 000-1.437 1.047 1.047 0 00-1.462 0l-.985.966c-.967.95-2.542 1.135-3.602.288a2.54 2.54 0 01-.203-3.81l2.903-2.852a2.646 2.646 0 013.696 0l1.11 1.09L15 11.43l-1.108-1.089c-1.822-1.788-4.802-1.788-6.622 0l-2.905 2.852a4.558 4.558 0 00.357 6.82c1.893 1.517 4.695 1.226 6.422-.47"></path></g></svg></span></button></span></h2><p data-renderer-start-pos="1719" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">Create a .net core application including a Dockerfile for windows. When you choose in Visual Studio it generates a Dockerfile which is not completely working. The following example is changed version of that file which works fine:</p><div class="code-block sc-cBdUnI dbtRcB" style="background-color: white; border-radius: 3px; clear: both; display: grid; grid-template-columns: minmax(0px, 1fr); margin: 0.75rem 0px 0px; max-width: 100%; overflow-wrap: normal; padding: 0px; position: relative; tab-size: 4;"><span class="sc-gVLVqr infAcJ" style="-webkit-box-pack: end; color: #172b4d; display: flex; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; grid-column: 1 / auto; justify-content: flex-end; position: sticky; top: 0px; white-space: pre-wrap;"><div role="presentation" style="margin: 0px; padding: 0px;"><div style="margin: 0px; padding: 0px;"><button aria-haspopup="true" aria-label="Copy" class="copy-to-clipboard css-1dgloit" style="-webkit-box-align: baseline; -webkit-box-pack: center; align-items: baseline; background: none rgb(244, 245, 247); border-color: rgb(255, 255, 255); border-radius: 4px; border-style: solid; color: #42526e; cursor: pointer; display: flex; font-family: inherit; font-size: inherit; height: 32px; justify-content: center; line-height: 1.71429em; max-width: 100%; opacity: 0; outline: none; padding: 2px; position: absolute; right: 6px; top: 4px; transition: opacity 0.2s ease 0s; vertical-align: middle; white-space: nowrap; width: 32px;" tabindex="0" type="button"><span class="css-1ujqpe8" style="-webkit-box-flex: 0; align-self: center; display: flex; flex-grow: 0; flex-shrink: 0; font-size: 0px; line-height: 0; margin: 0px 2px; opacity: 1; transition: opacity 0.3s ease 0s; user-select: none;"><span aria-label="Copy" class="css-1w1m1we" role="img" style="display: inline-block; flex-shrink: 0; line-height: 1;"><svg height="24" role="presentation" viewbox="0 0 24 24" width="24"><g fill="currentColor"><path d="M10 19h8V8h-8v11zM8 7.992C8 6.892 8.902 6 10.009 6h7.982C19.101 6 20 6.893 20 7.992v11.016c0 1.1-.902 1.992-2.009 1.992H10.01A2.001 2.001 0 018 19.008V7.992z"></path><path d="M5 16V4.992C5 3.892 5.902 3 7.009 3H15v13H5zm2 0h8V5H7v11z"></path></g></svg></span></span></button></div></div></span><div class="css-13pcb96" data-code-block="" style="--line-number-bg-color: #EBECF0; margin: 0px; padding: 0px; text-align: left;"><span face="var(--code-font-family)" style="--code-font-family-italic: SFMono-MediumItalic, var(--code-font-family); --code-font-family: "SFMono-Medium", "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; background-attachment: local, scroll, scroll; background-color: #f4f5f7; background-image: linear-gradient(to left, rgb(244, 245, 247) 8px, transparent 8px), linear-gradient(to left, rgba(9, 30, 66, 0.13) 0px, rgba(99, 114, 130, 0) 8px), linear-gradient(to right, rgba(9, 30, 66, 0.13) 0px, rgba(99, 114, 130, 0) 8px); background-position: 100% 0px, 100% 0px, 0px 0px; border-radius: 3px; display: flex; line-height: 24px; overflow-x: auto;"><code style="background-image: linear-gradient(to right,var(--line-number-bg-color),var(--line-number-bg-color) calc(2ch + 16px),transparent calc(2ch + 16px),transparent); flex: 1 0 auto; padding: 8px 0px;"><span class="linenumber react-syntax-highlighter-line-number" face="var(--code-font-family-italic)" style="box-sizing: border-box; color: #505f79; display: block; flex-shrink: 0; margin-left: 8px; min-width: calc(2ch + 16px); padding-left: 8px; padding-right: 8px; text-align: right; user-select: none;"><div style="text-align: left;"><div>#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.</div><div>#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.</div><div>#For more information, please see https://aka.ms/containercompat</div><div><br /></div><div>FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base</div><div>WORKDIR /app</div><div>EXPOSE 80</div><div>EXPOSE 443</div><div><br /></div><div>FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build</div><div>WORKDIR /src</div><div>COPY ["*.csproj", "SecuredWebApi/"]</div><div>RUN dotnet restore "SecuredWebApi/SecuredWebApi.csproj"</div><div>WORKDIR "/src/SecuredWebApi"</div><div>COPY . .</div><div>RUN dotnet build "SecuredWebApi.csproj" -c Release -o /app/build</div><div><br /></div><div>FROM build AS publish</div><div>RUN dotnet publish "SecuredWebApi.csproj" -c Release -o /app/publish</div><div><br /></div><div>FROM base AS final</div><div>WORKDIR /app</div><div>COPY --from=publish /app/publish .</div><div>ENTRYPOINT ["dotnet", "SecuredWebApi.dll"]</div></div></span></code></span></div></div><h2 data-renderer-start-pos="2859" id="Create-Container-Instance" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1.43em; font-weight: normal; letter-spacing: -0.008em; line-height: 1.2; margin: 1.8em 0px 0px; padding: 0px; white-space: pre-wrap;">Create Container Instance<span class="heading-anchor-wrapper" role="presentation" style="height: 1.2em; margin-left: 6px; position: absolute;"><button class="sc-eXEjpC rYMDH" style="border-color: initial; border-style: none; border-width: initial; color: #42526e; cursor: pointer; display: inline; font-family: inherit; opacity: 0; outline: none; padding-left: 0px; padding-right: 0px; right: 0px; transform: translate(-8px, 0px); transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;"><span aria-label="copy" class="css-1i2mldy" role="img" style="display: inline-block; flex-shrink: 0; height: 24px; line-height: 1; width: 24px;"><svg height="24" role="presentation" viewbox="0 0 24 24" width="24"><g fill-rule="evenodd" fill="currentColor"><path d="M12.856 5.457l-.937.92a1.002 1.002 0 000 1.437 1.047 1.047 0 001.463 0l.984-.966c.967-.95 2.542-1.135 3.602-.288a2.54 2.54 0 01.203 3.81l-2.903 2.852a2.646 2.646 0 01-3.696 0l-1.11-1.09L9 13.57l1.108 1.089c1.822 1.788 4.802 1.788 6.622 0l2.905-2.852a4.558 4.558 0 00-.357-6.82c-1.893-1.517-4.695-1.226-6.422.47"></path><path d="M11.144 19.543l.937-.92a1.002 1.002 0 000-1.437 1.047 1.047 0 00-1.462 0l-.985.966c-.967.95-2.542 1.135-3.602.288a2.54 2.54 0 01-.203-3.81l2.903-2.852a2.646 2.646 0 013.696 0l1.11 1.09L15 11.43l-1.108-1.089c-1.822-1.788-4.802-1.788-6.622 0l-2.905 2.852a4.558 4.558 0 00.357 6.82c1.893 1.517 4.695 1.226 6.422-.47"></path></g></svg></span></button></span></h2><p data-renderer-start-pos="2886" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">Next step is to create an Azure Container instance. In my example I gave it the name container-instance. During the creation you need to connect this to a container registry. You can choose Azure Container Registry created in the first step above. Once you have a successful build you will have an image available to associate it with it. Based on my sample project I named this instance <span class="code" data-renderer-mark="true" face="SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace" style="-webkit-box-decoration-break: clone; background-color: rgba(9, 30, 66, 0.08); border-radius: 3px; border-style: none; box-shadow: rgba(9, 30, 66, 0.08) -4px 0px 0px 0px, rgba(9, 30, 66, 0.08) 4px 0px 0px 0px; font-size: 13.712px; margin: 0px 4px; overflow: auto; padding: 2px 0px;">secured-container-instance</span> and Azure portal automatically recognizes the container registery when you select the Image Source from Azure Container Registry. For this project I exposed ports 80 and port 443</p><div class="code-block sc-cBdUnI dbtRcB" style="background-color: white; border-radius: 3px; clear: both; display: grid; grid-template-columns: minmax(0px, 1fr); margin: 0.75rem 0px 0px; max-width: 100%; overflow-wrap: normal; padding: 0px; position: relative; tab-size: 4;"><span class="sc-gVLVqr infAcJ" style="-webkit-box-pack: end; color: #172b4d; display: flex; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; grid-column: 1 / auto; justify-content: flex-end; position: sticky; top: 0px; white-space: pre-wrap;"><div role="presentation" style="margin: 0px; padding: 0px;"><div style="margin: 0px; padding: 0px;"><button aria-haspopup="true" aria-label="Copy" class="copy-to-clipboard css-1dgloit" style="-webkit-box-align: baseline; -webkit-box-pack: center; align-items: baseline; background: none rgb(244, 245, 247); border-color: rgb(255, 255, 255); border-radius: 4px; border-style: solid; color: #42526e; cursor: pointer; display: flex; font-family: inherit; font-size: inherit; height: 32px; justify-content: center; line-height: 1.71429em; max-width: 100%; opacity: 0; outline: none; padding: 2px; position: absolute; right: 6px; top: 4px; transition: opacity 0.2s ease 0s; vertical-align: middle; white-space: nowrap; width: 32px;" tabindex="0" type="button"><span class="css-1ujqpe8" style="-webkit-box-flex: 0; align-self: center; display: flex; flex-grow: 0; flex-shrink: 0; font-size: 0px; line-height: 0; margin: 0px 2px; opacity: 1; transition: opacity 0.3s ease 0s; user-select: none;"><span aria-label="Copy" class="css-1w1m1we" role="img" style="display: inline-block; flex-shrink: 0; line-height: 1;"><svg height="24" role="presentation" viewbox="0 0 24 24" width="24"><g fill="currentColor"><path d="M10 19h8V8h-8v11zM8 7.992C8 6.892 8.902 6 10.009 6h7.982C19.101 6 20 6.893 20 7.992v11.016c0 1.1-.902 1.992-2.009 1.992H10.01A2.001 2.001 0 018 19.008V7.992z"></path><path d="M5 16V4.992C5 3.892 5.902 3 7.009 3H15v13H5zm2 0h8V5H7v11z"></path></g></svg></span></span></button></div></div></span><div class="css-13pcb96" data-code-block="" style="--line-number-bg-color: #EBECF0; margin: 0px; padding: 0px; text-align: left;"><span data-code-lang="json" face="var(--code-font-family)" style="--code-font-family-italic: SFMono-MediumItalic, var(--code-font-family); --code-font-family: "SFMono-Medium", "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; background-attachment: local, scroll, scroll; background-color: #f4f5f7; background-image: linear-gradient(to left, rgb(244, 245, 247) 8px, transparent 8px), linear-gradient(to left, rgba(9, 30, 66, 0.13) 0px, rgba(99, 114, 130, 0) 8px), linear-gradient(to right, rgba(9, 30, 66, 0.13) 0px, rgba(99, 114, 130, 0) 8px); background-position: 100% 0px, 100% 0px, 0px 0px; border-radius: 3px; display: flex; line-height: 24px; overflow-x: auto;"><code style="background-image: linear-gradient(to right,var(--line-number-bg-color),var(--line-number-bg-color) calc(2ch + 16px),transparent calc(2ch + 16px),transparent); flex: 1 0 auto; padding: 8px 0px;"><span class="linenumber react-syntax-highlighter-line-number" face="var(--code-font-family-italic)" style="box-sizing: border-box; color: #505f79; display: block; flex-shrink: 0; margin-left: 8px; min-width: calc(2ch + 16px); padding-left: 8px; padding-right: 8px; text-align: left; user-select: none;"><span style="font-family: SFMono-Medium, SF Mono, Segoe UI Mono, Roboto Mono, Ubuntu Mono, Menlo, Consolas, Courier, monospace;"><span style="font-size: 14px; white-space: pre;"><i>"resources": [
{
"location": "westeurope",
"name": "secured-container-instance",
"type": "Microsoft.ContainerInstance/containerGroups",
"apiVersion": "2021-03-01",
"properties": {
"containers": [
{
"name": "secured-container-instance",
"properties": {
"image": "securedcontainerregistry.azurecr.io/securedazurelib:latest",
"resources": {
"requests": {
"cpu": "1",
"memoryInGB": "1.5"
}
},
"ports": [
{
"protocol": "TCP",
"port": 80
},
{
"protocol": "TCP",
"port": 443
}
],
}
}
],
"restartPolicy": "[parameters('restartPolicy')]",
"osType": "Linux",
"imageRegistryCredentials": [
{
"server": "securedcontainerregistry.azurecr.io",
"username": "[parameters('imageUsername')]",
"password": "[parameters('imagePassword')]"
}
],
"ipAddress": {
"type": "Public",
"ports": "80 (TCP), 443 (TCP)"
}
},
"tags": {}
}</i></span></span></span></code></span></div></div><h2 data-renderer-start-pos="5328" id="Start-the-instance" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1.43em; font-weight: normal; letter-spacing: -0.008em; line-height: 1.2; margin: 1.8em 0px 0px; padding: 0px; white-space: pre-wrap;">Start the instance<span class="heading-anchor-wrapper" role="presentation" style="height: 1.2em; margin-left: 6px; position: absolute;"><button class="sc-eXEjpC rYMDH" style="border-color: initial; border-style: none; border-width: initial; color: #42526e; cursor: pointer; display: inline; font-family: inherit; opacity: 0; outline: none; padding-left: 0px; padding-right: 0px; right: 0px; transform: translate(-8px, 0px); transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;"><span aria-label="copy" class="css-1i2mldy" role="img" style="display: inline-block; flex-shrink: 0; height: 24px; line-height: 1; width: 24px;"><svg height="24" role="presentation" viewbox="0 0 24 24" width="24"><g fill-rule="evenodd" fill="currentColor"><path d="M12.856 5.457l-.937.92a1.002 1.002 0 000 1.437 1.047 1.047 0 001.463 0l.984-.966c.967-.95 2.542-1.135 3.602-.288a2.54 2.54 0 01.203 3.81l-2.903 2.852a2.646 2.646 0 01-3.696 0l-1.11-1.09L9 13.57l1.108 1.089c1.822 1.788 4.802 1.788 6.622 0l2.905-2.852a4.558 4.558 0 00-.357-6.82c-1.893-1.517-4.695-1.226-6.422.47"></path><path d="M11.144 19.543l.937-.92a1.002 1.002 0 000-1.437 1.047 1.047 0 00-1.462 0l-.985.966c-.967.95-2.542 1.135-3.602.288a2.54 2.54 0 01-.203-3.81l2.903-2.852a2.646 2.646 0 013.696 0l1.11 1.09L15 11.43l-1.108-1.089c-1.822-1.788-4.802-1.788-6.622 0l-2.905 2.852a4.558 4.558 0 00.357 6.82c1.893 1.517 4.695 1.226 6.422-.47"></path></g></svg></span></button></span></h2><p data-renderer-start-pos="5348" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">By starting the instance on Container the image gets pulled and deployed in the container instance. On the Azure Portal you can look into the public ip adress and check the website is running and accessible.</p><p data-renderer-start-pos="5557" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">A container instance can be started using docker command: <span class="code" data-renderer-mark="true" face="SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace" style="-webkit-box-decoration-break: clone; background-color: rgba(9, 30, 66, 0.08); border-radius: 3px; border-style: none; box-shadow: rgba(9, 30, 66, 0.08) -4px 0px 0px 0px, rgba(9, 30, 66, 0.08) 4px 0px 0px 0px; font-size: 13.712px; margin: 0px 4px; overflow: auto; padding: 2px 0px;">docker run securedcontainerregistry.azurecr.io/securedazurelib:latest</span> The following job tasks will start an instance in an Azure pipeline</p><div class="code-block sc-cBdUnI dbtRcB" style="background-color: white; border-radius: 3px; clear: both; display: grid; grid-template-columns: minmax(0px, 1fr); margin: 0.75rem 0px 0px; max-width: 100%; overflow-wrap: normal; padding: 0px; position: relative; tab-size: 4;"><span class="sc-gVLVqr infAcJ" style="-webkit-box-pack: end; color: #172b4d; display: flex; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; grid-column: 1 / auto; justify-content: flex-end; position: sticky; top: 0px; white-space: pre-wrap;"><div role="presentation" style="margin: 0px; padding: 0px;"><div style="margin: 0px; padding: 0px;"><button aria-haspopup="true" aria-label="Copy" class="copy-to-clipboard css-1dgloit" style="-webkit-box-align: baseline; -webkit-box-pack: center; align-items: baseline; background: none rgb(244, 245, 247); border-color: rgb(255, 255, 255); border-radius: 4px; border-style: solid; color: #42526e; cursor: pointer; display: flex; font-family: inherit; font-size: inherit; height: 32px; justify-content: center; line-height: 1.71429em; max-width: 100%; opacity: 0; outline: none; padding: 2px; position: absolute; right: 6px; top: 4px; transition: opacity 0.2s ease 0s; vertical-align: middle; white-space: nowrap; width: 32px;" tabindex="0" type="button"><span class="css-1ujqpe8" style="-webkit-box-flex: 0; align-self: center; display: flex; flex-grow: 0; flex-shrink: 0; font-size: 0px; line-height: 0; margin: 0px 2px; opacity: 1; transition: opacity 0.3s ease 0s; user-select: none;"><span aria-label="Copy" class="css-1w1m1we" role="img" style="display: inline-block; flex-shrink: 0; line-height: 1;"><svg height="24" role="presentation" viewbox="0 0 24 24" width="24"><g fill="currentColor"><path d="M10 19h8V8h-8v11zM8 7.992C8 6.892 8.902 6 10.009 6h7.982C19.101 6 20 6.893 20 7.992v11.016c0 1.1-.902 1.992-2.009 1.992H10.01A2.001 2.001 0 018 19.008V7.992z"></path><path d="M5 16V4.992C5 3.892 5.902 3 7.009 3H15v13H5zm2 0h8V5H7v11z"></path></g></svg></span></span></button></div></div></span><div class="css-13pcb96" data-code-block="" style="--line-number-bg-color: #EBECF0; margin: 0px; padding: 0px; text-align: left;"><span data-code-lang="yaml" face="var(--code-font-family)" style="--code-font-family-italic: SFMono-MediumItalic, var(--code-font-family); --code-font-family: "SFMono-Medium", "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; background-attachment: local, scroll, scroll; background-color: #f4f5f7; background-image: linear-gradient(to left, rgb(244, 245, 247) 8px, transparent 8px), linear-gradient(to left, rgba(9, 30, 66, 0.13) 0px, rgba(99, 114, 130, 0) 8px), linear-gradient(to right, rgba(9, 30, 66, 0.13) 0px, rgba(99, 114, 130, 0) 8px); background-position: 100% 0px, 100% 0px, 0px 0px; border-radius: 3px; display: flex; line-height: 24px; overflow-x: auto;"><code style="background-image: linear-gradient(to right,var(--line-number-bg-color),var(--line-number-bg-color) calc(2ch + 16px),transparent calc(2ch + 16px),transparent); flex: 1 0 auto; padding: 8px 0px;"><span class="linenumber react-syntax-highlighter-line-number" face="var(--code-font-family-italic)" style="box-sizing: border-box; display: block; flex-shrink: 0; margin-left: 8px; min-width: calc(2ch + 16px); padding-left: 8px; padding-right: 8px; text-align: left; user-select: none;"><span style="color: #006644; font-family: SFMono-Medium, SF Mono, Segoe UI Mono, Roboto Mono, Ubuntu Mono, Menlo, Consolas, Courier, monospace;"><span style="font-size: 14px; white-space: pre;">jobs:</span></span></span><span style="color: #006644; font-family: SFMono-Medium, SF Mono, Segoe UI Mono, Roboto Mono, Ubuntu Mono, Menlo, Consolas, Courier, monospace;"><span style="font-size: 14px; white-space: pre;"> - job: RunTest
workspace:
clean: all
pool:
vmImage: 'ubuntu-latest'
steps:
- task: Docker@2
displayName: Login to ACR
inputs:
command: login
containerRegistry: securedcontainerregistry
- script: |
docker run securedcontainerregistry.azurecr.io/somerepo/securedazurelib:latest </span></span></code></span></div></div><h2 data-renderer-start-pos="6083" id="Security" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1.43em; font-weight: normal; letter-spacing: -0.008em; line-height: 1.2; margin: 1.8em 0px 0px; padding: 0px; white-space: pre-wrap;">Security<span class="heading-anchor-wrapper" role="presentation" style="height: 1.2em; margin-left: 6px; position: absolute;"><button class="sc-eXEjpC rYMDH" style="border-color: initial; border-style: none; border-width: initial; color: #42526e; cursor: pointer; display: inline; font-family: inherit; opacity: 0; outline: none; padding-left: 0px; padding-right: 0px; right: 0px; transform: translate(-8px, 0px); transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;"><span aria-label="copy" class="css-1i2mldy" role="img" style="display: inline-block; flex-shrink: 0; height: 24px; line-height: 1; width: 24px;"><svg height="24" role="presentation" viewbox="0 0 24 24" width="24"><g fill-rule="evenodd" fill="currentColor"><path d="M12.856 5.457l-.937.92a1.002 1.002 0 000 1.437 1.047 1.047 0 001.463 0l.984-.966c.967-.95 2.542-1.135 3.602-.288a2.54 2.54 0 01.203 3.81l-2.903 2.852a2.646 2.646 0 01-3.696 0l-1.11-1.09L9 13.57l1.108 1.089c1.822 1.788 4.802 1.788 6.622 0l2.905-2.852a4.558 4.558 0 00-.357-6.82c-1.893-1.517-4.695-1.226-6.422.47"></path><path d="M11.144 19.543l.937-.92a1.002 1.002 0 000-1.437 1.047 1.047 0 00-1.462 0l-.985.966c-.967.95-2.542 1.135-3.602.288a2.54 2.54 0 01-.203-3.81l2.903-2.852a2.646 2.646 0 013.696 0l1.11 1.09L15 11.43l-1.108-1.089c-1.822-1.788-4.802-1.788-6.622 0l-2.905 2.852a4.558 4.558 0 00.357 6.82c1.893 1.517 4.695 1.226 6.422-.47"></path></g></svg></span></button></span></h2><p data-renderer-start-pos="6093" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">You can register the container instance in AAD using Manage Identity and then assign a role in KeyVault for that identity to allow access to secrets.</p>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-19289351428880431992021-05-03T10:57:00.004+02:002021-05-03T10:59:20.218+02:00Secrets in ARM templates<p> <span style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; white-space: pre-wrap;">You may want to use a password in a template (let’s say user password of a VM or admin password of a SQL-server). Putting the password in your template, which is located in your source code repository, is not according to security guidelines. </span></p><p data-renderer-start-pos="250" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">One option to secure your strings would be to put them in KeyVault as a Secret and refer them from either paramters.json or in your main.json where it refer to a linked template.</p><div class="ak-editor-panel sc-bAeIUo cRLVyE" data-panel-type="info" style="-webkit-box-align: baseline; align-items: baseline; background-color: #deebff; border-radius: 3px; border: none; color: #172b4d; display: flex; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; margin: 0.75rem 0px 0px; min-width: 48px; padding: 8px; white-space: pre-wrap; word-break: break-word;"><span class="ak-editor-panel__icon" style="box-sizing: content-box; color: #0052cc; display: block; flex-shrink: 0; height: 24px; padding-right: 8px; width: 24px;"><span aria-label="Panel info" class="css-1w1m1we" role="img" style="display: inline; flex-shrink: 0; line-height: 1; vertical-align: middle;"><svg height="24" role="presentation" viewbox="0 0 24 24" width="24"><path d="M12 20a8 8 0 110-16 8 8 0 010 16zm0-8.5a1 1 0 00-1 1V15a1 1 0 002 0v-2.5a1 1 0 00-1-1zm0-1.125a1.375 1.375 0 100-2.75 1.375 1.375 0 000 2.75z" fill-rule="evenodd" fill="currentColor"></path></svg></span></span><div class="ak-editor-panel__content" style="flex: 1 0 0px; margin: 1px 0px; min-width: 0px; padding: 0px;"><p data-renderer-start-pos="431" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">First you need to set <strong data-renderer-mark="true">Azure Resource Manager for template deployment</strong> on checked within Access Policies of the keyvault where the template is refering to. </p></div></div><h2 data-renderer-start-pos="588" id="Deploying-Templates" style="background-color: white; border-bottom-color: rgb(204, 204, 204); color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1.42857em; font-weight: 500; letter-spacing: -0.008em; line-height: 1.2; margin: 1.8em 0px 0px; padding: 0px; white-space: pre-wrap;">Deploying Templates<span class="heading-anchor-wrapper" role="presentation" style="height: 1.2em; margin-left: 6px; position: absolute;"><button class="sc-iuJeZd hjvoVs" style="border-color: initial; border-style: none; border-width: initial; color: #42526e; cursor: pointer; display: inline; font-family: inherit; opacity: 0; outline: none; padding-left: 0px; padding-right: 0px; right: 0px; transform: translate(-8px, 0px); transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;"><span aria-label="copy" class="css-1i2mldy" role="img" style="display: inline-block; flex-shrink: 0; height: 24px; line-height: 1; width: 24px;"><svg height="24" role="presentation" viewbox="0 0 24 24" width="24"><g fill-rule="evenodd" fill="currentColor"><path d="M12.856 5.457l-.937.92a1.002 1.002 0 000 1.437 1.047 1.047 0 001.463 0l.984-.966c.967-.95 2.542-1.135 3.602-.288a2.54 2.54 0 01.203 3.81l-2.903 2.852a2.646 2.646 0 01-3.696 0l-1.11-1.09L9 13.57l1.108 1.089c1.822 1.788 4.802 1.788 6.622 0l2.905-2.852a4.558 4.558 0 00-.357-6.82c-1.893-1.517-4.695-1.226-6.422.47"></path><path d="M11.144 19.543l.937-.92a1.002 1.002 0 000-1.437 1.047 1.047 0 00-1.462 0l-.985.966c-.967.95-2.542 1.135-3.602.288a2.54 2.54 0 01-.203-3.81l2.903-2.852a2.646 2.646 0 013.696 0l1.11 1.09L15 11.43l-1.108-1.089c-1.822-1.788-4.802-1.788-6.622 0l-2.905 2.852a4.558 4.558 0 00.357 6.82c1.893 1.517 4.695 1.226 6.422-.47"></path></g></svg></span></button></span></h2><p data-renderer-start-pos="609" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">You could start a deployment right from the portal by adding a resource of type <strong data-renderer-mark="true">Template Deployment</strong>. </p><p data-renderer-start-pos="712" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">Another option would be using az CLI:</p><p data-renderer-start-pos="712" style="background-color: white; color: #172b4d; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;"><span style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">az deployment </span><span class="token token" style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">group</span><span style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;"> create </span><span class="token token" style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">--</span><span style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">resource</span><span class="token token" style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">-</span><span class="token token" style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">group</span><span style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;"> newgrp1 </span><span class="token token" style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">--</span><span style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">template</span><span class="token token" style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">-</span><span style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">file main</span><span class="token token" style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">.</span><span style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">json </span><span class="token token" style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">--</span><span style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">parameters parameters</span><span class="token token" style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">.</span><span style="background-color: #f4f5f7; font-size: 14px; letter-spacing: normal; white-space: pre;">json</span></span></p><p data-renderer-start-pos="859" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">Or you could deploy it from your CD-pipeline locatedin Azure Devops.</p><h2 data-renderer-start-pos="929" id="Using-Secured-Secrets-in-Parameters.json" style="background-color: white; border-bottom-color: rgb(204, 204, 204); color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1.42857em; font-weight: 500; letter-spacing: -0.008em; line-height: 1.2; margin: 1.8em 0px 0px; padding: 0px; white-space: pre-wrap;">Using Secured Secrets in Parameters.json<span class="heading-anchor-wrapper" role="presentation" style="height: 1.2em; margin-left: 6px; position: absolute;"><button class="sc-iuJeZd hjvoVs" style="border-color: initial; border-style: none; border-width: initial; color: #42526e; cursor: pointer; display: inline; font-family: inherit; opacity: 0; outline: none; padding-left: 0px; padding-right: 0px; right: 0px; transform: translate(-8px, 0px); transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;"><span aria-label="copy" class="css-1i2mldy" role="img" style="display: inline-block; flex-shrink: 0; height: 24px; line-height: 1; width: 24px;"><svg height="24" role="presentation" viewbox="0 0 24 24" width="24"><g fill-rule="evenodd" fill="currentColor"><path d="M12.856 5.457l-.937.92a1.002 1.002 0 000 1.437 1.047 1.047 0 001.463 0l.984-.966c.967-.95 2.542-1.135 3.602-.288a2.54 2.54 0 01.203 3.81l-2.903 2.852a2.646 2.646 0 01-3.696 0l-1.11-1.09L9 13.57l1.108 1.089c1.822 1.788 4.802 1.788 6.622 0l2.905-2.852a4.558 4.558 0 00-.357-6.82c-1.893-1.517-4.695-1.226-6.422.47"></path><path d="M11.144 19.543l.937-.92a1.002 1.002 0 000-1.437 1.047 1.047 0 00-1.462 0l-.985.966c-.967.95-2.542 1.135-3.602.288a2.54 2.54 0 01-.203-3.81l2.903-2.852a2.646 2.646 0 013.696 0l1.11 1.09L15 11.43l-1.108-1.089c-1.822-1.788-4.802-1.788-6.622 0l-2.905 2.852a4.558 4.558 0 00.357 6.82c1.893 1.517 4.695 1.226 6.422-.47"></path></g></svg></span></button></span></h2><p data-renderer-start-pos="971" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">The following example refers to a secret called <span class="code" data-renderer-mark="true" style="-webkit-box-decoration-break: clone; background-color: rgba(9, 30, 66, 0.08); border-radius: 3px; border-style: none; box-shadow: rgba(9, 30, 66, 0.08) -4px 0px 0px 0px, rgba(9, 30, 66, 0.08) 4px 0px 0px 0px; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 13.712px; margin: 0px 4px; overflow: auto; padding: 2px 0px;">vmpassword</span> within a keyvault called <span class="code" data-renderer-mark="true" style="-webkit-box-decoration-break: clone; background-color: rgba(9, 30, 66, 0.08); border-radius: 3px; border-style: none; box-shadow: rgba(9, 30, 66, 0.08) -4px 0px 0px 0px, rgba(9, 30, 66, 0.08) 4px 0px 0px 0px; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 13.712px; margin: 0px 4px; overflow: auto; padding: 2px 0px;">demovault10001</span> ie. located in <span class="code" data-renderer-mark="true" style="-webkit-box-decoration-break: clone; background-color: rgba(9, 30, 66, 0.08); border-radius: 3px; border-style: none; box-shadow: rgba(9, 30, 66, 0.08) -4px 0px 0px 0px, rgba(9, 30, 66, 0.08) 4px 0px 0px 0px; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 13.712px; margin: 0px 4px; overflow: auto; padding: 2px 0px;">newgrp1</span> resource group:</p><p data-renderer-start-pos="971" style="background-color: white; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px;"><span style="color: #3d85c6; font-family: courier;"><span style="letter-spacing: -0.08px; white-space: pre-wrap;">{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminUsername": {
"value": "admin"
},
"adminPassword": {
"<b>reference</b>": {
"<b>keyVault</b>": {
"id": "/subscriptions/baaa99b3-1d19-4c5e-90e1-39d55de5fc6e/resourceGroups/newgrp1/providers/Microsoft.KeyVault/vaults/demovault10001"
},
"<b>secretName</b>": "vmpassword"
}
} }
}</span></span></p><h2 data-renderer-start-pos="1611" id="Using-Secured-Secrets-in-main.json" style="background-color: white; border-bottom-color: rgb(204, 204, 204); color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1.42857em; font-weight: 500; letter-spacing: -0.008em; line-height: 1.2; margin: 1.8em 0px 0px; padding: 0px; white-space: pre-wrap;">Using Secured Secrets in main.json<span class="heading-anchor-wrapper" role="presentation" style="height: 1.2em; margin-left: 6px; position: absolute;"><button class="sc-iuJeZd hjvoVs" style="border-color: initial; border-style: none; border-width: initial; color: #42526e; cursor: pointer; display: inline; font-family: inherit; opacity: 0; outline: none; padding-left: 0px; padding-right: 0px; right: 0px; transform: translate(-8px, 0px); transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;"><span aria-label="copy" class="css-1i2mldy" role="img" style="display: inline-block; flex-shrink: 0; height: 24px; line-height: 1; width: 24px;"><svg height="24" role="presentation" viewbox="0 0 24 24" width="24"><g fill-rule="evenodd" fill="currentColor"><path d="M12.856 5.457l-.937.92a1.002 1.002 0 000 1.437 1.047 1.047 0 001.463 0l.984-.966c.967-.95 2.542-1.135 3.602-.288a2.54 2.54 0 01.203 3.81l-2.903 2.852a2.646 2.646 0 01-3.696 0l-1.11-1.09L9 13.57l1.108 1.089c1.822 1.788 4.802 1.788 6.622 0l2.905-2.852a4.558 4.558 0 00-.357-6.82c-1.893-1.517-4.695-1.226-6.422.47"></path><path d="M11.144 19.543l.937-.92a1.002 1.002 0 000-1.437 1.047 1.047 0 00-1.462 0l-.985.966c-.967.95-2.542 1.135-3.602.288a2.54 2.54 0 01-.203-3.81l2.903-2.852a2.646 2.646 0 013.696 0l1.11 1.09L15 11.43l-1.108-1.089c-1.822-1.788-4.802-1.788-6.622 0l-2.905 2.852a4.558 4.558 0 00.357 6.82c1.893 1.517 4.695 1.226 6.422-.47"></path></g></svg></span></button></span></h2><p data-renderer-start-pos="1647" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">Similar to above example we can refer to a secured password by setting the keyvault id and the secret name. In the following example we use this to pass the adminPassword as a parameter to nested template.</p><p data-renderer-start-pos="4837" style="background-color: white; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;"><span style="color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif;"> </span><span style="color: #0b5394; font-family: courier;">{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "The location where the resources will be deployed."
}
},
"vaultName": {
"type": "string",
"defaultValue":"appvault10001"
},
"secretName": {
"type": "string",
"defaultValue":"vmaccountpassword"
},
"vaultResourceGroupName": {
"type": "string",
"defaultValue":"newgrp1"
},
"vaultSubscription": {
"type": "string",
"defaultValue": "[subscription().subscriptionId]",
"metadata": {
"description": "The name of the subscription that contains the keyvault."
} }
},
"resources": [
{
<b> "type": "Microsoft.Resources/deployments",</b>
"apiVersion": "2018-05-01",
"name": "dynamicSecret",
"properties": {
"mode": "Incremental",
"expressionEvaluationOptions": {
"scope": "inner"
},
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"adminLogin": {
"type": "string"
},
"adminPassword": {
"type": "securestring"
},
"location": {
"type": "string"
}
},
"variables": {
"sqlServerName": "[concat('sql-', uniqueString(resourceGroup().id, 'sql'))]"
},
"resources": [
{
"type": "Microsoft.Sql/servers",
"apiVersion": "2018-06-01-preview",
"name": "[variables('sqlServerName')]",
"location": "[parameters('location')]",
"properties": {
"administratorLogin": "[parameters('adminLogin')]",
<b> "administratorLoginPassword": "[parameters('adminPassword')]"</b>
}
}
],
"outputs": {
"sqlFQDN": {
"type": "string",
"value": "[reference(variables('sqlServerName')).fullyQualifiedDomainName]"
}
}
},
"parameters": {
"location": {
"value": "[parameters('location')]"
},
"adminLogin": {
"value": "demousr"
},
<b>"adminPassword": {
"reference": {
"keyVault": {
"id": "[resourceId(parameters('vaultSubscription'), parameters('vaultResourceGroupName'), 'Microsoft.KeyVault/vaults', parameters('vaultName'))]"
},
"secretName": "[parameters('secretName')]"
}
}</b>
}
}
}
],
"outputs": {
}
}</span></p>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-86869468790139242302021-01-22T17:53:00.003+01:002021-01-29T18:26:19.546+01:00Apply SSL to your web service<p data-renderer-start-pos="1" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px; white-space: pre-wrap;">You can chose to use a free <strong data-renderer-mark="true">managed certificate</strong> for your web app from Azure Portal:</p><ol class="ak-ol" data-indent-level="1" style="background-color: white; box-sizing: border-box; color: #172b4d; display: flow-root; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; margin: 12px 0px 0px; padding: 0px 0px 0px 24px; white-space: pre-wrap;"><li><p data-renderer-start-pos="89" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">In Azure Portal go to <strong data-renderer-mark="true">TLS/SSL</strong> settings blade of your webapp.</p></li><li style="margin-top: 4px;"><p data-renderer-start-pos="153" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">Choose <strong data-renderer-mark="true">Private Key Certificates </strong>on the top</p></li><li style="margin-top: 4px;"><p data-renderer-start-pos="199" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">Click on + Create App Service Managed Certificate</p></li><li style="margin-top: 4px;"><p data-renderer-start-pos="252" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">In the popup select the sub-domain you want to choose</p></li><li style="margin-top: 4px;"><p data-renderer-start-pos="309" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">Wait… and the sub-domain will be verified and will be get green:</p><p data-renderer-start-pos="379" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px;"></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZvFXOd5KeuvXkhW0wolXA73m4FlVmXFQWU1r_IBI8SymzMZi5HZ71plXqwabIj58pNqJchl7VwYKEy8IAkaPdU0x3xN_Zy60p7zHnNjcv7tIBX5PE5Jaq6P9OCobC9RW4LgPd5C43T5yO/s564/001.png" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="366" data-original-width="564" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZvFXOd5KeuvXkhW0wolXA73m4FlVmXFQWU1r_IBI8SymzMZi5HZ71plXqwabIj58pNqJchl7VwYKEy8IAkaPdU0x3xN_Zy60p7zHnNjcv7tIBX5PE5Jaq6P9OCobC9RW4LgPd5C43T5yO/s320/001.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><p></p></li><li style="margin-top: 4px;"><p data-renderer-start-pos="383" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">Hit on <strong data-renderer-mark="true">Create </strong>button and wait until it is finished.</p></li><li style="margin-top: 4px;"><p data-renderer-start-pos="438" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">Go to <strong data-renderer-mark="true">Custom domains </strong>blade in your App service.</p></li><li style="margin-top: 4px;"><p data-renderer-start-pos="489" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">Notice that the newly created certificates are part of the custom domains.<br /></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJflV4DZwO-m4xAreYd877kEVPg-rgnET5xBNB1qk-J9zpeiiCCtTHI5qjQrZT7AkF6yVgtP2U9nq4hyiJjs8vhIcI0Bcd5sE7V9K9TgwzgbxrdrB9SlW2HswInIbdKRpRPAL0JmyXg7M0/s491/002.png" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="225" data-original-width="491" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJflV4DZwO-m4xAreYd877kEVPg-rgnET5xBNB1qk-J9zpeiiCCtTHI5qjQrZT7AkF6yVgtP2U9nq4hyiJjs8vhIcI0Bcd5sE7V9K9TgwzgbxrdrB9SlW2HswInIbdKRpRPAL0JmyXg7M0/s320/002.png" width="320" /></a></div><p></p><div class="rich-media-item mediaSingleView-content-wrap image-center sc-kLIISr dvMbzE sc-dliRfk eqbPLs" data-layout="center" data-node-type="mediaSingle" style="clear: both; float: none; margin: 0px; max-width: 100%; padding: 0px; transition: width 100ms ease-in 0s; width: 491px;" width="491"><div class="sc-cqCuEk dHRnAe" style="margin: 0px; padding: 0px; position: relative;"><div class="sc-sPYgB gbluiW" data-collection="contentId-1858306115" data-context-id="1858306115" data-file-mime-type="image/png" data-file-name="image-20210122-152841.png" data-file-size="16490" data-height="225" data-id="ca7b3387-69ad-439c-a1fe-66c2bf7338cb" data-node-type="media" data-type="file" data-width="491" style="height: 0px; margin: 0px; padding: 0px; position: static; width: 491px;"><div class="sc-eYdvao iIVCCO" data-testid="media-card-view" style="border-radius: 3px; box-sizing: border-box; cursor: pointer; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; font-size: 14px; height: 225px; line-height: 22px; margin: 0px; max-height: 100%; max-width: 100%; padding: 0px; position: absolute; transition: all 0.3s ease 0s; width: 1430px;"><div style="box-sizing: border-box; height: 655.295px; margin: 0px; max-height: 100%; max-width: 100%; padding: 0px; width: 1430px;"><div style="box-sizing: border-box; height: 655.295px; margin: 0px; max-height: 100%; max-width: 100%; padding: 0px; width: 1430px;"><br /></div><br /><div class="media-file-card-view sc-mrBlX gZefLE" data-test-media-name="image-20210122-152841.png" data-test-progress="1" data-test-status="complete" data-testid="media-file-card-view" style="border-radius: 3px; box-sizing: border-box; display: flex; height: 225px; margin: 0px; max-height: 100%; max-width: 100%; overflow: hidden; padding: 0px; position: relative; width: 491px;"><span style="font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1em; letter-spacing: -0.005em;"><br /></span></div></div></div></div></div></div></li><li style="margin-top: 4px;"><p data-renderer-start-pos="573" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">Hit on <strong data-renderer-mark="true">Add binding </strong>on the sub-domain you want to associate.</p></li><li style="margin-top: 4px;"><p data-renderer-start-pos="636" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">In the popup select the certificate and SSL Type. Then hit Add button.<br /><br /></p><div class="rich-media-item mediaSingleView-content-wrap image-center sc-kLIISr dvMbzE sc-dliRfk hZBJpn" data-layout="center" data-node-type="mediaSingle" style="clear: both; float: none; margin: 0px; max-width: 100%; padding: 0px; transition: width 100ms ease-in 0s; width: 471px;" width="471"><div class="sc-cqCuEk hCJYzC" style="margin: 0px; padding: 0px; position: relative;"><div class="sc-sPYgB gbluiW" data-collection="contentId-1858306115" data-context-id="1858306115" data-file-mime-type="image/png" data-file-name="image-20210122-153327.png" data-file-size="15195" data-height="224" data-id="cb65f90e-6c69-4ed2-af2a-2ad13b0b5866" data-node-type="media" data-type="file" data-width="471" style="height: 0px; margin: 0px; padding: 0px; position: static; width: 471px;"><div class="sc-eYdvao kYzTCL" data-testid="media-card-view" style="border-radius: 3px; box-sizing: border-box; cursor: pointer; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; font-size: 14px; height: 224px; line-height: 22px; margin: 0px; max-height: 100%; max-width: 100%; padding: 0px; position: absolute; transition: all 0.3s ease 0s; width: 1430px;"><div style="box-sizing: border-box; height: 680.085px; margin: 0px; max-height: 100%; max-width: 100%; padding: 0px; width: 1430px;"><div class="media-file-card-view sc-mrBlX gZefLE" data-test-media-name="image-20210122-153327.png" data-test-progress="1" data-test-status="complete" data-testid="media-file-card-view" style="border-radius: 3px; box-sizing: border-box; display: flex; height: 224px; margin: 0px; max-height: 100%; max-width: 100%; overflow: hidden; padding: 0px; position: relative; width: 471px;"><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg143fJjjNluJfrNb7cm2vHhGx76bcgw-4DuUBjZp68DbQPrcq4TU4vClMenAZp1oSZLS4ww8u6yweYWapCnjPs9QI3y_FXHGhKG1CwuUdpmgnkjKKJOPdVBkM4qHMrr-QJVRyZKhy-S89-/s471/003.png" style="letter-spacing: -0.08px; margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="224" data-original-width="471" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg143fJjjNluJfrNb7cm2vHhGx76bcgw-4DuUBjZp68DbQPrcq4TU4vClMenAZp1oSZLS4ww8u6yweYWapCnjPs9QI3y_FXHGhKG1CwuUdpmgnkjKKJOPdVBkM4qHMrr-QJVRyZKhy-S89-/s320/003.png" width="320" /></a></div></div></div></div></div></div></li></ol><p data-renderer-start-pos="714" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;"> </p>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-73031438359841411552020-12-10T17:35:00.001+01:002021-01-29T17:37:44.426+01:00Building Data Science Team<p> <span style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; white-space: pre-wrap;">From the book: </span><a class="sc-gtfDJT inebBl" data-renderer-mark="true" href="http://www.datascienceassn.org/sites/default/files/Building%20Data%20Science%20Teams.pdf" style="color: #0052cc; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; text-decoration-line: none; white-space: pre-wrap;" title="http://www.datascienceassn.org/sites/default/files/Building%20Data%20Science%20Teams.pdf">http://www.datascienceassn.org/sites/default/files/Building Data Science Teams.pdf</a></p><blockquote style="background-color: white; border-bottom: none; border-image: initial; border-left: 2px solid rgb(223, 225, 230); border-right: none; border-top: none; box-sizing: border-box; clear: both; color: #707070; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; margin: 0.75rem 0px 0px; padding: 10px 20px 10px 16px; white-space: pre-wrap;"><p data-renderer-start-pos="101" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">A data-driven organization acquires, processes, and leverages data in a timely fashion to create efficiencies, iterate on and develop new products, and navigate the competitive landscape.</p></blockquote><p data-renderer-start-pos="291" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">Author wrote also: </p><blockquote style="background-color: white; border-bottom: none; border-image: initial; border-left: 2px solid rgb(223, 225, 230); border-right: none; border-top: none; box-sizing: border-box; clear: both; color: #707070; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; margin: 0.75rem 0px 0px; padding: 10px 20px 10px 16px; white-space: pre-wrap;"><p data-renderer-start-pos="313" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">There are many ways to assess whether an organization is data driven. Some like to talk about how much data they generate. Others like to talk about the sophistication of data they use, or the process of internalizing data. I prefer to start by highlighting organizations that use data effectively.</p></blockquote><p><br /></p><p><span style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">See also: </span><a class="sc-gtfDJT inebBl" data-renderer-mark="true" href="https://www.altexsoft.com/blog/datascience/how-to-structure-data-science-team-key-models-and-roles/#how-to-integrate-a-data-science-team-into-your-company" style="background-color: white; color: #0052cc; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 14px; letter-spacing: -0.07px; text-decoration-line: none; white-space: pre-wrap;" title="https://www.altexsoft.com/blog/datascience/how-to-structure-data-science-team-key-models-and-roles/#how-to-integrate-a-data-science-team-into-your-company">altexsoft.com blog post on datascience: how-to-structure-data-science-team-key-models-and-roles</a></p><p><span style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;"> </span></p>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-38192185993513638242020-07-24T15:01:00.002+02:002020-07-24T15:05:27.347+02:00What was my Wifi password?<span style="font-family: "verdana" , sans-serif;">If you have a Wifi connection on your Laptop and you need to know the password for it follow the next steps in a DOS command line:
</span><br />
<br />
<b><span style="font-family: "courier new" , "courier" , monospace;">netsh wlan show profile</span></b><br />
<b><span style="font-family: "courier new" , "courier" , monospace;"><br /></span></b>
<span style="font-family: "verdana" , sans-serif;">This will show the known profiles. Copy the name of any profile you need to know its password.</span><br />
<span style="font-family: "verdana" , sans-serif;">Then call the next command to see the password in clear text:</span><br />
<br />
<b><span style="font-family: "courier new" , "courier" , monospace;">netsh wlan show profile <name> key=clear</name></span></b><br />
<b><span style="font-family: "courier new" , "courier" , monospace;"><br /></span></b>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-80093474312890760162020-07-24T14:18:00.000+02:002020-07-24T15:06:07.357+02:00What is my IP-number in AzureWhen you send a request to somewhere that uses your ip-number to <b>whitelist</b>, your ip number becomes important to know.<br />
It is pretty simple when you do this on your laptop where you can open up a browser and find your <b>outbound </b>ip-number in Google.
When you run your request within an Azure Web App which is running on an ASP, you might want to open up a console in Azure Portal and use the following PowerShell command: <br />
<br />
<pre>(Get-AzWebApp -ResourceGroup <group_name> -name <app_name>).OutboundIpAddresses
</pre>
<br />
See also: <a href="https://docs.microsoft.com/en-us/azure/app-service/overview-inbound-outbound-ips#find-outbound-ips" target="msdn">find-outbound-ips</a>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-32404777059895427892020-06-30T17:21:00.006+02:002021-01-29T17:26:29.581+01:00How to Ping in Azure ConsoleSource: https://docs.microsoft.com/en-us/azure/app-service/web-sites-integrate-with-vnet <div><br /></div><h3 style="text-align: left;">Tools</h3><div><span face="-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif" style="background-color: white; color: #172b4d; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">The tools </span><strong data-renderer-mark="true" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">ping</strong><span face="-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif" style="background-color: white; color: #172b4d; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">, </span><strong data-renderer-mark="true" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">nslookup</strong><span face="-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif" style="background-color: white; color: #172b4d; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">, and </span><strong data-renderer-mark="true" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">tracert</strong><span face="-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif" style="background-color: white; color: #172b4d; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;"> won't work through the console because of security constraints. To fill the void, two separate tools are added. To test DNS functionality, we added a tool named </span><strong data-renderer-mark="true" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">nameresolver.exe</strong><span face="-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif" style="background-color: white; color: #172b4d; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;">. The syntax is:</span></div><div><span face="-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif" style="background-color: white; color: #172b4d; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;"><br /></span></div><div><span style="background-color: #f4f5f7; color: #172b4d; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; white-space: pre;">ameresolver.exe hostname [optional: DNS Server]</span></div><div><span face="-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif" style="background-color: white; color: #172b4d; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;"><br /></span></div><div><span face="-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif" style="background-color: white; color: #172b4d; font-size: 16px; letter-spacing: -0.08px; white-space: pre-wrap;"><p data-renderer-start-pos="381" style="font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px;">You can use nameresolver to check the hostnames that your app depends on. This way you can test if you have anything misconfigured with your DNS or perhaps don't have access to your DNS server. You can see the DNS server that your app uses in the console by looking at the environmental variables WEBSITE_DNS_SERVER and WEBSITE_DNS_ALT_SERVER.</p><p data-renderer-start-pos="726" style="font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px;">You can use the next tool to test for TCP connectivity to a host and port combination. This tool is called <strong data-renderer-mark="true">tcpping</strong> and the syntax is:</p><p data-renderer-start-pos="726" style="font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px;"><span style="background-color: #f4f5f7; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; letter-spacing: normal; white-space: pre;">tcpping.exe hostname [optional: port]</span></p><p data-renderer-start-pos="900" style="font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px;">The <strong data-renderer-mark="true">tcpping</strong> utility tells you if you can reach a specific host and port. It can show success only if there's an application listening at the host and port combination, and there's network access from your app to the specified host and port.</p><p data-renderer-start-pos="1142" style="font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px;">Additional debug steps include:</p><ul class="ak-ul" data-indent-level="1" style="box-sizing: border-box; display: flow-root; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; letter-spacing: normal; margin: 12px 0px 0px; padding: 0px 0px 0px 24px;"><li><p data-renderer-start-pos="1177" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">Connect to a VM in your virtual network and attempt to reach your resource host:port from there. To test for TCP access, use the PowerShell command <strong data-renderer-mark="true">test-netconnection</strong>. The syntax is:</p><div class="code-block sc-hBAczQ gORswg" style="clear: both; display: grid; grid-template-columns: minmax(0px, 1fr); margin: 0.75rem 0px 0px; max-width: 100%; overflow-wrap: normal; padding: 0px; position: relative;"><span class="sc-lewbHj jIINsK" style="-webkit-box-pack: end; display: flex; grid-column: 1 / auto; justify-content: flex-end; position: sticky; top: 0px;"><div style="margin: 0px; padding: 0px;"><div style="margin: 0px; padding: 0px;"><button aria-haspopup="true" aria-label="Copy" class="copy-to-clipboard css-1dgloit" style="-webkit-box-align: baseline; -webkit-box-pack: center; align-items: baseline; background: none rgb(244, 245, 247); border-color: rgb(255, 255, 255); border-radius: 4px; border-style: solid; color: #42526e; cursor: pointer; display: flex; font-family: inherit; font-size: inherit; height: 32px; justify-content: center; line-height: 1.71429em; max-width: 100%; opacity: 0; outline: none; padding: 2px; position: absolute; right: 6px; top: 6px; transition: opacity 0.2s ease 0s; vertical-align: middle; white-space: nowrap; width: 32px;" tabindex="0" type="button"><span class="css-1ujqpe8" style="-webkit-box-flex: 0; align-self: center; display: flex; flex-grow: 0; flex-shrink: 0; font-size: 0px; line-height: 0; margin: 0px 2px; opacity: 1; transition: opacity 0.3s ease 0s; user-select: none;"><span aria-label="Copy" class="sc-htpNat dcTkON" role="img" style="color: currentcolor; display: inline-block; fill: rgb(255, 255, 255); flex-shrink: 0; line-height: 1;"><svg focusable="false" height="24" role="presentation" viewbox="0 0 24 24" width="24"><g fill="currentColor"><path d="M10 19h8V8h-8v11zM8 7.992C8 6.892 8.902 6 10.009 6h7.982C19.101 6 20 6.893 20 7.992v11.016c0 1.1-.902 1.992-2.009 1.992H10.01A2.001 2.001 0 0 1 8 19.008V7.992z"></path><path d="M5 16V4.992C5 3.892 5.902 3 7.009 3H15v13H5zm2 0h8V5H7v11z"></path></g></svg></span></span></button></div></div></span><span style="background: rgb(244, 245, 247); border-radius: 3px; display: flex; font-size: 12px; grid-column: 1 / auto; line-height: 1.66667; overflow-x: auto; white-space: pre;"><code style="background-color: #ebecf0; color: #8993a4; flex-shrink: 0; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; line-height: 1.42857; padding: 8px; text-align: right; user-select: none;"><span class="react-syntax-highlighter-line-number" style="opacity: 1;">1
</span></code><code style="font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; line-height: 1.66667; padding: 8px;">test-netconnection hostname [optional: -Port]</code></span></div></li><li style="margin-top: 4px;"><p data-renderer-start-pos="1410" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">Bring up an application on a VM and test access to that host and port from the console from your app by using <strong data-renderer-mark="true">tcpping</strong>.</p></li></ul></span></div>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-83795760419358095882020-05-14T17:51:00.001+02:002021-01-29T17:52:50.324+01:00Think before going Microservices<div class="ak-editor-panel sc-ipZHIp NvTZw" data-panel-type="info" style="-webkit-box-align: baseline; align-items: baseline; background-color: #deebff; border-radius: 3px; border: none; clear: both; color: #172b4d; display: flex; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; margin: 0.75rem 0px 0px; min-width: 48px; padding: 8px; white-space: pre-wrap; word-break: break-word;"><div class="ak-editor-panel__content" style="flex: 1 0 0px; margin: 1px 0px; padding: 0px;"><p data-renderer-start-pos="2" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;"><span style="letter-spacing: -0.08px;">The goal of microservices is to sufficiently decompose the application in order to </span>facilitate agile application development and deployment.</p></div></div><p data-renderer-start-pos="144" style="background-color: white; color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; letter-spacing: -0.005em; line-height: 1.714; margin: 0.75rem 0px 0px; padding: 0px; white-space: pre-wrap;">The following is based on the book <em data-renderer-mark="true">Microservices from Design to Deployment</em> from NGINX. My goal is to know the difficaulties that this inevitable is bringing with in order to be prepared for.</p><h2 data-renderer-start-pos="336" id="The-Drawbacks-of-Microservices" style="background-color: white; border-bottom-color: rgb(204, 204, 204); color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1.42857em; font-weight: 500; letter-spacing: -0.008em; line-height: 1.2; margin: 1.8em 0px 0px; padding: 0px; white-space: pre-wrap;">The Drawbacks of Microservices<span class="heading-anchor-wrapper" style="height: 1.2em; margin-left: 6px; position: absolute;"><button class="sc-VJcYb gmzMVR" style="border-color: initial; border-style: none; border-width: initial; color: #42526e; cursor: pointer; display: inline; font-family: inherit; opacity: 0; outline: none; padding-left: 0px; padding-right: 0px; right: 0px; transform: translate(-8px, 0px); transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;"><span aria-label="copy" class="sc-htpNat csSqbj" role="img" style="color: #6b778c; display: inline-block; fill: rgb(255, 255, 255); flex-shrink: 0; height: 24px; line-height: 1; width: 24px;"><svg focusable="false" height="24" role="presentation" viewbox="0 0 24 24" width="24"><g fill-rule="evenodd" fill="currentColor"><path d="M12.856 5.457l-.937.92a1.002 1.002 0 0 0 0 1.437 1.047 1.047 0 0 0 1.463 0l.984-.966c.967-.95 2.542-1.135 3.602-.288a2.54 2.54 0 0 1 .203 3.81l-2.903 2.852a2.646 2.646 0 0 1-3.696 0l-1.11-1.09L9 13.57l1.108 1.089c1.822 1.788 4.802 1.788 6.622 0l2.905-2.852a4.558 4.558 0 0 0-.357-6.82c-1.893-1.517-4.695-1.226-6.422.47"></path><path d="M11.144 19.543l.937-.92a1.002 1.002 0 0 0 0-1.437 1.047 1.047 0 0 0-1.462 0l-.985.966c-.967.95-2.542 1.135-3.602.288a2.54 2.54 0 0 1-.203-3.81l2.903-2.852a2.646 2.646 0 0 1 3.696 0l1.11 1.09L15 11.43l-1.108-1.089c-1.822-1.788-4.802-1.788-6.622 0l-2.905 2.852a4.558 4.558 0 0 0 .357 6.82c1.893 1.517 4.695 1.226 6.422-.47"></path></g></svg></span></button></span></h2><ol class="ak-ol" data-indent-level="1" style="background-color: white; box-sizing: border-box; color: #172b4d; display: flow-root; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 16px; margin: 12px 0px 0px; padding: 0px 0px 0px 24px; white-space: pre-wrap;"><li><p data-renderer-start-pos="370" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">One drawback is the <strong data-renderer-mark="true">name </strong>itself. The term microservice places excessive emphasis on service size. While small services are preferable, it’s important to remember that small services are a means to an end, and not the primary goal.<br /><br /></p></li><li style="margin-top: 4px;"><p data-renderer-start-pos="605" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">Another major drawback of microservices is the <strong data-renderer-mark="true">complexity </strong>that arises from the fact that a microservices application is a distributed system. Developers need to choose and implement an <strong data-renderer-mark="true">inter-process communication</strong> mechanism based on either messaging or RPC. Moreover, they must also write code to handle partial failure, since the destination of a request might be slow or unavailable.<br /><br /></p></li><li style="margin-top: 4px;"><p data-renderer-start-pos="994" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">Another challenge with microservices is the <strong data-renderer-mark="true">partitioned database architecture</strong>. Using distributed transactions is usually not an option, and not only because of the CAP theorem. They simply are not supported by many of today’s highly scalable NoSQL databases and messaging brokers. You end up having to use an eventual consistency-based approach, which is more challenging for developers.<br /><br /></p></li><li style="margin-top: 4px;"><p data-renderer-start-pos="1386" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;"><strong data-renderer-mark="true">Testing </strong>a microservices application is also much more complex. A simple test class for a service<br />would need to launch that service and any services that it depends upon, or at least configure stubs for those services.<br /><br /></p></li><li style="margin-top: 4px;"><p data-renderer-start-pos="1608" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">Another major challenge with the Microservices Architecture pattern is implementing<br /><strong data-renderer-mark="true">changes that span multiple services</strong>. Fortunately, most changes typically impact only<br />one service; multi-service changes that require coordination are relatively rare.<br /><br /></p></li><li style="margin-top: 4px;"><p data-renderer-start-pos="1863" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;"><strong data-renderer-mark="true">Deploying </strong>a microservices-based application is also much more complex. <br /><br /></p></li><li style="margin-top: 4px;"><p data-renderer-start-pos="1939" style="font-size: 1em; letter-spacing: -0.005em; line-height: 1.714; margin: 0px; padding: 0px;">Each service will have <strong data-renderer-mark="true">multiple runtime instances</strong>. That’s many more moving parts that<br />need to be configured, deployed, scaled, and monitored. In addition, you will also need to<br />implement a service discovery mechanism that enables a service to discover the locations<br />(hosts and ports) of any other services it needs to communicate with.</p></li></ol>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-59708970758316678722018-06-24T17:31:00.001+02:002021-01-29T17:33:01.375+01:00Writing That Works<ul style="list-style-type: square; margin: 0px; padding: 0px 0px 0px 40px;"><li>The foundations of effective business writing are <strong>simplicity</strong> and <strong>accuracy</strong>. </li><li style="margin-top: 4px;">emails: <ul style="list-style-type: square; margin: 0px; padding: 0px 0px 0px 40px;"><li>subjects are adequate</li><li style="margin-top: 4px;">use positive tone</li><li style="margin-top: 4px;">get to the point quickly and write only what's relevant</li><li style="margin-top: 4px;">etiquette is key</li><li style="margin-top: 4px;">be explicit about your questions and requests</li></ul></li><li style="margin-top: 4px;">well-structured and focused presentations and speeches<ul style="list-style-type: square; margin: 0px; padding: 0px 0px 0px 40px;"><li>engage your audience</li><li style="margin-top: 4px;">finish with small memorable notes</li><li style="margin-top: 4px;">use titles that builds anticipation</li></ul></li><li style="margin-top: 4px;">Drive people to action with clear plan and reports<ul style="list-style-type: square; margin: 0px; padding: 0px 0px 0px 40px;"><li>purpose statement</li><li style="margin-top: 4px;">facts</li><li style="margin-top: 4px;">recommendations</li><li style="margin-top: 4px;">purpose of the report should be clear and interesting</li></ul></li><li style="margin-top: 4px;">Speak to your reader's desire and concerns<ul style="list-style-type: square; margin: 0px; padding: 0px 0px 0px 40px;"><li>State what you want and offer your reasoning after the facts</li><li style="margin-top: 4px;">demonstrate your competence with background information</li><li style="margin-top: 4px;">grab reader's attention </li></ul></li><li style="margin-top: 4px;">Write a summary in bold</li><li style="margin-top: 4px;">Edit and format your final product<ul style="list-style-type: square; margin: 0px; padding: 0px 0px 0px 40px;"><li>cut out anything you think is not essential </li><li style="margin-top: 4px;">is the order correct</li><li style="margin-top: 4px;">fact check</li><li style="margin-top: 4px;">give yourself enough time between drafts, and have another person review </li><li style="margin-top: 4px;">format for smooth and appealing experience</li></ul></li></ul><p style="margin: 12px 0px 0px; padding: 0px;"><br style="background-color: white; color: #091e42; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 14px;" /></p>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-76125937203268735502018-06-24T17:29:00.004+02:002021-01-29T17:39:30.061+01:00How to: Write documentation<p><span face="-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif" style="background-color: white; color: #172b4d; font-size: 1.43em; letter-spacing: -0.01em;">Questions to ask:</span></p><ul style="background-color: white; color: #091e42; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 14px; margin: 12px 0px 0px; padding: 0px 0px 0px 40px;"><li>Does the document fulfill its purpose?</li><li style="margin-top: 4px;">Is anything missing?</li><li style="margin-top: 4px;">Can anything be taken out?</li><li style="margin-top: 4px;">What questions will the reader have? And answer them.</li><li style="margin-top: 4px;">Is the writing easy to understand?</li></ul><h2 id="Howto:Writedocumentation-AlsoCheck:" style="background-color: white; border-bottom-color: rgb(204, 204, 204); color: #172b4d; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 1.43em; font-weight: normal; letter-spacing: -0.01em; line-height: 1.2; margin: 40px 0px 0px; padding: 0px;">Also Check:</h2><ul style="background-color: white; color: #091e42; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 14px; margin: 12px 0px 0px; padding: 0px 0px 0px 40px;"><li>Sentence and paragraph structure</li><li style="margin-top: 4px;">Grammar</li><li style="margin-top: 4px;">Word choice</li><li style="margin-top: 4px;">Spelling</li></ul><p style="background-color: white; color: #091e42; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 14px; margin: 12px 0px 0px; padding: 0px;"><br /></p><p style="background-color: white; color: #091e42; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 14px; margin: 12px 0px 0px; padding: 0px;"><a class="external-link" href="https://app.pluralsight.com/player?course=technical-writing-software-documentation&author=amber-israelsen&name=technical-writing-software-documentation-m2&clip=5&mode=live" rel="nofollow" style="color: #0052cc; text-decoration-line: none;">pluralsight - technical-writing-software-documentation</a></p><p style="background-color: white; color: #091e42; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, "Droid Sans", "Helvetica Neue", sans-serif; font-size: 14px; margin: 12px 0px 0px; padding: 0px;"><a data-linked-resource-id="347734153" data-linked-resource-type="page" data-linked-resource-version="1" href="https://wdevs.blogspot.com/2018/06/writing-that-works.html" style="color: #0052cc; text-decoration-line: none;">Writing That Works</a> </p>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-23048292221822221902017-02-20T17:27:00.001+01:002021-01-29T17:29:07.031+01:00Force HTTPS Rule<div class="line number1 index0 alt2" style="background: 0px center rgb(255, 255, 255); border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: #333333; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 14px; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; white-space: nowrap; width: auto;"><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"><</code><code class="xml keyword" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(127, 0, 85) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-weight: bold !important; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">system.webServer</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">></code></div><div class="line number2 index1 alt1" style="background: 0px center rgb(255, 255, 255); border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: #333333; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 14px; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; white-space: nowrap; width: auto;"><code class="xml spaces" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"> </code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"><</code><code class="xml keyword" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(127, 0, 85) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-weight: bold !important; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">rewrite</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">></code></div><div class="line number3 index2 alt2" style="background: 0px center rgb(255, 255, 255); border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: #333333; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 14px; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; white-space: nowrap; width: auto;"><code class="xml spaces" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"> </code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"><</code><code class="xml keyword" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(127, 0, 85) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-weight: bold !important; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">rules</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">></code></div><div class="line number4 index3 alt1" style="background: 0px center rgb(255, 255, 255); border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: #333333; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 14px; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; white-space: nowrap; width: auto;"><code class="xml spaces" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"> </code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"><</code><code class="xml keyword" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(127, 0, 85) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-weight: bold !important; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">rule</code> <code class="xml color1" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: gray !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">name</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">=</code><code class="xml string" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(42, 0, 255) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">"Force HTTPS"</code> <code class="xml color1" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: gray !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">enabled</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">=</code><code class="xml string" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(42, 0, 255) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">"true"</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">></code></div><div class="line number5 index4 alt2" style="background: 0px center rgb(255, 255, 255); border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: #333333; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 14px; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; white-space: nowrap; width: auto;"><code class="xml spaces" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"> </code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"><</code><code class="xml keyword" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(127, 0, 85) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-weight: bold !important; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">match</code> <code class="xml color1" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: gray !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">url</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">=</code><code class="xml string" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(42, 0, 255) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">"(.*)"</code> <code class="xml color1" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: gray !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">ignoreCase</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">=</code><code class="xml string" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(42, 0, 255) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">"true"</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">/></code></div><div class="line number6 index5 alt1" style="background: 0px center rgb(255, 255, 255); border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: #333333; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 14px; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; white-space: nowrap; width: auto;"><code class="xml spaces" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"> </code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"><</code><code class="xml keyword" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(127, 0, 85) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-weight: bold !important; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">conditions</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">></code></div><div class="line number7 index6 alt2" style="background: 0px center rgb(255, 255, 255); border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: #333333; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 14px; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; white-space: nowrap; width: auto;"><code class="xml spaces" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"> </code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"><</code><code class="xml keyword" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(127, 0, 85) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-weight: bold !important; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">add</code> <code class="xml color1" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: gray !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">input</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">=</code><code class="xml string" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(42, 0, 255) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">"{HTTPS}"</code> <code class="xml color1" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: gray !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">pattern</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">=</code><code class="xml string" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(42, 0, 255) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">"off"</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">/></code></div><div class="line number8 index7 alt1" style="background: 0px center rgb(255, 255, 255); border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: #333333; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 14px; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; white-space: nowrap; width: auto;"><code class="xml spaces" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"> </code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"></</code><code class="xml keyword" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(127, 0, 85) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-weight: bold !important; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">conditions</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">></code></div><div class="line number9 index8 alt2" style="background: 0px center rgb(255, 255, 255); border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: #333333; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 14px; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; white-space: nowrap; width: auto;"><code class="xml spaces" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"> </code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"><</code><code class="xml keyword" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(127, 0, 85) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-weight: bold !important; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">action</code> <code class="xml color1" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: gray !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">type</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">=</code><code class="xml string" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(42, 0, 255) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">"Redirect"</code> <code class="xml color1" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: gray !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">url</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">=</code><code class="xml string" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(42, 0, 255) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">"<a href="https://%7Bhttp_host%7D/%7BR:1%7D%22" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(42, 0, 255) !important; float: none; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; text-decoration-line: none; top: auto; vertical-align: baseline; width: auto;">https://{HTTP_HOST}/{R:1}"</a></code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">/></code></div><div class="line number10 index9 alt1" style="background: 0px center rgb(255, 255, 255); border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: #333333; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 14px; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; white-space: nowrap; width: auto;"><code class="xml spaces" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"> </code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"></</code><code class="xml keyword" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(127, 0, 85) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-weight: bold !important; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">rule</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">></code></div><div class="line number11 index10 alt2" style="background: 0px center rgb(255, 255, 255); border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: #333333; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 14px; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; white-space: nowrap; width: auto;"><code class="xml spaces" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"> </code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"></</code><code class="xml keyword" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(127, 0, 85) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-weight: bold !important; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">rules</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">></code></div><div class="line number12 index11 alt1" style="background: 0px center rgb(255, 255, 255); border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: #333333; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 14px; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; white-space: nowrap; width: auto;"><code class="xml spaces" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"> </code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"></</code><code class="xml keyword" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(127, 0, 85) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-weight: bold !important; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">rewrite</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">></code></div><div class="line number13 index12 alt2" style="background: 0px center rgb(255, 255, 255); border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: #333333; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 14px; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px 1em; position: static; right: auto; top: auto; vertical-align: baseline; white-space: nowrap; width: auto;"><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;"></</code><code class="xml keyword" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: rgb(127, 0, 85) !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-weight: bold !important; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">system.webServer</code><code class="xml plain" style="background: 0px center; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: black !important; float: none; font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; height: auto; left: auto; line-height: 20px; margin: 0px; min-height: inherit; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;">></code></div>Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-16927089079738446072014-01-07T13:18:00.000+01:002014-01-07T14:02:55.396+01:00IIFEIIFE stands for: <b>Immediately-Invoked Function Expression</b><br />
It is a self-executing anonimous function like this:<br />
<br />
<br />
<pre><code>(function($){
$.fn.myplugin = funnction(options) {
var settings = {};
$.extend(settings, this.myPlugin.defaults, options);
return this;
};
$.fn.myPlugin.defaults = {
option1: 'option1',
option2: 'option2',
option3: 'option3'
};
})(jQuery);
</code></pre>
<br />
<br />
Another good example:
<br />
<pre><code>
<span style="color: #38761d;">// Create an anonymous function expression that gets invoked immediately,
// and assign its *return value* to a variable. This approach "cuts out the
// middleman" of the named `makeWhatever` function reference.
//
// As explained in the above "important note," even though parens are not
// required around this function expression, they should still be used as a
// matter of convention to help clarify that the variable is being set to
// the function's *result* and not the function itself.
</span>
var counter = <b>(function(){</b>
var i = 0;
return {
get: function(){
return i;
},
set: function( val ){
i = val;
},
increment: function() {
return ++i;
}
};
<b>}());</b>
<span style="color: #38761d;">// `counter` is an object with properties, which in this case happen to be
// methods.</span>
counter.get(); <span style="color: #38761d;">// 0</span>
counter.set( 3 );
counter.increment(); <span style="color: #38761d;">// 4</span>
counter.increment(); <span style="color: #38761d;">// 5</span>
counter.i; <span style="color: #38761d;">// undefined (`i` is not a property of the returned object)</span>
i; <span style="background-color: white;"><span style="color: #274e13;">// ReferenceError: i is not defined (it only exists inside the closure)</span></span>
</code></pre>
<br />
Source: http://benalman.com/news/2010/11/immediately-invoked-function-expression/Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-12544020870491112352013-06-18T13:37:00.001+02:002013-06-20T15:13:05.699+02:00Passing Date parametere from Javascript to WCFHaving a service method that accepts two parameters will look like this:<br />
<br />
<pre><span style="color: black;">[DataContract()]
</span><span style="color: blue;">public</span><span style="color: black;"> </span><span style="color: blue;">class</span><span style="color: black;"> ServiceRequest
{
[DataMember()]
Nullable<DateTime> DateTimeFrom { </span><span style="color: blue;">get</span><span style="color: black;">; </span><span style="color: blue;">set</span><span style="color: black;">; }
[DataMember()]
Nullable<DateTime> DateTimeTo { </span><span style="color: blue;">get</span><span style="color: black;">; </span><span style="color: blue;">set</span><span style="color: black;">; }
}
[ServiceContract()]
</span><span style="color: blue;">public</span><span style="color: black;"> </span><span style="color: blue;">interface</span><span style="color: black;"> IService
{
[WebInvoke(UriTemplate = </span><span style="color: maroon;">"getServiceCall"</span><span style="color: black;">, Method = </span><span style="color: maroon;">"POST"</span><span style="color: black;">)]
ServResponse GetBusinessObjects(ServiceRequest filter);
}</span></pre>
Now, To start calling this method we need to construct a Json data representing the parameters.<br />
<pre> var fromDate = new Date(2013, 06, 18);
var toDate = new Date();
var datavar = {
DateTimeFrom: fromDate.toMSJSON(),
DateTimeTo: toDate.toMSJSON()
};
var parameters = JSON.stringify(datavar);
</pre>
<br />
But, before calling the <b>toMSJSON</b> on date object we need to define it as follows:
<br />
<br />
<br />
<pre><b><b><span style="color: green;">// Let Date type be compatible for Microsoft WCF</span><span style="color: black;">
Date.prototype.toMSJSON = function () {
</span><span style="color: green;">/// <summary></span><span style="color: green;">Let Date type be compatible for Microsoft WCF.</span></b></b><b><b><span style="color: green;"></summary></span></b></b><b><b><span style="color: green;"></span></b></b></pre>
<span style="color: black;">var date = </span><span style="color: maroon;">'/Date('</span><span style="color: black;"> + </span><span style="color: blue;">this</span><span style="color: black;">.getTime() </span><span style="color: black;"> + </span><span style="color: maroon;">'-0000)/'</span><span style="color: black;">;</span><br />
<pre><b><span style="color: black;">};</span></b><h3>
</h3>
<h3>
<b>Getting DateTime from WCF</b></h3>
<b><pre><span style="color: green;">// convert WCF date to Javascript</span><span style="color: black;">
String.prototype.DateWCF = function () {
</span><span style="color: grey;">///</span><span style="color: green;"> </span><span style="color: grey;"><summary></span><span style="color: green;">convert string into Date</span><span style="color: grey;"></summary></span><span style="color: green;">
</span><span style="color: black;"> var matches = </span><span style="color: blue;">this</span><span style="color: black;">.match(/\/Date\(([</span><span style="color: red;">0</span><span style="color: black;">-</span><span style="color: red;">9</span><span style="color: black;">]+)(?:.*)\)\</span><span style="color: green;">//);</span><span style="color: black;">
</span><span style="color: blue;">if</span><span style="color: black;"> (matches)
</span><span style="color: blue;">return</span><span style="color: black;"> </span><span style="color: blue;">new</span><span style="color: black;"> Date(parseInt(matches[</span><span style="color: red;">1</span><span style="color: black;">]));
};</span></pre>
</b></pre>
<pre><b>Notice that when you use a date in javascript it is representing your local date based on the settings on your systemn and browser. As a result you might pass different notation to WCF. For example, my broweser has an timezone offset of -120 minutes. So when I ask to convert 06/20/2013 02:10:04 I see 2013-06-20T00:10:04.000Z which is perfectly normal because that represents the same exact time as I meant on my browser. Thus WCF will get the correct date aswell.</b></pre>
Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-44508866728010764112013-04-05T09:52:00.003+02:002013-04-05T09:53:02.057+02:00Minify js and css files in Visual Studio 2012Finally we got an integrated tool in VS2012 that does the jobin Solution Explorer:<br />
<b>Web Essentials</b><br />
You can enable this tool using the Extensions And Updates from the TOOLS menu.<br />
<br />
<br />
<ol>
<li>First, right-click on the css file and from the Web Essentials context menu choose to <b>Minify CSS Files</b>. This will ensure that with every build it will generate the accompanying .min.css file too.</li>
<li>Make sure you have the Web.Release.config beside your web.config</li>
<li>In your .aspx or .master file put an if statement to figure out if this is running on your debug mode or release mode:</li>
</ol>
<pre>.
<% if (HttpContext.Current.<b>IsDebuggingEnabled</b>) { %>
<link href="/css/MyFile.css" rel="stylesheet" type="text/css"></link>
<%} else {%>
<link href="/css/MyFile.min.css" rel="stylesheet" type="text/css"></link>
<%} %>
.
</pre>
Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-19164846672937572172013-03-27T11:08:00.003+01:002013-03-27T11:08:43.112+01:00Do more with less<br />
<br />
You can do more with less by reducing your design to its essence, and solving for distractions,<br />
not discoverability. Create a clean and purposeful experience by leaving only the most relevant<br />
elements on screen so people can be immersed in the content.<br />
<br />
<ul>
<li>Be great at something instead of mediocre at many things.</li>
<li>Put content before chrome.</li>
<li>Be visually focused and direct, letting people get immersed in what they love, and they will explore the rest.</li>
<li>Inspire confidence in users. </li>
</ul>
<br />
Desktop browsers have quite a lot of chrome (menus, options, status bars, and so on) that is<br />
only sometimes useful. Typically, however, users open a browser to see a webpage, not to<br />
interact with the browser. Moving commands off the browser chrome and into the app bar or<br />
into charms helps users focus on what they care about.<br />
<br />Copied from Windows 8 User Experience Guidelines<br />
Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-63826806091880653492013-03-27T10:22:00.000+01:002013-03-27T10:27:58.343+01:00Passed 70-480 examYesterday morning I passed the exam in very short time (about an hour).<br />
Amazingly, most of the questions were very familiar and the hints people provided earlier has been very helpful.<br />
<br />
<ul>
<li>http://moustafa-arafa.blogspot.nl/2012/12/study-material-for-programming-html5.html</li>
<li>http://geekswithblogs.net/WTFNext/archive/2012/10/08/exam-70-480-study-material-programming-in-html5-with-javascript-and.aspx</li>
<li>http://www.techexams.net/forums/microsoft-developers-certifications/79076-70-480-programming-html5-javascript-css3.html</li>
</ul>
<div>
And a magor help from ExamCollection:</div>
<div>
http://www.examcollection.com/microsoft/Microsoft.BrainDump.70-480.v2013-02-04.by.HakimAli.70q.vce.file.html</div>
<div>
<br /></div>
Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.comtag:blogger.com,1999:blog-3171526930201997488.post-42679322255408385182013-02-28T14:34:00.001+01:002013-02-28T14:34:37.314+01:00Finds Close Points by DistanceIn this example I am trying to find the distance between the locations in a table and a given point. When I found the distance I will return thee result filtered by a allegible distance.<br />
<pre><span style="color: #6aa84f;">-- =============================================
-- Author: Asghar Panahy
-- Create date: 28-Feb-2013
-- Description: Zoekt objecten binnen bereik van gegeven punt
-- =============================================
</span>ALTER PROCEDURE [dbo].[BereikbareObjecten]
<span style="color: #6aa84f;">-- Add the parameters for the stored procedure here</span>
@orig_lat REAL ,
@orig_lng REAL,
@binnenMeter integer
AS
BEGIN
<span style="color: #6aa84f;">-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.</span>
SET NOCOUNT ON;
<span style="color: #38761d;">---------------------------------------------------------
-- Select your SRID wisely. Don't follow me.
-- select * from sys.spatial_reference_systems
</span><span style="color: #38761d;"> -- </span><span style="color: #38761d;">where spatial_reference_id in (4937, 4258, 4326, 4269)</span>
DECLARE @SRID as int = 4326;
<span style="color: #38761d;">---------------------------------------------------------</span>
DECLARE @orig geography;
<b>SET @orig = <span style="color: blue;">geography::Point</span>(@orig_lat, @orig_lng, @SRID);
</b>
SELECT *,CONVERT(INT, <b><span style="color: blue;">@orig.STDistance</span></b>( geography::Point([object].[Latitude], [object].[Longitude], @SRID))) As [Distance]
INTO #MyTempTable
FROM [Object]
SELECT * FROM #MyTempTable
WHERE [Distance] <= @binnenMeter
ORDER BY [Distance]
END
</pre>
Pouya Panahyhttp://www.blogger.com/profile/01617558889185388258noreply@blogger.com