ТЕМА: Lansing : azure devops webhooks - Eduard Kabrinskiy

Lansing : azure devops webhooks - Eduard Kabrinskiy 2 років 10 місяців тому #30259

Kabrinskiy Eduard - Azure pipelines docs - Kabrinskiy Eduard


<h1>Azure pipelines docs</h1>
<p>[youtube]</p>
Azure pipelines docs <a href="remmont.com">News sites</a> Azure pipelines docs
<h1>Deploying Blazor Apps Using Azure Pipelines</h1>
<p style="clear: both"><img src="chrissainty.com/content/images/size/w200...ying-blazor-apps.jpg" /></p>
<p style="clear: both"><img src="chrissainty.com/assets/images/blazor-in-action-meap.png" /></p>
<p>My book, <strong>Blazor in Action</strong> - an example-driven guide to building client-side web apps using C# and .NET - is now <strong>available to buy</strong> via the Manning Early Access Program (MEAP).</p>
<p>In my previous post, I showed how you can use Azure pipelines to build your Blazor (or Razor Components) apps. This time, I'm going to show you how you can deploy a Blazor app to Azure storage using Azure pipelines.</p>
<p>One of the great things about Blazor applications, once published, they're just static files. This means they can be hosted on a wide variety of platforms as they don't require .NET to be running on the server.</p>
<p>This opens up loads of hosting options which .NET developers have not been able to use before now. The one I'm going to show you in this post is Azure storage. Just to be clear, Azure storage is not a free option but it's a very low cost one. I use Azure a lot so keeping everything in one place is easier for me and I'm happy to pay a few pennies a month for that. If you're looking for a completely free option, then GitHub Pages or Netlify would be worth checking out.</p>
<p>I'm going to assume you already have an Azure account, but if you don't, you can sign up for one here.</p>
<h2>Creating a Storage Account</h2>
<p>We're going to start by creating a new storage account, this is where our site is going to be deployed. Once you're logged into the Azure portal, go to the <em>storage accounts</em> service.</p>
<p>From here, click <em>Add</em>.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/add-storage-account.gif" /></p>
<p>We're now presented with the create storage account screen.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/c...-storage-account.gif" /></p>
<p>If you have multiple subscriptions you will need to make sure the one selected is correct. You then need to do the same with the resource group. You also need to give the storage account a name. You can leave the defaults for everything else and press <em>Review + create</em>.</p>
<p>You'll now be presented with a summary of what is going to be set up.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/r...-storage-account.jpg" /></p>
<p>You just need to press <em>Create</em> and Azure will begin deploying your new storage account.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/d...-storage-account.jpg" /></p>
<h2>Configuring the Storage Account</h2>
<p>After a minute or two your new storage account should be ready. If you go to the storage account service, as we did earlier, you should see your new account in the list. Click on it and you'll be taken to the details view. You then need to click on the <em>Static website</em> link in the settings menu.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/storage-settings.jpg" /></p>
<p>You should now see the static site configuration screen.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/static-site-settings.jpg" /></p>
<p>Click <em>Enabled</em>, then add <em>index.html</em> for both the index document name and the error document name. What this does is set up some redirects so all requests get passed to the index.html document. We need this to happen so that Blazors router can manage all requests and load the correct components.</p>
<p>Once you've finished, you can click <em>save</em>.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/s...ic-site-settings.jpg" /></p>
<p>After saving you will now see two extra fields, <em>primary endpoint</em> and <em>secondary endpoint</em>. These are the addresses you use to load your site once we've deployed it. Save these, we'll need them later to check the website is working once we've deployed it.</p>
<p>That's it for the storage account. We can now head over to Azure pipelines and build our release pipeline.</p>
<h2>Creating a Release Pipeline</h2>
<p>From your Azure pipelines account, select your project and under Pipelines, select releases.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/r...sepipelines-menu.jpg" /></p>
<p>You then need to click <em>New pipeline</em>.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/new-release-pipeline.jpg" /></p>
<p>You should now see the new release pipeline screen with a menu on the right.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/empty-job.jpg" /></p>
<p>From the menu select <em>Empty job</em> template right at the top. You will now have the option to name the stage.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/stage-name.jpg" /></p>
<p>You can call this whatever you want, but it's probably best to give it meaningful name as I have above. Release pipelines can be made up of many stages. You could have stages for dev, QA and prod for example. If you want to know more about stages in release pipelines you can check out the docs.</p>
<h3>Selecting an Artifact</h3>
<p>Before we configure any tasks we need to tell the pipeline what we want to deploy. In the previous post we created a build artifact, this is where we configure the release pipeline to use it.</p>
<p>Click on the <em>Add an artifact</em> box in the pipeline.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/select-artifact.jpg" /></p>
<p>In the modal, select <em>Build</em> then the name of the project containing your build pipeline from last time. Finally, select the source. Once you're done, click <em>Add</em>.</p>
<h3>Tasks</h3>
<p>In the stages section of the pipeline click on the link under you stages name.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/add-stage-tasks.jpg" /></p>
<p>You will then be taken to the Tasks screen.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/manage-tasks.jpg" /></p>
<p>From here click on the + on the agent job.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/azure-file-copy-task.jpg" /></p>
<p>In the search box, type "<em>azure file copy"</em>. You should see the task above, click <em>Add</em>. The task should appear under the Agent job with some error text stating <em>some settings need attention</em>. Click on the new job.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/a...le-copy-settings.jpg" /></p>
<p>We now have to fill in the details highlighted in red. The first is the source, this one is important to get right, if we don't, we'll end up deploying the wrong files.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/select-dist-folder.jpg" /></p>
<p>It's important that when building your Blazor app that you don't have the publish step set to zipAfterPublish . In the last post we set this to false, now you can see why. We need to drill down through the published folders to the <em>dist</em> folder. If we'd set zipAfterPublish too true we wouldn't be able to do this.</p>
<p>Once you've selected the <em>dist</em> folder, click <em>OK</em>.</p>
<p>Next, select your Azure subscription. You may also need to authorise your account at this point. If so, you'll see a blue <em>Authorize</em> button. Just click it and follow the authorisation process.</p>
<p>The destination type needs to be set to <em>Azure blob</em>. The RMStorage Account is the name of the storage account we set up earlier. Finally, the container name should be <em>$web</em>, we saw this earlier when configuring the static site details in Azure storage.</p>
<p>That's all the configuration done! To finish up you can click on the pipelines name and call it something more meaningful.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/name-pipeline.jpg" /></p>
<p>Once you're happy click <em>Save.</em></p>
<h2>Creating a Release</h2>
<p>You should now be able to create a release using the new pipeline. The <em>+Release</em> button next to the save button should be enabled, click it and you will see the create a release modal appear.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/create-release.jpg" /></p>
<p>Select the Version, this will be the latest build from your build pipeline. Then click <em>Create</em>.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/release-one.jpg" /></p>
<p>You can click on the link to Release-1 and after a few seconds you should hopefully see a successfully completed release.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/release-completed.jpg" /></p>
<h2>Checking the Site</h2>
<p>When we configured the static website settings for Azure storage earlier we were assigned two URLs. You can use either of them to test that the site is working. If all has gone to plan you should see your app running.</p>
<p style="clear: both"> <img src="chrissainty.com/content/images/2019/03/deployed-blazor-app.jpg" /></p>
<h2>Summary</h2>
<p>In this post, I showed how you can take a Blazor application built with Azure pipelines, create a release pipeline for it and then deploy it to Azure storage as a static website.</p>
<p>We've really only scrapped the surface of what is possible with Azure pipelines. It's an amazing tool to have at our disposal. And let's not forget that it's <em>free</em> as well. If you want to learn more, then head over to the Microsoft Docs site. They have loads of great information to check out.</p>
<h4>Share On </i>
</ul>
</h4>
<h3>Subscribe to Chris Sainty - Building with Blazor</h3>
<p>Get the latest posts delivered right to your inbox</p>
<h2>Azure pipelines docs</h2>

<h3>Azure pipelines docs</h3>
<p>[youtube]</p>
Azure pipelines docs <a href="remmont.com">Latest news</a> Azure pipelines docs
<h4>Azure pipelines docs</h4>
In this second of two posts, I show how to create a release pipeline for your Blazor app using Azure pipelines, deploying to Azure storage as a static site.
<h5>Azure pipelines docs</h5>
Azure pipelines docs <a href="remmont.com">Azure pipelines docs</a> Azure pipelines docs
SOURCE: <h6>Azure pipelines docs</h6> <a href="dev-ops.engineer/">Azure pipelines docs</a> Azure pipelines docs
#tags#[replace: -,-Azure pipelines docs] Azure pipelines docs#tags#

Эдуард Кабринский
world news
  • EMMABoolo
  • EMMABoolo аватар
  • Немає на сайті
  • Платиновий учасник
  • Дописи: 1187
  • Репутація: 0
Адміністратор заборонив доступ на запис.
Час відкриття сторінки: 0.046 секунд