<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Renicius Pagotto</title>
    <description>The latest articles on DEV Community by Renicius Pagotto (@reniciuspagotto).</description>
    <link>https://dev.to/reniciuspagotto</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F328420%2Fff247eb3-567d-4597-bc50-2e2ae0dbc984.jpeg</url>
      <title>DEV Community: Renicius Pagotto</title>
      <link>https://dev.to/reniciuspagotto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/reniciuspagotto"/>
    <language>en</language>
    <item>
      <title>Designing Effective CI/CD Pipelines: Practical Insights and Best Practices</title>
      <dc:creator>Renicius Pagotto</dc:creator>
      <pubDate>Thu, 06 Feb 2025 15:10:33 +0000</pubDate>
      <link>https://dev.to/reniciuspagotto/designing-effective-cicd-pipelines-practical-insights-and-best-practices-39h1</link>
      <guid>https://dev.to/reniciuspagotto/designing-effective-cicd-pipelines-practical-insights-and-best-practices-39h1</guid>
      <description>&lt;p&gt;In today's fast-paced development environment, modern CI/CD pipelines have become essential for delivering high-quality software efficiently. By automating key processes like testing and deployment, they enable teams to focus on innovation while minimizing risks.&lt;/p&gt;

&lt;p&gt;Before we jump on how to design our pipelines, let's go through for some concept to make sure a comprehensive understanding.&lt;/p&gt;

&lt;h3&gt;
  
  
  CI/CD Pipeline
&lt;/h3&gt;

&lt;p&gt;A CI/CD pipeline is an automated workflow that integrates Continuous Integration (CI) and Continuous Delivery/Deployment (CD) practices. It automates the process of building, testing, and deploying code changes, ensuring that software is delivered reliably and efficiently. The pipeline typically includes stages for code integration, automated testing, and deployment to production. &lt;/p&gt;

&lt;h3&gt;
  
  
  Continuous Integration
&lt;/h3&gt;

&lt;p&gt;It's a practice where the code is frequently integrated in a shared branch and each integration is tested to detect early issues, ensuring that new code doesn't break existing functionality. This practice promotes early bug detection, strengthens collaboration among developers, and accelerates the development process by streamlining integration and testing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Continuous Delivery / Deployment
&lt;/h3&gt;

&lt;p&gt;There is a subtle distinction between Continuous Delivery and Continuous Deployment, but both involve automating the deployment process to eliminate manual intervention. The main difference is that Continuous Delivery includes a manual approval step before deploying code to the production environment, while Continuous Deployment automates the entire process, with or without automatic approval. Automatic approval can involve integration with tools like ServiceNow, which track changes in production and collect necessary approvals from stakeholders.&lt;/p&gt;

&lt;p&gt;Here is a very good image demonstrating what a CI/CD pipeline looks like and how it works. It gives a clear picture of each step in the process.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F10svkhwobkha1b2yv6rm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F10svkhwobkha1b2yv6rm.png" alt="Image description" width="700" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we have a clear picture about a CI/CD pipeline, let's discuss about the step we must include in the process in order to have a reliable pipeline and guarantee a good quality for our code.&lt;/p&gt;

&lt;p&gt;A well-designed CI/CD pipeline should include steps to ensure that the code builds successfully without any issues, incorporates thorough testing, and, most importantly, prioritizes security. Below, we will outline the process step by step.&lt;/p&gt;

&lt;h3&gt;
  
  
  Build and Restore
&lt;/h3&gt;

&lt;p&gt;Here the download of the dependencies will happen and the code will be compiled or assembled into executable software. The build step ensures that the code is correctly structured and ready for further stages like testing and deployment. Restore is related to dependencies, in the case of .NET we have an explicit command to download only the dependencies before compilation, the same goes for Java, but not all of them are necessary, however it depends entirely on whether or not you have this specific step.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tests
&lt;/h3&gt;

&lt;p&gt;It's a pipeline step that will be to run various tests to ensure code quality. This can include unit tests, integration tests, smoke tests, and so on. It's not mandatory to have all of these types of tests, it will depend a lot on the context of the project, but at least unit tests should be present.&lt;/p&gt;

&lt;p&gt;I would like to say that this is a mandatory step, but unfortunately not all projects have tests to run (I won't go into that discussion here), so if tests are present, this step is mandatory and the pipeline should fail if any test suite fails. &lt;/p&gt;

&lt;h3&gt;
  
  
  Security
&lt;/h3&gt;

&lt;p&gt;This is a kind of step that it's always forgotten by teams. In general, we don't focus on security, specially when comes to docker image but is really important to have a step dedicated for it. In security step, we must cover vulnerabilities in our code, in the dependencies and specially in the image we are using as base to generate a image of our application.&lt;/p&gt;

&lt;p&gt;This step ensures vulnerabilities are identified and addressed before deployment, reducing risks in production environments.&lt;/p&gt;

&lt;p&gt;Vulnerabilities are classified by levels and scores (thinking specifically of the Snyk tool) and not all vulnerabilities should fail in the pipeline. We can think of it as follows.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Critical Vulnerabilities&lt;/strong&gt;: Must fail the pipeline&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;High Vulnerabilities&lt;/strong&gt;: Must fail the pipeline&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Medium and Low&lt;/strong&gt;: Do not need to fail the pipeline, but they should be addressed proactively.Teams should monitor these vulnerabilities weekly to ensure their number does not increase over time. Regular reviews and tracking help prevent the accumulation of vulnerabilities that could potentially escalate into more significant risks.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's a simple example of a GitHub Action where I defined 2 different steps for security.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvim9lrq178b3h0tz40cj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvim9lrq178b3h0tz40cj.png" alt="Image description" width="634" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Image security must be included in our pipeline in order to guarantee a reliable software. The vulnerability may not originate from the application or its dependencies but it can come by part of a image, that's why it's important to have a dedicated step for it.&lt;/p&gt;

&lt;p&gt;One of the tool I like to use is Trivy, an open-source security tool that can be used to scan any kind of vulnerability in dockerfile. As Snyk, Trivy has different levels of vulnerability and can be defined a vulnerability threshold to fail the pipeline.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/reniciuspagotto/az-devapp-container/blob/main/.github/workflows/app.yml#L35" rel="noopener noreferrer"&gt;Here is&lt;/a&gt; a simple example of a security pipeline I have implemented before. It contains both Snyk and Trivy steps&lt;/p&gt;

&lt;h3&gt;
  
  
  Artifact
&lt;/h3&gt;

&lt;p&gt;This step is responsible for generating the versioned artifact that will be deployed later, whether it’s an executable binary or a container image. The specific implementation depends on whether your application is containerized or relies on binary code.&lt;/p&gt;

&lt;h5&gt;
  
  
  For Containerized Applications
&lt;/h5&gt;

&lt;p&gt;For containerized applications, this step involves creating a Docker image using Docker commands and pushing it to a container registry. Examples of popular registries include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Azure Container Registry&lt;/li&gt;
&lt;li&gt;Private Docker Hub&lt;/li&gt;
&lt;li&gt;JFrog Artifactory&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Docker image serves as the deployable artifact, encapsulating all dependencies and configurations needed to run the application reliably across environments.&lt;/p&gt;

&lt;h5&gt;
  
  
  For Non-Containerized Applications
&lt;/h5&gt;

&lt;p&gt;Step responsible for generating binary code (e.g., DLLs, JARs), in this case, binaries are saved to a specific versioned directory in an artifact repository like Artifactory. This ensures that each build is uniquely identifiable and traceable.&lt;/p&gt;

&lt;h5&gt;
  
  
  Versioning
&lt;/h5&gt;

&lt;p&gt;Versioning is essential for both container images and binary artifacts. It can be implemented during this step or earlier in the pipeline by defining a version based on specific information, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Labels defined in pull requests.&lt;/li&gt;
&lt;li&gt;Commit messages or titles.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Proper versioning ensures traceability and consistency across deployments, reducing the risk of deploying incorrect artifacts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deployment
&lt;/h3&gt;

&lt;p&gt;Deployment is the next critical step in the CI/CD pipeline, representing the Continuous Delivery or Continuous Deployment phase. This is where the binary code or container image generated during the artifact stage is used to deploy the application to environments such as Azure, AWS, GCP, or even on-premises infrastructure.&lt;/p&gt;

&lt;p&gt;For most environments—like development, testing, and staging—this step typically runs automatically without requiring manual intervention. However, for production environments, an additional layer of control may be necessary. In such cases, an approval gateway might be implemented to ensure compliance with organizational policies before deployment proceeds.&lt;/p&gt;

&lt;h3&gt;
  
  
  Approval Gateway
&lt;/h3&gt;

&lt;p&gt;An approval gateway is a manual step in CI/CD pipelines, primarily used in production environments to ensure compliance with organizational policies and mitigate risks. In many companies, deploying to production requires approvals from managers or stakeholders, often collected through emails or meetings. This reliance on manual intervention makes full automation impossible. However, modern tools like ServiceNow can streamline this process by integrating directly into the pipeline. For example, the pipeline can automatically create a change request in ServiceNow and pause execution until the request is approved. This integration balances automation with oversight, ensuring deployments meet compliance requirements while maintaining efficiency.&lt;/p&gt;

&lt;p&gt;In contrast, approval gateways are unnecessary when manual approvals are not required. In such cases, pipelines can automatically deploy applications to production after passing all predefined stages, such as rigorous testing and post-deployment validations. This approach is common in Continuous Deployment scenarios, where speed and efficiency are prioritized. However, it requires well-defined pipeline steps and robust testing to minimize risks. For non-production environments like development or staging, direct deployments without manual intervention should always be encouraged to maintain agility and accelerate feedback cycles.&lt;/p&gt;

&lt;h3&gt;
  
  
  Post-Deployment Testing
&lt;/h3&gt;

&lt;p&gt;Post-deployment testing is a crucial stage in the CI/CD pipeline, designed to validate the functionality and stability of an application after deployment. This stage can be executed after deploying to a staging environment or even after a production deployment. It involves running various test cases, such as end-to-end (E2E) tests, smoke tests, regression tests, and others, to ensure that the application operates as expected with the newly implemented features. While this stage is not mandatory, its inclusion depends on the project’s context and the agreements made within the team.&lt;/p&gt;

&lt;p&gt;Typically, post-deployment testing is most effective when performed after deployment to a pre-production environment. This allows teams to detect and address potential issues before deploying to production. However, in Continuous Deployment scenarios, where changes are automatically pushed to production, post-deployment testing can also occur after production deployment. In such cases, having a robust validation suite is essential to catch any issues early and trigger an automated rollback process if necessary.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rollback Mechanisms
&lt;/h3&gt;

&lt;p&gt;Rollback mechanisms are an essential part of a CI/CD pipeline, designed to maintain system stability in case of deployment or post-deployment test failures. When an issue is detected—either during automated testing or through monitoring in production—the pipeline can automatically revert the application to the last known stable version. This process minimizes downtime and mitigates the impact of faulty deployments.&lt;/p&gt;

&lt;p&gt;Automated rollback typically works by leveraging versioned artifacts or container images stored in registries or repositories. For instance, if a deployment fails, the pipeline can redeploy the previous version of the application. Rollbacks can also be triggered by monitoring tools that detect anomalies, such as increased error rates or degraded performance. Integrating rollback mechanisms ensures a safer deployment process, especially in Continuous Deployment scenarios where changes are pushed to production frequently.&lt;/p&gt;

&lt;h3&gt;
  
  
  Flaky Tests
&lt;/h3&gt;

&lt;p&gt;Flaky tests are tests that produce inconsistent results, passing sometimes and failing others, despite no changes having been made to the underlying code. These unpredictable outcomes make it difficult to identify the root cause of the failures. Addressing flaky tests is crucial because they can erode trust in the testing pipeline, reduce productivity, obscure real issues, and delay deployments. To mitigate these problems, teams should focus on reviewing test cases, maintaining clean and well-organized test suites, and refactoring brittle or unreliable tests. These practices help ensure the reliability of automated testing, fostering a robust and efficient pipeline.&lt;/p&gt;

&lt;p&gt;Below is an example of a common flaky test behavior&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F61hinyqzleg60fv2kpcs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F61hinyqzleg60fv2kpcs.png" alt="Image description" width="800" height="514"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Optimization Techniques
&lt;/h2&gt;

&lt;p&gt;Pipeline performance is a crucial factor in ensuring efficient and timely software delivery. A poorly optimized pipeline can lead to delays, wasted resources, and frustration for development teams. Here, we’ll explore some important optimization techniques to improve the performance and reliability of your CI/CD pipeline.&lt;/p&gt;

&lt;h4&gt;
  
  
  Cache Dependencies
&lt;/h4&gt;

&lt;p&gt;One of the most important aspects to consider in pipeline execution is managing the dependencies required to perform its steps. Without a caching mechanism, the pipeline will repeatedly download these dependencies for every execution, significantly delaying completion and wasting resources. The same principle applies to tools like Trivy, where each execution downloads a new vulnerability database. By caching these dependencies and databases, we can reuse them in subsequent runs, reducing build times, optimizing resource usage, and improving overall efficiency. Caching not only accelerates pipelines but also ensures consistency across builds by reusing the same versions of dependencies.&lt;/p&gt;

&lt;p&gt;Below are examples of caching dependencies in GitHub Actions to enhance pipeline efficiency. The first caches the Trivy vulnerability database to reduce scan times, and the second caches Gradle dependencies to accelerate builds. Caching improves speed and optimizes CI workflows.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F01nyvvktkg3kqt7yhio9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F01nyvvktkg3kqt7yhio9.png" alt="Image description" width="800" height="174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv39yh8biultfnsqu1t2k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv39yh8biultfnsqu1t2k.png" alt="Image description" width="800" height="261"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Applying Parallelism: When and Why?
&lt;/h4&gt;

&lt;p&gt;Parallelism is a concept that can help improve pipeline performance, but we don't always need to apply it, it depends a lot on the context.&lt;/p&gt;

&lt;p&gt;Bringing the term parallelism to the CI/CD pipeline, we can apply this concept at various times, such as when running tests at the beginning of the execution. We don't need to run the tests sequentially, that is, first run the unit tests, then the integration tests, then the vulnerability tests. This will completely reduce the pipeline's performance and will increase the execution time for unnecessary things. We can use parallelism very well here, where everything will be executed in parallel, but the failure of one thing will not affect the execution of another thing and at the end we will have a lot of information about everything we need to fix in case of failure. The execution time in the case of parallelism is given by the process that takes the longest.&lt;/p&gt;

&lt;p&gt;Sequential execution is applied in cases where we need to wait for the result of the previous step. A good example is the initial tests I mentioned above that can be executed in parallel where the binary generation step or the container image generation step needs to wait for the result of the previous step, in this case the unit, integration and security tests. We cannot generate artifacts that contain vulnerabilities, are of low quality and full of bugs because it is a waste of time and processing, in addition to the possibility of this code being deployed due to some human error.&lt;/p&gt;

&lt;p&gt;Below is an example of parallelism applied to the security step, enabling multiple security checks to run simultaneously.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg04q0rcqby0mvc1hwep5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg04q0rcqby0mvc1hwep5.png" alt="Image description" width="800" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;A well-designed CI/CD pipeline is not just a technical necessity but a strategic advantage in delivering reliable software quickly. By incorporating thorough testing, security measures, and optimization techniques, teams can ensure smooth deployments while maintaining high quality.&lt;/p&gt;

&lt;p&gt;Did you enjoy this post? Interested in discussing CI/CD further? Feel free to share your questions and ideas in the comments or connect with me on &lt;a href="https://www.linkedin.com/in/renicius-pagotto/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>pipeline</category>
      <category>cicd</category>
      <category>automation</category>
    </item>
    <item>
      <title>The Importance of CI/CD in Modern Software Development</title>
      <dc:creator>Renicius Pagotto</dc:creator>
      <pubDate>Fri, 03 Jan 2025 21:21:18 +0000</pubDate>
      <link>https://dev.to/reniciuspagotto/the-importance-of-cicd-in-modern-software-development-3d9k</link>
      <guid>https://dev.to/reniciuspagotto/the-importance-of-cicd-in-modern-software-development-3d9k</guid>
      <description>&lt;p&gt;In today's software engineering process, delivering software quickly and efficiently is like a mantra. And when we think about how to deliver quickly and efficiently, the term DevOps comes to mind, more specifically the automation pillar. This is one of the most important pillars that helps to maximize the delivery process through CI/CD pipelines.&lt;/p&gt;

&lt;p&gt;Continuous integration (CI) and continuous deployment (CD) simplify and improve the entire software development and delivery process through automation.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Automation?
&lt;/h3&gt;

&lt;p&gt;Automation is basically the use of tools and scripts to perform tasks in an automated manner. This includes tasks like code compilation, unit and integration testing, security steps, vulnerability identification, load testing, deployment, and so on. By automating these processes, teams can streamline workflows and improve overall efficiency.&lt;/p&gt;

&lt;p&gt;Automation is crucial for several reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Efficiency and Speed&lt;/strong&gt;: Automation reduces the time and effort required for repetitive tasks such as testing, building, and deploying code. Automated pipelines run tests and deployments much faster than manual processes, significantly reducing the time from code commit to production release. This allows developers to focus on writing code and solving complex problems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Consistency and Reliability&lt;/strong&gt;: Automated processes ensure tasks are performed the same way every time, reducing the risk of human error and increasing the reliability of the software. Continuous feedback from automation helps detect and address issues early in the development cycle.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scalability&lt;/strong&gt;: Automation enables teams to handle larger codebases and more frequent changes without a proportional increase in manual effort, making it easier to scale development processes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What is Continuous Integration (CI)?
&lt;/h3&gt;

&lt;p&gt;Continuous Integration is a development practice in which application code is integrated at least once a day (it depends a lot on the team and the context of the task). For each integration, several sets of tests, security checks, and more are automatically run to catch bugs as quickly as possible.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Integration is the practice of committing changes and pushing them to the main branch or feature branch on an origin.&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Key Benefits of CI:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Early Detection of Errors&lt;/strong&gt;: Frequent code integration allows for early detection of bugs and vulnerabilities, making patching much faster, cheaper, and more efficient.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Improved Collaboration&lt;/strong&gt;: CI promotes collaboration among team members by working on a common codebase and resolving conflicts early.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Faster Feedback&lt;/strong&gt;: Automated tests offer immediate feedback on code quality, enabling developers to address issues promptly.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What is Continuous Delivery (CD)?
&lt;/h3&gt;

&lt;p&gt;Continuous Delivery is the next step from Continuous Integration where code changes are automatically prepared for release to production. Once the code passes all automated tests and checks, the changes are manually approved and then released to the users.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Continuous Deployment (CD)?
&lt;/h3&gt;

&lt;p&gt;Continuous deployment is an advanced practice of continuous delivery where every change that passes automated testing is automatically deployed to production without any manual intervention, ensuring that new features, bug fixes, and improvements are delivered to users as soon as they are ready, and the software is always in a deployable state.&lt;/p&gt;

&lt;h4&gt;
  
  
  Key Benefits of Continuous Delivery and Deployment:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Faster Time to Market&lt;/strong&gt;: Continuous delivery and deployment enable rapid release cycles, allowing new features and updates to reach users quickly by reducing the time it takes to release new features and bug fixes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Improved Quality and Reliability&lt;/strong&gt;: Automated testing and deployment processes reduce the risk of human error, ensuring that only thoroughly tested code reaches production and that releases are consistent and repeatable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enhanced Collaboration and Productivity&lt;/strong&gt;: By automating repetitive tasks, development teams can focus on more valuable work, fostering better collaboration and increasing overall productivity.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reduced Manual Effort&lt;/strong&gt;: Automation eliminates the need for manual deployment processes, further reducing the risk of human error and ensuring a more reliable software release process.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  CI/CD Platforms
&lt;/h3&gt;

&lt;p&gt;Here are some CI/CD platforms we can use to create pipelines&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Jenkins&lt;/li&gt;
&lt;li&gt;GitHub Actions&lt;/li&gt;
&lt;li&gt;GitLab CI/CD&lt;/li&gt;
&lt;li&gt;Azure DevOps&lt;/li&gt;
&lt;li&gt;Argo CD&lt;/li&gt;
&lt;li&gt;CircleCI&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Continuous Integration and Continuous Deployment (CI/CD) practices are essential for modern software development, enabling teams to deliver high-quality software quickly and efficiently. By automating processes such as integration, testing, security, and deployment, CI/CD helps to detect errors early, identify code vulnerabilities, enhance collaboration, and reduce manual effort. Adopting CI/CD can significantly improve the quality and speed of software delivery, providing organizations with a competitive edge in the market.&lt;/p&gt;

&lt;p&gt;Did you enjoy this post? Want to chat more about CI/CD? Leave a comment with your questions and ideas or connect with me on &lt;a href="https://www.linkedin.com/in/renicius-pagotto/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>cicd</category>
      <category>automation</category>
      <category>pipeline</category>
    </item>
    <item>
      <title>Publishing Docker images to Azure Container Registry with GitHub Actions</title>
      <dc:creator>Renicius Pagotto</dc:creator>
      <pubDate>Mon, 29 Jul 2024 14:03:21 +0000</pubDate>
      <link>https://dev.to/reniciuspagotto/publishing-docker-image-in-azure-container-registry-with-github-actions-4i7</link>
      <guid>https://dev.to/reniciuspagotto/publishing-docker-image-in-azure-container-registry-with-github-actions-4i7</guid>
      <description>&lt;p&gt;Hi everyone,&lt;/p&gt;

&lt;p&gt;In today’s post, we will discuss how to upload Docker images to Azure Container Registry. To fully understand the step-by-step process, let’s first explore some key concepts related to the topic.&lt;/p&gt;

&lt;h3&gt;
  
  
  Azure Container Registry
&lt;/h3&gt;

&lt;p&gt;In a nutshell, Azure Container Registry (ACR) is a service specialized in storing artifacts, including Docker images. For more information, you can access this &lt;a href="https://dev.to/reniciuspagotto/azure-container-registry-storing-images-and-artifacts-52af?wt.mc_id=studentamb_72239"&gt;post&lt;/a&gt; where I explain step by step how to create and use it.&lt;/p&gt;

&lt;h3&gt;
  
  
  GitHub Actions
&lt;/h3&gt;

&lt;p&gt;GitHub Actions is a continuous integration (CI) and continuous delivery (CD) service provided by GitHub that lets you automate, customize, and execute software development workflows directly in your GitHub repository.&lt;/p&gt;

&lt;p&gt;For our demonstration, we will use a .NET 8 Web API application which is essentially the default template with a Dockerfile.&lt;/p&gt;

&lt;h3&gt;
  
  
  GitHub Action Pipeline
&lt;/h3&gt;

&lt;p&gt;This is the complete declaration of the pipeline file (.yml) where the &lt;em&gt;az-registry&lt;/em&gt; step is the main focus. As an additional bonus of knowledge, there is a step to upload the same image to GitHub Container Registry and there is also a step to deploy the image to Azure Web Apps.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: Build and Deploy

on:
  workflow_dispatch:
  push:
    tags:
      - '*.*.*'

env:
  IMAGE_NAME: "product-service"
  GH_REGISTRY: "ghcr.io"
  AZ_REGISTRY: "azdevdaysrpf.azurecr.io"
  AZURE_WEBAPP_NAME: az-devdays-appservice

jobs:
  gh-package:
    name: Publish | GitHub Registry
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Log in to the GitHub Container Registry
        uses: docker/login-action@v3
        with:
          registry: ${{ env.GH_REGISTRY }}
          username: ${{ github.actor }}
          password: ${{ secrets.GH_REGISTRY_TOKEN }}

      - name: Extract metadata (tags, labels) for Docker
        id: meta
        uses: docker/metadata-action@v5
        with:
          images: ${{ env.GH_REGISTRY }}/${{ github.actor }}/${{ env.IMAGE_NAME }}

      - name: Build and Push Image
        uses: docker/build-push-action@v5
        with:
          context: .
          push: true
          tags: ${{ steps.meta.outputs.tags }}

  az-registry:
    name: Publish | Azure Container Registry
    runs-on: ubuntu-latest
    outputs:
      version: ${{ steps.meta.outputs.version }}
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3

      - name: Log in to the Azure Container Registry
        uses: docker/login-action@v3
        with:
          registry: ${{ env.AZ_REGISTRY }}
          username: ${{ secrets.AZ_SP_CLIENT_ID }}
          password: ${{ secrets.AZ_SP_CLIENT_SECRET }}

      - name: Extract metadata (tags, labels) for Docker
        id: meta
        uses: docker/metadata-action@v5
        with:
          images: ${{ env.AZ_REGISTRY }}/${{ env.IMAGE_NAME }}

      - name: Build and Push Image
        uses: docker/build-push-action@v5
        with:
          context: .
          push: true
          tags: ${{ steps.meta.outputs.tags }}

  deploy:
    name: Azure Web App Deployment
    runs-on: ubuntu-latest
    needs: [ gh-package, az-registry ]
    steps:
      - name: Login Azure
        env:
          AAD_SERVICE_PRINCIPAL_CLIENT_ID: ${{ secrets.AZ_SP_CLIENT_ID }}
          AAD_SERVICE_PRINCIPAL_CLIENT_SECRET: ${{ secrets.AZ_SP_CLIENT_SECRET }}
        run: |
          az login --service-principal -u ${{ secrets.AZ_SP_CLIENT_ID }} -p ${{ secrets.AZ_SP_CLIENT_SECRET }} --tenant ${{ secrets.AZ_TENANT_ID }}
          az account set -s ${{ secrets.AZ_SUBSCRIPTION_ID }}
          az account show

      - name: Azure Web Apps Deployment
        uses: azure/webapps-deploy@v3
        with:
          app-name: ${{ env.AZURE_WEBAPP_NAME }}
          images: ${{ env.AZ_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.az-registry.outputs.version }}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's start with the first part of the pipeline where below we have an image and also the explanation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7gvepapj3vddctdf2w2f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7gvepapj3vddctdf2w2f.png" alt="Image description" width="800" height="525"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;name&lt;/strong&gt;: The name of the pipeline.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;on&lt;/strong&gt;: Specifies the trigger for the pipeline. In this case, the pipeline is triggered every time a new tag (git tag) is pushed. We also define the format of the git tag required to execute the pipeline, typically following the standard versions like 0.0.1 or 1.0.0.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;env&lt;/strong&gt;: Represents the global environment variables for the pipeline context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IMAGE_NAME&lt;/strong&gt;: The name assigned to the Docker image.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AZ_REGISTRY&lt;/strong&gt;: The URL of the Azure Container Registry.&lt;/p&gt;

&lt;p&gt;Let's dive into the &lt;strong&gt;&lt;em&gt;az-registry&lt;/em&gt;&lt;/strong&gt; stage now and explain the steps in detail, as this is where all the crucial actions take place.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz9bom69mw2urxjy7x2tw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz9bom69mw2urxjy7x2tw.png" alt="Image description" width="800" height="687"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this stage, we are using a Linux runner called &lt;em&gt;ubuntu-latest&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Checkout Repository&lt;/strong&gt;: This step downloads the repository to the GitHub runner.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Docker Buildx&lt;/strong&gt;: This installs Docker along with the extended plugin called Buildx.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Login to Azure&lt;/strong&gt;: We log in to Azure to enable image uploads using a Service Principal with contributor access to the Azure Container Registry.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F13oyhw5ui7k248fqllgb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F13oyhw5ui7k248fqllgb.png" alt="Image description" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Extract Metadata&lt;/strong&gt;: Retrieve metadata (such as tags and labels) and define the full name of the image.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build and Publish&lt;/strong&gt;: In this final step, we run the Dockerfile, tag the image named in the previous step, and upload it to Azure Container Registry.&lt;/p&gt;

&lt;p&gt;Finally, to execute the pipeline, define a tag using the &lt;em&gt;&lt;strong&gt;git tag&lt;/strong&gt;&lt;/em&gt; command and push the tag to the origin. Here are examples of the commands.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git tag 1.0.0&lt;/code&gt;&lt;br&gt;
&lt;code&gt;git origin push 1.0.0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpflyz47202ademmdn8as.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpflyz47202ademmdn8as.png" alt="Image description" width="800" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Did you enjoy this post? Want to chat more about it? Leave a comment with your questions and ideas, or connect with me on &lt;a href="https://www.linkedin.com/in/renicius-pagotto/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;GitHub Repository: &lt;a href="https://github.com/reniciuspagotto/az-devdays-dotnet-container?wt.mc_id=studentamb_72239" rel="noopener noreferrer"&gt;https://github.com/reniciuspagotto/az-devdays-dotnet-container?wt.mc_id=studentamb_72239&lt;/a&gt;&lt;/p&gt;

</description>
      <category>githubactions</category>
      <category>azure</category>
      <category>container</category>
    </item>
    <item>
      <title>Azure Container Registry — Storing images and artifacts</title>
      <dc:creator>Renicius Pagotto</dc:creator>
      <pubDate>Sat, 27 Jul 2024 19:56:34 +0000</pubDate>
      <link>https://dev.to/reniciuspagotto/azure-container-registry-storing-images-and-artifacts-52af</link>
      <guid>https://dev.to/reniciuspagotto/azure-container-registry-storing-images-and-artifacts-52af</guid>
      <description>&lt;p&gt;Hi everyone, in today’s post we’re going to talk about Azure Container Registry, a great alternative to Docker Hub for storing both public and private images and artifacts.&lt;/p&gt;

&lt;p&gt;We’ll also learn how to use Azure CLI and Docker CLI for creating and uploading Docker images.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Azure Container Registry?
&lt;/h3&gt;

&lt;p&gt;It's a service for storing and managing images and artifacts, based on Docker Registry technology.&lt;/p&gt;

&lt;p&gt;Azure Container Registry supports OCI distribution, which is a vendor-agnostic specification responsible for enabling the storage, sharing, and protection of artifacts and images.&lt;/p&gt;

&lt;h3&gt;
  
  
  What are Artifacts?
&lt;/h3&gt;

&lt;p&gt;Artifacts are objects used by a process, such as Dockerfile, appconfig, appsettings, Helm charts, and others.&lt;/p&gt;

&lt;h3&gt;
  
  
  Basic Concepts of Azure Container Registry
&lt;/h3&gt;

&lt;p&gt;Azure Container Registry has some basic concepts like namespaces, repositories and tags that are essential for proper usage of the resource.&lt;/p&gt;

&lt;h3&gt;
  
  
  Repository
&lt;/h3&gt;

&lt;p&gt;A repository is a collection of images or artifacts with the same name but different tags. A repository may include a namespace to help identify related repositories. Namespaces are used by separating names with a slash.&lt;/p&gt;

&lt;p&gt;Here we have some examples of repositories&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;productapi:v1&lt;/li&gt;
&lt;li&gt;productapi:v2&lt;/li&gt;
&lt;li&gt;productapi:latest&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are some examples of repositories with namespace as prefix&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;product/productapi:v1&lt;/li&gt;
&lt;li&gt;product/catalogapi:v1&lt;/li&gt;
&lt;li&gt;notification/emailapi:v1&lt;/li&gt;
&lt;li&gt;notification/pushapi:v1&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Tag
&lt;/h3&gt;

&lt;p&gt;A tag is essentially a way to version an image or artifact. We can have different versions of the same artifact, each with a different tag.&lt;/p&gt;

&lt;p&gt;Here we have some examples with tags where the tags are represented by &lt;em&gt;:v1, :v2, :latest&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;customerapi:latest&lt;/li&gt;
&lt;li&gt;customerapi:v1&lt;/li&gt;
&lt;li&gt;customerapi:v2&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Demonstration
&lt;/h3&gt;

&lt;p&gt;In today’s demonstration, we will explain the step-by-step process of provisioning an Azure Container Registry account through the Azure Portal and also via Azure CLI. Additionally, we will demonstrate how to create and upload an image to the registry.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Azure account&lt;/li&gt;
&lt;li&gt;Visual Studio Community&lt;/li&gt;
&lt;li&gt;Azure CLI&lt;/li&gt;
&lt;li&gt;Docker Desktop&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Provisioning Azure Container Registry via the Azure Portal
&lt;/h3&gt;

&lt;p&gt;Open the Azure Portal and in the search bar, type the name of the resource, in this case, Azure Container Registry, and then select it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjdgbo96l9tayigt6shaw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjdgbo96l9tayigt6shaw.png" alt="Image description" width="800" height="551"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the next screen showing the resource list, click on &lt;em&gt;&lt;strong&gt;+ Create&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxo8bbav8k6xdb4mn79c0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxo8bbav8k6xdb4mn79c0.png" alt="Image description" width="598" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On this screen, we need to provide some information that will be used to create the resource.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5o5aar6ljttsw6e7o3rp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5o5aar6ljttsw6e7o3rp.png" alt="Image description" width="776" height="609"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For better understanding, here is a detailed explanation of each piece of information:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subscription&lt;/strong&gt;: The name of the subscription that will be used for provisioning the new service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resource Group&lt;/strong&gt;: The name of the resource group to be used, which is associated with the subscription. If you don't have one, select the option Create new below the dropdown to create a new one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Registry name&lt;/strong&gt;: The name to be given to the service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Location&lt;/strong&gt;: The region where the service will be provisioned.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Availability Zones&lt;/strong&gt;: When selected, this offers high availability and resilience for all registries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SKU&lt;/strong&gt;: The tier of service desired. Available tiers are Basic, Standard, and Premium, each with its own features.&lt;/p&gt;

&lt;p&gt;Next, click on &lt;em&gt;&lt;strong&gt;Review + Create&lt;/strong&gt;&lt;/em&gt;. After the resource manager validates the information, click on &lt;em&gt;&lt;strong&gt;Create&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Once the provisioning of the new Azure Container Registry account is complete, access it and select &lt;em&gt;&lt;strong&gt;Repositories&lt;/strong&gt;&lt;/em&gt; from the sidebar menu.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ny8c5dhlplmuznamgwv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ny8c5dhlplmuznamgwv.png" alt="Image description" width="275" height="543"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Within the &lt;strong&gt;Repositories&lt;/strong&gt; option is where images are stored. However, since we just created the resource, the repository is empty.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg49n8fcy0q6lfcegf4ay.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg49n8fcy0q6lfcegf4ay.png" alt="Image description" width="779" height="339"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Provisioning Azure Container Registry via Azure CLI
&lt;/h3&gt;

&lt;p&gt;Another way to provision Azure Container Registry is through Azure CLI, the command line interface. To do this, we will use a series of commands detailed below.&lt;/p&gt;

&lt;p&gt;With Azure CLI installed on your machine, the first step is to authenticate to your Azure account using the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;az login&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once authenticated, you need to set the subscription that will be used for provisioning resources. Use the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;az account set -s name-of-subscription&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;az account&lt;/em&gt; command sets which resource we want to access in Azure, in this case, our subscription. The set command specifies that we want to define a specific subscription, and the -s argument is where we pass the name of the desired subscription.&lt;/p&gt;

&lt;p&gt;After authentication and setting the subscription, we will provision a new Azure Container Registry resource using the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;az acr create -g "resource-group-name" -n "resource-name" --sku sku-name&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;az acr create&lt;/em&gt; command specifies the desired resource and the action to be taken. The acronym acr stands for Azure Container Registry, and the action create is used to create the resource. Other available actions include delete, update, list, and more.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;-g&lt;/em&gt; or &lt;em&gt;--resource-group&lt;/em&gt; argument is where you define the resource group to be used, which must be associated with a subscription. The &lt;em&gt;-n&lt;/em&gt; or &lt;em&gt;--name&lt;/em&gt; argument is used to name the resource, and finally, the &lt;em&gt;--sku&lt;/em&gt; argument specifies the desired service tier. If no information is provided, the resource will be created with the Standard tier by default.&lt;/p&gt;

&lt;p&gt;After executing this command, a new Azure Container Registry resource will be provisioned, and you can view it through the Azure Portal.&lt;/p&gt;

&lt;p&gt;An important point to note is that each Azure Container Registry resource has a URL for managing artifacts. This information can be found on the resource’s page and is labeled as the &lt;em&gt;&lt;strong&gt;Login server&lt;/strong&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb0ll4ys9sgpqvy0ru2o0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb0ll4ys9sgpqvy0ru2o0.png" alt="Image description" width="800" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating the Project and Dockerfile
&lt;/h3&gt;

&lt;p&gt;For today’s demonstrations, we need a simple API project that includes a Dockerfile for creating a Docker image.&lt;/p&gt;

&lt;p&gt;To do this, we will create a new project in Visual Studio with the Docker option enabled.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fti30k2iz861anwa8xt8w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fti30k2iz861anwa8xt8w.png" alt="Image description" width="731" height="488"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the creation of the new project completed, note that the solution includes a Dockerfile with all the necessary configurations, ready to use. Keep in mind that this Dockerfile is provided with the project template.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw8zprk6zi43ghuibcgb7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw8zprk6zi43ghuibcgb7.png" alt="Image description" width="327" height="306"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feubv5sfqa6v9xvgx5dwz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feubv5sfqa6v9xvgx5dwz.png" alt="Image description" width="704" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have now completed the creation of a basic project, using the default template provided by .NET. However, the most important part is the Dockerfile, which we will use to build our image.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating and Uploading the Image with Docker CLI
&lt;/h3&gt;

&lt;p&gt;With Docker CLI properly installed on your machine, the first step is to create an image of our application using the Dockerfile.&lt;/p&gt;

&lt;p&gt;Open your command line terminal, navigate to the root folder of the application we just created, and execute the following command to build the image:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker build -t image-name -f AzureApiContainer/Dockerfile .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;docker build&lt;/em&gt; command specifies the desired action. The &lt;em&gt;-t&lt;/em&gt; argument is where we pass the desired name for our image, the &lt;em&gt;-f&lt;/em&gt; argument specifies the location of the application’s Dockerfile, and the final dot represents the context for executing the Dockerfile.&lt;/p&gt;

&lt;p&gt;Once the image is built, run the docker images command to verify the image. In my case, I named the image &lt;em&gt;azureapicontainer&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqxnl25ghsgkyw76lyx0p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqxnl25ghsgkyw76lyx0p.png" alt="Image description" width="600" height="63"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now it’s time to rename the image to include the URL of our registry server (Login server), which is the Azure Container Registry.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker tag azureapicontainer:latest pagottoacr.azurecr.io/azureapicontainer:v1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A new image will be created using the name and tag we just specified.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw4d5ac4ada2w2piroz4o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw4d5ac4ada2w2piroz4o.png" alt="Image description" width="697" height="91"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The command for adding a new tag along with the service URL works as follows:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker tag image-name:tag login-server/destination-image-name:tag&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;docker tag&lt;/em&gt; command creates a new version of the same image with a different tag and name. We need to specify both the source image and the destination image. For the destination image, we must prefix the name with the registry server URL, which is the Login Server URL from the Azure Container Registry page mentioned earlier.&lt;/p&gt;

&lt;p&gt;With the image ready for upload, we first need to authenticate with the Azure Container Registry. Use the following command for authentication:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;az acr login -n azure-container-registry-name&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;az acr login&lt;/em&gt; command performs the authentication (login) to the Azure Container Registry (acr). The &lt;em&gt;-n&lt;/em&gt; argument should be followed by the name of the Azure Container Registry account/service used to store the image.&lt;/p&gt;

&lt;p&gt;After authentication, we are ready to upload the image using the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker push server-image-name:tag&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;docker push&lt;/em&gt; command uploads the image, and you need to specify the image to be used. In this case, we use the image with the registry server name. Docker will use the specified server name to connect and perform the upload.&lt;/p&gt;

&lt;p&gt;In my case, I used the following command to upload the image:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker push pagottoacr.azurecr.io/azureapicontainer:v1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frda8adey3pzt0m21grls.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frda8adey3pzt0m21grls.png" alt="Image description" width="800" height="261"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating and Uploading the Image with Azure CLI
&lt;/h3&gt;

&lt;p&gt;To create an image using Azure CLI, we will use Azure Container Registry Tasks (ACR Tasks), which are commands for creating, sending (uploading), and executing a container image natively in Azure, without the need to have Docker installed locally.&lt;/p&gt;

&lt;p&gt;To create an image via Azure CLI, open your command line terminal, navigate to the root folder of the application, and execute the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;az acr build -t "image-name" -r registry-name -f dockerfile-directory .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;az acr build&lt;/em&gt; command specifies the desired action, in this case, creating a new image. The &lt;em&gt;-t&lt;/em&gt; argument is where you define the name of your image. The &lt;em&gt;-r&lt;/em&gt; argument specifies the name of the Azure Container Registry you will use. The &lt;em&gt;-f&lt;/em&gt; argument is the location of the Dockerfile for your application, and the final dot represents the context in which the Dockerfile will be executed.&lt;/p&gt;

&lt;p&gt;When you run the command, the creation and upload of the image will be handled automatically by Azure Container Registry.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyxqzybccohh8mgoykrq7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyxqzybccohh8mgoykrq7.png" alt="Image description" width="800" height="151"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Viewing the Image in Azure Container Registry
&lt;/h3&gt;

&lt;p&gt;After creating and uploading an image via Docker CLI or Azure CLI, open the Azure Portal again and select the Azure Container Registry resource that you provisioned.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwla9pt4wne026cji4gsq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwla9pt4wne026cji4gsq.png" alt="Image description" width="800" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhgvncg90g57x6dlfrdk4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhgvncg90g57x6dlfrdk4.png" alt="Image description" width="800" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the sidebar menu, select &lt;strong&gt;Repositories&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhgw90wd9lxj4otumg5t4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhgw90wd9lxj4otumg5t4.png" alt="Image description" width="275" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With that, you can finally see our image stored in the service.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fddj8h9umpbw52snn6mdg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fddj8h9umpbw52snn6mdg.png" alt="Image description" width="564" height="251"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By accessing the repository, we can view the different available versions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faz321uuj985ia1ixwee1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faz321uuj985ia1ixwee1.png" alt="Image description" width="800" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this, our image is stored in Azure Container Registry and available for use in any process.&lt;/p&gt;

&lt;p&gt;Did you enjoy this post? Want to chat more about Azure Container Registry? Leave a comment with your questions and ideas or connect with me on &lt;a href="https://www.linkedin.com/in/renicius-pagotto/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Referências&lt;br&gt;
&lt;a href="https://learn.microsoft.com/en-us/azure/container-registry/container-registry-intro" rel="noopener noreferrer"&gt;Azure Container Registry Documentation&lt;/a&gt;&lt;/p&gt;

</description>
      <category>azure</category>
      <category>container</category>
      <category>docker</category>
    </item>
    <item>
      <title>Publishing image to GitHub Container Registry using GitHub Actions</title>
      <dc:creator>Renicius Pagotto</dc:creator>
      <pubDate>Wed, 31 Jan 2024 11:50:04 +0000</pubDate>
      <link>https://dev.to/reniciuspagotto/publishing-docker-image-to-github-container-registry-using-github-actions-20dg</link>
      <guid>https://dev.to/reniciuspagotto/publishing-docker-image-to-github-container-registry-using-github-actions-20dg</guid>
      <description>&lt;p&gt;Hi everyone, in today's post we are going to talk about how to create images and publish to GitHub Container Registry using GitHub Actions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Base Knowledge
&lt;/h3&gt;

&lt;p&gt;For a deeper understanding of the subject, it's advisable to understand the concepts of Docker and GitHub Container Registry and to help you with this, I have left two useful links below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry" rel="noopener noreferrer"&gt;What is Container Registry?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.docker.com/get-started/overview/" rel="noopener noreferrer"&gt;Docker Overview&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Application Implementation (.NET)
&lt;/h3&gt;

&lt;p&gt;The first step is basically to create a new project in .NET, feel free to use your favorite IDE to do this. We'll use a .NET API project, so we can containerize the application and publish it as an image on GitHub Container Registry.&lt;/p&gt;

&lt;p&gt;When creating the project, remember to include support for docker on Linux if your IDE offers this option&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ww6rv9o7mwl862bs0if.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ww6rv9o7mwl862bs0if.png" alt="Image description" width="800" height="526"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: I'm using JetBrains Rider&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the project we will not implement anything new, we will only use what is already in the standard template, as the main objective is just to generate an image of the application. For more information about the project I created, you can see it here &lt;a href="https://github.com/reniciuspagotto/docker-image-aspnet-application" rel="noopener noreferrer"&gt;.NET Core API&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you forgot to enable docker support through the IDE or if the IDE does not have this type of support, let's manually add the dockerfile to the root of the project. Remember to review and make the necessary changes to the dockerfile, especially the application name if it's different.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/83cihjqtpx8722tm137p.png)

.Api/ImageApplication.Api.csproj", "ImageApplication.Api/"]
RUN dotnet restore "ImageApplication.Api/ImageApplication.Api.csproj"
COPY . .
WORKDIR "/src/ImageApplication.Api"
RUN dotnet build "ImageApplication.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "ImageApplication.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ImageApplication.Api.dll"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After creating the application and configuring the dockerfile, ensure that it works as expected. You can download Docker Desktop or Rancher Desktop and run it locally to ensure the image will build correctly.&lt;/p&gt;

&lt;p&gt;Now, push the code to a new GitHub repository as for the next steps it's essential to have the repository created.&lt;/p&gt;

&lt;h3&gt;
  
  
  Generating GitHub Token
&lt;/h3&gt;

&lt;p&gt;The next step is to generate the token that will represent the secret to authenticate to GitHub Container Registry and allow publication. In the right menu, go to &lt;strong&gt;&lt;em&gt;Settings&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq1hlwa4wi6rznk0uyf16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq1hlwa4wi6rznk0uyf16.png" alt="Image description" width="578" height="1482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the left menu, go to &lt;strong&gt;&lt;em&gt;Developer settings&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flh6tp0bo6f4t0j6zs2cs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flh6tp0bo6f4t0j6zs2cs.png" alt="Image description" width="622" height="750"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's use a classic token&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz3iyuxcgv3xd7rerzykf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz3iyuxcgv3xd7rerzykf.png" alt="Image description" width="800" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click the &lt;strong&gt;&lt;em&gt;Generate new token&lt;/em&gt;&lt;/strong&gt; dropdown and select &lt;strong&gt;&lt;em&gt;Generate new token (classic)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6e60fao8v3acsy7z8dm2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6e60fao8v3acsy7z8dm2.png" alt="Image description" width="800" height="331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Set a &lt;strong&gt;&lt;em&gt;name&lt;/em&gt;&lt;/strong&gt; for your token, the &lt;em&gt;&lt;strong&gt;expiration date&lt;/strong&gt;&lt;/em&gt; and select the &lt;strong&gt;&lt;em&gt;write:packages&lt;/em&gt;&lt;/strong&gt; scope&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuk7eapi25evcnqbe6i1k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuk7eapi25evcnqbe6i1k.png" alt="Image description" width="800" height="549"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the bottom, click on the green Generate Token button to actually create the token and obtain the secret.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmph3c6b2r0ez43im1du.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmph3c6b2r0ez43im1du.png" alt="Image description" width="800" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go back to the repository you created for the .NET application. Now let's use the GitHub Secret to store the token to be used by the pipeline. To do this, in the repository. select &lt;em&gt;&lt;strong&gt;Settings&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6pt37q7iva1ooxkzxh5e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6pt37q7iva1ooxkzxh5e.png" alt="Image description" width="800" height="90"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the left menu, select &lt;strong&gt;&lt;em&gt;Secret and variables&lt;/em&gt;&lt;/strong&gt; and click &lt;strong&gt;&lt;em&gt;Actions&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc8p6pdmc5x2ljkkeyw3q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc8p6pdmc5x2ljkkeyw3q.png" alt="Image description" width="716" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select &lt;strong&gt;&lt;em&gt;New repository secret&lt;/em&gt;&lt;/strong&gt;, define a name for the secret and in values paste the token we generated earlier. Finally, click &lt;strong&gt;&lt;em&gt;Add secret&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqsuu9nxiik76z2x07znq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqsuu9nxiik76z2x07znq.png" alt="Image description" width="800" height="79"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fisgurqj50z6iqh1hny97.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fisgurqj50z6iqh1hny97.png" alt="Image description" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we have the token that will be used for authentication and publication authorization as a GitHub Secret where it will be used by the pipeline.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pipeline / Workflow
&lt;/h3&gt;

&lt;p&gt;After creating our project, configuring the dockerfile and authentication token, it's time to prepare our CI/CD pipeline to generate the image and publish it to the Container Registry.&lt;/p&gt;

&lt;p&gt;The pipeline itself is simple and easy to understand, as you can see below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fku9863nj427i67k7xgrt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fku9863nj427i67k7xgrt.png" alt="Image description" width="800" height="1183"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's understand part by part&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0a3j0p5a5uq5hs8tz3wv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0a3j0p5a5uq5hs8tz3wv.png" alt="Image description" width="616" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Name:&lt;/strong&gt; Represents the name of the workflow&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;on:&lt;/strong&gt; It's the trigger of workflows&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;push:&lt;/strong&gt; It's the type of trigger, for example, the pipeline will be executed on every push&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;tags:&lt;/strong&gt; As we defined the trigger of our pipeline as a push event, we also need to inform the push type, in our example it will be a tag push with a pre-defined format.&lt;/p&gt;

&lt;p&gt;The pipeline/workflow will always be triggered every time a tag push occurs that follows the pattern&lt;/p&gt;

&lt;p&gt;In the next part, we define the pipeline environment variable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6s8ca8r8wwyh3wh0dmt3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6s8ca8r8wwyh3wh0dmt3.png" alt="Image description" width="800" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;&lt;strong&gt;registry&lt;/strong&gt;&lt;/em&gt; variable represents the Container Registry URL, provided by GitHub.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;&lt;strong&gt;image name&lt;/strong&gt;&lt;/em&gt; variable represents the name of my repository, which will also be used to name the image.&lt;/p&gt;

&lt;p&gt;Next part, we have the definition of jobs where we need to define at least one job, the OS to be used by the Runner and the necessary steps.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk41xkdqn5ggfax5evpwh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk41xkdqn5ggfax5evpwh.png" alt="Image description" width="800" height="606"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Checkout Repository&lt;/strong&gt; -&amp;gt; It's basically a git clone of the repository inside the VM (Runner) that will execute the steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Set up Docker Buildx&lt;/strong&gt; -&amp;gt; Command for installing Docker Buildx that will be responsible for executing docker commands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Log in to the GitHub Container Registry&lt;/strong&gt; -&amp;gt; It's the authentication step in the Container Registry. Note that we pass 3 variables for step, registry, username and password. Registry is the URL defined in the environment variable at the beginning of the pipeline, username is your username on GitHub and is accessible by the standard variable &lt;em&gt;github.actor&lt;/em&gt; provided by GitHub itself and the last is the password which is our token that we created previously and which is stored as secret where we reference it using the name REGISTRY_TOKEN.&lt;/p&gt;

&lt;p&gt;In the last part we have...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo712u2h831o60s29b9ux.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo712u2h831o60s29b9ux.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Extract metadata...&lt;/strong&gt; -&amp;gt; It's the command to make the git tag be used as the image version.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build and Push Image&lt;/strong&gt; -&amp;gt; Finally, this is the step that runs the dockerfile, creates the image, and pushes it to the Container Registry.&lt;/p&gt;

&lt;h3&gt;
  
  
  Executing the pipeline
&lt;/h3&gt;

&lt;p&gt;To run the pipeline, you need to create a git tag and submit it, the commands are shown below.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git tag 1.3.0&lt;/code&gt;&lt;br&gt;
&lt;code&gt;git push origin 1.3.0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I've set a version of 1.3.0, but feel free to use whatever version you like. After push, the pipeline will run automatically.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy67fgaj4zn9vxjw54gl1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy67fgaj4zn9vxjw54gl1.png" alt="Image description" width="800" height="248"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To view packages, you can go to your profile again and select Packages&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fluzvoaz79635rg1glrhg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fluzvoaz79635rg1glrhg.png" alt="Image description" width="800" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu4aa7exau61mj8gjxk3u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu4aa7exau61mj8gjxk3u.png" alt="Image description" width="800" height="193"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can now download and run the image from any location. Remembering that the image is published as private, to make it public just click on the image and make it visible to everyone.&lt;/p&gt;

&lt;p&gt;That's all folks, stay tuned for the next posts.&lt;/p&gt;

</description>
      <category>githubactions</category>
      <category>docker</category>
      <category>githubpackages</category>
      <category>csharp</category>
    </item>
    <item>
      <title>Publishing Nuget in GitHub Packages</title>
      <dc:creator>Renicius Pagotto</dc:creator>
      <pubDate>Tue, 30 Jan 2024 12:52:38 +0000</pubDate>
      <link>https://dev.to/reniciuspagotto/publishing-nuget-in-github-packages-399l</link>
      <guid>https://dev.to/reniciuspagotto/publishing-nuget-in-github-packages-399l</guid>
      <description>&lt;p&gt;Hi everyone, in today's post we will talk about how to create Nuget packages (C#) and publish to GitHub packages using GitHub Actions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Base Knowledge
&lt;/h3&gt;

&lt;p&gt;For a complete understanding of the subject, it's advisable to understand the concepts of Nuget and GitHub Packages and to help you with this, I have left two useful links below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/nuget/what-is-nuget" rel="noopener noreferrer"&gt;What is Nuget?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.github.com/en/packages/learn-github-packages/introduction-to-github-packages" rel="noopener noreferrer"&gt;Introduction to GitHub Packages&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Implementing .NET / Nuget Package
&lt;/h3&gt;

&lt;p&gt;The first step is to create a new project in .NET, you can use your favorite IDE to do this. This project should be a simple class library as it is just a package that contains reusable implementations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvxqaflvno0dttho95cbn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvxqaflvno0dttho95cbn.png" alt="Image description" width="800" height="521"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: I'm using JetBrains Rider&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In my project I implemented some basic methods just for example, you can see the implementation details here &lt;a href="https://github.com/reniciuspagotto/common-package-csharp-application" rel="noopener noreferrer"&gt;Common Packages&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After implementing what you need in your .NET project, create a new repository on GitHub and push your code. The next steps will be necessary to already have the repository created.&lt;/p&gt;

&lt;h3&gt;
  
  
  Generating GitHub Token
&lt;/h3&gt;

&lt;p&gt;The next step is to generate the token that will represent the secret to authenticate to GitHub Packages and allow publication. In the right menu, go to &lt;strong&gt;&lt;em&gt;Settings&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq1hlwa4wi6rznk0uyf16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq1hlwa4wi6rznk0uyf16.png" alt="Image description" width="578" height="1482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the left menu, go to &lt;strong&gt;&lt;em&gt;Developer settings&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flh6tp0bo6f4t0j6zs2cs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flh6tp0bo6f4t0j6zs2cs.png" alt="Image description" width="622" height="750"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's use a classic token&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz3iyuxcgv3xd7rerzykf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz3iyuxcgv3xd7rerzykf.png" alt="Image description" width="800" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click the &lt;strong&gt;&lt;em&gt;Generate new token&lt;/em&gt;&lt;/strong&gt; dropdown and select &lt;strong&gt;&lt;em&gt;Generate new token (classic)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6e60fao8v3acsy7z8dm2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6e60fao8v3acsy7z8dm2.png" alt="Image description" width="800" height="331"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Set a &lt;strong&gt;&lt;em&gt;name&lt;/em&gt;&lt;/strong&gt; for your token, the &lt;em&gt;&lt;strong&gt;expiration date&lt;/strong&gt;&lt;/em&gt; and select the &lt;strong&gt;&lt;em&gt;write:packages&lt;/em&gt;&lt;/strong&gt; scope&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuk7eapi25evcnqbe6i1k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuk7eapi25evcnqbe6i1k.png" alt="Image description" width="800" height="549"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the bottom, click on the green Generate Token button to actually create the token and obtain the secret.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmph3c6b2r0ez43im1du.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzmph3c6b2r0ez43im1du.png" alt="Image description" width="800" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go back to the repository you created for the .NET application (Nuget Package). Now let's use the GitHub Secret to store the token to be used by the pipeline. To do this, in the repository. select &lt;em&gt;&lt;strong&gt;Settings&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6pt37q7iva1ooxkzxh5e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6pt37q7iva1ooxkzxh5e.png" alt="Image description" width="800" height="90"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the left menu, select &lt;strong&gt;&lt;em&gt;Secret and variables&lt;/em&gt;&lt;/strong&gt; and click &lt;strong&gt;&lt;em&gt;Actions&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc8p6pdmc5x2ljkkeyw3q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc8p6pdmc5x2ljkkeyw3q.png" alt="Image description" width="716" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select &lt;strong&gt;&lt;em&gt;New repository secret&lt;/em&gt;&lt;/strong&gt;, define a name for the secret and in values paste the token we generated earlier. Finally, click &lt;strong&gt;&lt;em&gt;Add secret&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqsuu9nxiik76z2x07znq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqsuu9nxiik76z2x07znq.png" alt="Image description" width="800" height="79"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fisgurqj50z6iqh1hny97.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fisgurqj50z6iqh1hny97.png" alt="Image description" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we have the token that will be used for authentication and publication authorization as a GitHub Secret where it will be used by the pipeline.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pipeline / Workflow
&lt;/h3&gt;

&lt;p&gt;Once we have our application implemented and the publishing token configured, it's time to prepare our CI/CD pipeline to generate the package and publish it to GitHub packages.&lt;/p&gt;

&lt;p&gt;The pipeline itself is simple and easy to understand, as you can see below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmzg2kzv7uhgw8f22rkp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmzg2kzv7uhgw8f22rkp.png" alt="Image description" width="800" height="572"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's understand part by part&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn6a4107vjoi568egrovl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn6a4107vjoi568egrovl.png" alt="Image description" width="598" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Name:&lt;/strong&gt; Represents the name of the workflow&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;on:&lt;/strong&gt; It's the trigger of workflows&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;push:&lt;/strong&gt; It's the type of trigger, for example, the pipeline will be executed on every push&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;tags:&lt;/strong&gt; As we defined the trigger of our pipeline as a push event, we also need to inform the push type, in our example it will be a tag push with a pre-defined format.&lt;/p&gt;

&lt;p&gt;Basically, the pipeline / workflow will be triggered with each push of tags that follow the pattern (&lt;em&gt;.&lt;/em&gt;.*)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F21x4eqdbmfjadpvce6d7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F21x4eqdbmfjadpvce6d7.png" alt="Image description" width="800" height="551"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the second part, we have the definition of jobs where we need to define at least one job, the OS to be used by the Runner and the necessary steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Checkout Repository&lt;/strong&gt; -&amp;gt; It's basically a git clone of the repository inside the VM (Runner) that will execute the steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Set up .NET Core&lt;/strong&gt; -&amp;gt; Step to download and install dependencies to run .NET commands&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build&lt;/strong&gt; -&amp;gt; It's a build of the application to ensure everything is working&lt;/p&gt;

&lt;p&gt;In the last part we have&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9r612ncqdl5evxgsudy1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9r612ncqdl5evxgsudy1.png" alt="Image description" width="800" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Package&lt;/strong&gt; -&amp;gt; It's the command to create a nuget package in .NET where the package name will be the same as the project name and the version will be the git tag.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Publish&lt;/strong&gt; -&amp;gt; Finally, this is the step that takes the nuget package generated in the previous step and publishes it to GitHub Packages&lt;/p&gt;

&lt;p&gt;To publish to your GitHub package, simply point to your GitHub Packages, that is, just replace the username in the url as shown below.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;nuget.pkg.github.com/your-username/index.json&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Note that I'm using a secret in the publish command, called "NUGET_AUTH_TOKEN" which is basically the secret we created previously with the token that allows publishing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Executing the pipeline
&lt;/h3&gt;

&lt;p&gt;To run the pipeline, you need to create a git tag and submit it, the commands are shown below.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git tag 1.5.0&lt;/code&gt;&lt;br&gt;
&lt;code&gt;git push origin 1.5.0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I've set a version of 1.5.0, but feel free to use whatever version you like. After push, the pipeline will run automatically&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fujk32g2sg3n0del0s1lm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fujk32g2sg3n0del0s1lm.png" alt="Image description" width="800" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To view packages, you can go to your profile again and select Packages&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fluzvoaz79635rg1glrhg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fluzvoaz79635rg1glrhg.png" alt="Image description" width="800" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fewx896zjvuab8ok4jl7k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fewx896zjvuab8ok4jl7k.png" alt="Image description" width="800" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, you can import the package into your .NET project by pointing to the GitHub package URL. Remembering that the package is published as private, to make it public just click on the package and make it visible to everyone.&lt;/p&gt;

&lt;p&gt;That's all folks, stay tuned for the next posts.&lt;/p&gt;

</description>
      <category>githubactions</category>
      <category>nuget</category>
      <category>csharp</category>
    </item>
    <item>
      <title>Azure App Spaces (preview) Overview</title>
      <dc:creator>Renicius Pagotto</dc:creator>
      <pubDate>Tue, 30 Jan 2024 12:52:07 +0000</pubDate>
      <link>https://dev.to/reniciuspagotto/azure-app-space-preview-overview-3nbc</link>
      <guid>https://dev.to/reniciuspagotto/azure-app-space-preview-overview-3nbc</guid>
      <description>&lt;p&gt;Hi everyone, in today's post we're going to talk about Azure App Spaces, a new service from Azure (Microsoft) that promises to facilitate the creation and deployment of applications.&lt;/p&gt;

&lt;p&gt;This new service has two main functions, one of them helps to define the best service(s) to be used by the application through an analysis that Azure itself carries out in the repository.&lt;/p&gt;

&lt;p&gt;The other feature is to select an out-of-the-box template that you may to use and Azure will take care of deploying the entire application and necessary infrastructure. There are currently 4 main templates you can choose from, as seen below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;React Container App with C# API and PostgreSQL&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;React Web App with Python API and MongoDB&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Static React Web App with Node.js API and MongoDB&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;React Web App with C#/.NET and SQL Database&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: All information has been extracted from the Azure Portal, so it can be changed at any time as the service is still in preview.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can see the default page of Azure App Spaces bellow&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fin70jxcdd0h0nquakoxk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fin70jxcdd0h0nquakoxk.png" alt="Image description" width="800" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Microsoft Definition
&lt;/h3&gt;

&lt;p&gt;To better understand what this new service is all about, here is an official explanation from Microsoft's documentation.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Azure App Spaces is an intelligent service for developers that reduces the complexity of creating and managing web apps. It helps you identify the correct services for your applications on Azure and provides a user-friendly management experience that's streamlined for the development process.&lt;/p&gt;

&lt;p&gt;App Spaces offers all the benefits of deploying an app via existing Azure services, like Container Apps, Static Web Apps, and App Service, with an experience that's focused on making you develop and deploy faster.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Azure App Spaces is still in preview, so be aware that potential bugs may be encountered.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: The only supported service is GitHub for now, but as the service is in preview, new ways of integrations may be added in the future.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Using an existing repository – How does it work?
&lt;/h2&gt;

&lt;p&gt;I have prepared two different scenarios to better explain how the service works.&lt;/p&gt;

&lt;h4&gt;
  
  
  Scenario 1
&lt;/h4&gt;

&lt;p&gt;In the first scenario, we're going to use a simple HTML page. Basically I just created a simple HTML file on GitHub and pushed the code in the main branch, you can do the same thing.&lt;/p&gt;

&lt;p&gt;On the Azure App Spaces default page, select the &lt;strong&gt;&lt;em&gt;Start deploying&lt;/em&gt;&lt;/strong&gt; option as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcph54ee7kk4ej2k7lt9j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcph54ee7kk4ej2k7lt9j.png" alt="Image description" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select the Organization, Repository and Branch you'd like to deploy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3lv7q0g1a04zy3jsfnov.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3lv7q0g1a04zy3jsfnov.png" alt="Image description" width="800" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, the service will analyze the entire repository and advice you about the best service. In my case, Azure suggested using Azure Static Web App demonstrating good accuracy, as it was in fact the most suitable service.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4k48nhylegj48nwf0l7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4k48nhylegj48nwf0l7e.png" alt="Image description" width="800" height="596"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scrolling down, we need to define some information about the application and also the details of creating the Azure Static Web App.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr530lt8fpgps28g4mari.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr530lt8fpgps28g4mari.png" alt="Image description" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once deployment begins, magic happens. On deployment, Azure creates and adds a CI/CD (GitHub Actions) pipeline to the repository you selected to use. Although the pipeline is very simple, it's enough to deploy the application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk5zo9zq80i0ms6jdy103.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk5zo9zq80i0ms6jdy103.png" alt="Image description" width="800" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn9ejz5gmrz3gaiihqa2v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn9ejz5gmrz3gaiihqa2v.png" alt="Image description" width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The resources were automatically created in Azure, so you don't have to worry about that either.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3x4pj2svlbz24fvypvfr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3x4pj2svlbz24fvypvfr.png" alt="Image description" width="800" height="149"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Scenario 2
&lt;/h4&gt;

&lt;p&gt;In the second example, we will use a .NET project that I implemented. Again, go to the App Spaces home page, select the &lt;em&gt;Start deploying&lt;/em&gt; option and select the new repository with the .NET project. The suggestion was to use Azure App Service and again the choice was very assertive.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmn2gbstxwbaqeqf5icu8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmn2gbstxwbaqeqf5icu8.png" alt="Image description" width="800" height="582"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the deploy button is clicked again, a new CI/CD pipeline will be added to the repository and the required resources will be created automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Templates - How does it work?
&lt;/h2&gt;

&lt;p&gt;Now, let's demonstrate how to use templates. Basically if you want to start a new app, you can use a out-of-the-box template and just adapt according to your needs.&lt;/p&gt;

&lt;p&gt;As I said, we currently have 4 templates available to be used and for this scenario, we'll select the &lt;em&gt;React Web App template with C#/.NET and SQL Database&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Select the template, define some information and click the deploy button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk02pbgq0bp5l7jfkz44l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk02pbgq0bp5l7jfkz44l.png" alt="Image description" width="800" height="215"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F46tjrhcsxq57dstcy0ny.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F46tjrhcsxq57dstcy0ny.png" alt="Image description" width="800" height="594"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Azure will start creating your application and the resources run it. The entire process take a while to be completed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmq2tsg3it1ft1nughevy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmq2tsg3it1ft1nughevy.png" alt="Image description" width="800" height="489"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In summary, once the process is completed, we have a new GitHub repository with the application (front-end and back-end) and a CI/CD pipeline to deploy the code.&lt;/p&gt;

&lt;p&gt;Also in the repository we have a directory called infra, inside we find a bicep file (IaC) which is basically the application infrastructure at code level where all the configuration necessary to run the application is ready, without the need for any adjustments.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8uw70kfsnizw7q4q5svs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8uw70kfsnizw7q4q5svs.png" alt="Image description" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The CI/CD pipeline is responsible for deploying the infrastructure by executing the biceps file and also the application itself.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs5vdjnqsll6ayvnss0hx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs5vdjnqsll6ayvnss0hx.png" alt="Image description" width="800" height="930"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will have an entire application up and running without the need to set a connection between back-end and database or between front-end and back-end.&lt;/p&gt;

&lt;p&gt;Powerful, isn't it?&lt;/p&gt;

&lt;h3&gt;
  
  
  Brief Summary
&lt;/h3&gt;

&lt;p&gt;Let's highlight the main points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The resource only supports GitHub&lt;/li&gt;
&lt;li&gt;There are same templates with out-of-the-box application.&lt;/li&gt;
&lt;li&gt;A CI/CD pipeline is used to deploy the infrastructure together bicep file when using a template.&lt;/li&gt;
&lt;li&gt;CI/CD pipeline is also used to deploy the application &lt;/li&gt;
&lt;li&gt;All application settings and keys (secrets) are included in the pipeline or in bicep, you don't need to adjust anything.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;em&gt;I haven't tested other scenarios but the process is basically the same as we demonstrated above. I also don't know if the accuracy of the analysis will be good in complex scenarios, but I'll bring new tests in the future.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Highlighting an important point, when using templates, a new repository is created containing all the files needed to deploy both the application and the infrastructure, it's possible to redeploy if necessary, while using an existing repository, Azure will just create the pipeline of CI/CD to deploy the application, you don't have the biceps file to create the infrastructure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Although the feature is in preview, it's an excellent option to help and improve software delivery in companies. With its analysis capacity, it will certainly be a very useful tool to help you decide which is the best resource to use in a given scenario.&lt;/p&gt;

&lt;p&gt;The templates will speed up the creation and delivery of the software to customers, since all aspects have already been adjusted, so the focus will be entirely on the functionalities that will need to be developed.&lt;/p&gt;

&lt;p&gt;One more thing to mention, when using templates, in addition to just creating the application and infrastructure, Azure provides good security practices, such as creating an instance of the Azure Key Vault already set with the application, the connection between the back-end and the database is done via managed identity, among many other things that I could see by analyzing the repository. It's really not just the experience of creating a solution and executing it, it's the experience of having a ready-to-use solution, with a good level of security associated, with the best possible practices.&lt;/p&gt;

&lt;p&gt;Reference&lt;br&gt;
&lt;a href="https://learn.microsoft.com/en-us/azure/app-spaces/overview" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/azure/app-spaces/overview&lt;/a&gt;&lt;/p&gt;

</description>
      <category>azure</category>
      <category>azureappspaces</category>
    </item>
    <item>
      <title>Azure Static Web Apps with Vue.js and Visual Studio Code</title>
      <dc:creator>Renicius Pagotto</dc:creator>
      <pubDate>Sat, 11 Feb 2023 18:24:14 +0000</pubDate>
      <link>https://dev.to/reniciuspagotto/azure-static-web-app-with-vuejs-and-visual-studio-code-43a8</link>
      <guid>https://dev.to/reniciuspagotto/azure-static-web-app-with-vuejs-and-visual-studio-code-43a8</guid>
      <description>&lt;p&gt;Hey everyone, in today's post we are talking about how deploy an Vue.js Application to Azure Static Web App using Visual Studio Code.&lt;/p&gt;

&lt;p&gt;To understand what is Azure Static Web App, visit &lt;a href="https://dev.to/reniciuspagotto/azure-static-web-apps-the-big-picture-1e16"&gt;Azure Static Web Apps - The Big Picture&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://nodejs.org/en/download" rel="noopener noreferrer"&gt;NPM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cli.vuejs.org/guide/installation.html" rel="noopener noreferrer"&gt;Vue CLI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;Visual Studio Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurestaticwebapps" rel="noopener noreferrer"&gt;Azure Static Web App extension&lt;/a&gt; for Visual Studio Code&lt;/li&gt;
&lt;li&gt;&lt;a href="https://git-scm.com" rel="noopener noreferrer"&gt;Git&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Implementation
&lt;/h2&gt;

&lt;p&gt;Once you have all the prerequisites installed, let's create the project itself. For that, let's use the command line and run the command below to create a Vue.js project.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;vue create &amp;lt;vue-project-name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgumgq7f61qxb8cs5tiqh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgumgq7f61qxb8cs5tiqh.png" alt="Image description" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After creating the project, let's open it in Visual Studio Code. You can open the project using the interface or by typing the command below in your command line tool.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;code .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Always access the project root before opening in Visual Studio Code or you can open VS Code first and then open the project root. Always avoid opening in the folder before the project as this can lead to errors in the build and consequently in the pipeline.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F66lqaf3g3wy8y9uwh8vc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F66lqaf3g3wy8y9uwh8vc.png" alt="Image description" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next step is the deployment, so Press F1 and search for Azure Static Web App: Create Static Web Apps and select.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc7kiencvmuqrr0bwmsht.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc7kiencvmuqrr0bwmsht.png" alt="Image description" width="800" height="562"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next step, we need to select the Azure Subscription, but if you are not logged into your Azure account with Visual Studio Code, an option to make the connection will be displayed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxqzf631ctsp8rcqrogtm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxqzf631ctsp8rcqrogtm.png" alt="Image description" width="800" height="222"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next option, we need to define the name to be given to the service in Azure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ypo0fc7rf8plc3xpes8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ypo0fc7rf8plc3xpes8.png" alt="Image description" width="800" height="211"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we need to define a name for the GitHub Repository&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu4bjc9cvslamcpd7baro.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu4bjc9cvslamcpd7baro.png" alt="Image description" width="800" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next step is to define the region where the resource will be created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9mtn36mnhnqg6w5d3pa1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9mtn36mnhnqg6w5d3pa1.png" alt="Image description" width="800" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now it's time to define the project type. Note that Azure Static Web Apps supports multiple frameworks and since our project is a Vue.js project, we should select the Vue option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbut31qq8xnnlj40sfb0a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbut31qq8xnnlj40sfb0a.png" alt="Image description" width="800" height="499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we need to set the path to the root of the Vue project. By doing this, the executor responsible for deploying the code will be able to run the &lt;em&gt;npm run build&lt;/em&gt; command to generate the outputs in the &lt;em&gt;dist&lt;/em&gt; directory. Let's set / to this option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp10w6x34x755z0n2fg7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp10w6x34x755z0n2fg7e.png" alt="Image description" width="800" height="222"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the last step, we need to define the application build output path and for Vue.js projects we need to inform the &lt;em&gt;dist&lt;/em&gt; folder.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzi2s37czzk571xkhx0g3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzi2s37czzk571xkhx0g3.png" alt="Image description" width="800" height="237"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, press enter to start creating the resource on Azure and creating the repository on GitHub.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faoz0qc60hxtdey2r246l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faoz0qc60hxtdey2r246l.png" alt="Image description" width="800" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the run is complete, we have an instance of Azure Static Web Apps provisioned in Azure and ready to use, and the repository on GitHub with our code. At the end, the code deployment pipeline will be executed automatically by GitHub Actions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fomlem2h6u3srg2um6el2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fomlem2h6u3srg2um6el2.png" alt="Image description" width="800" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9j76kqqfd6f8t9wpdh24.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9j76kqqfd6f8t9wpdh24.png" alt="Image description" width="800" height="283"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx2k9zwx8rjjc599gyloj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx2k9zwx8rjjc599gyloj.png" alt="Image description" width="800" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let's open the Azure Portal to get the link of our the Web Site in Azure Static Web App resource.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl1orz528yxfrxozrgv45.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl1orz528yxfrxozrgv45.png" alt="Image description" width="800" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the link copied, paste it into your browser to see the result or you can simply click on the link to be redirected automatically.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7zmbi15ne8gq6bkoxx8f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7zmbi15ne8gq6bkoxx8f.png" alt="Image description" width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Azure Static Web Apps is a powerful feature that makes it easy and fast to build and deliver a modern front-end project.&lt;/p&gt;

&lt;p&gt;Did you like this post? Want to talk a little more about it? Leave a comment with your questions and ideas or get in touch through &lt;a href="https://www.linkedin.com/in/renicius-pagotto" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>vue</category>
      <category>visualstudiocode</category>
      <category>staticwebapps</category>
    </item>
    <item>
      <title>Azure Static Web Apps with Angular and Visual Studio Code</title>
      <dc:creator>Renicius Pagotto</dc:creator>
      <pubDate>Sat, 11 Feb 2023 18:24:01 +0000</pubDate>
      <link>https://dev.to/reniciuspagotto/azure-static-web-app-with-angular-and-visual-studio-code-3964</link>
      <guid>https://dev.to/reniciuspagotto/azure-static-web-app-with-angular-and-visual-studio-code-3964</guid>
      <description>&lt;p&gt;Hey everyone, in today's post we are going to talk about how to deploy an Angular app to Azure Static Web App using Visual Studio Code.&lt;/p&gt;

&lt;p&gt;To better understand what is Azure Static Web App, visit &lt;a href="https://dev.to/reniciuspagotto/azure-static-web-apps-the-big-picture-1e16?wt.mc_id=studentamb_72239"&gt;Azure Static Web Apps - The Big Picture&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://nodejs.org/en/download" rel="noopener noreferrer"&gt;NPM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://angular.io/cli" rel="noopener noreferrer"&gt;Angular CLI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;Visual Studio Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurestaticwebapps" rel="noopener noreferrer"&gt;Azure Static Web App extension&lt;/a&gt; for Visual Studio Code&lt;/li&gt;
&lt;li&gt;&lt;a href="https://git-scm.com" rel="noopener noreferrer"&gt;Git&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you have all prerequisites installed, let's create an Angular project and for that, create a new folder in any directory you want on your machine. You can create it using the operating system's interface, or if you prefer, run the command below in your command line tool to create a new folder.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mkdir &amp;lt;folder-name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now, using the command line, go to the folder you just created and run the command below to create an Angular project.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ng new &amp;lt;angular-project-name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frhb5c16eq8g7n3c3jcco.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frhb5c16eq8g7n3c3jcco.png" alt="Image description" width="800" height="788"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After creating the project, let's open it in Visual Studio Code. You can open the project using the interface or by typing the command below in your command line tool.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;code .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Always access the project root before opening in Visual Studio Code or you can open VS Code first and then open the project root. Always avoid opening the folder of the project you created in the previous folder, as this can lead to errors in the build and consequently in the pipeline&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1amafv9a7n9raw56ivwe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1amafv9a7n9raw56ivwe.png" alt="Image description" width="800" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next step is the deployment, so Press F1 and search for Azure Static Web App: Create Static Web Apps and select.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fibhvru7igjpqvmv4kexi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fibhvru7igjpqvmv4kexi.png" alt="Image description" width="800" height="148"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next step, we need to select the Azure Subscription, but if you are not logged into your Azure account with Visual Studio Code, an option to make the connection will be displayed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fssjqn0s4t4ebexvhldj7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fssjqn0s4t4ebexvhldj7.png" alt="Image description" width="800" height="158"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next option, we need to define the name to be given to the service in Azure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3i1lr163xttl06v7dz2v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3i1lr163xttl06v7dz2v.png" alt="Image description" width="800" height="125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next step, it is time to define a name for the GitHub repository&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq7bg24x46gpmia8zpo7r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq7bg24x46gpmia8zpo7r.png" alt="Image description" width="800" height="149"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next step is to define the region where the resource will be created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwqocd8ep1j0e18jlvoyf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwqocd8ep1j0e18jlvoyf.png" alt="Image description" width="800" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now it's time to define the project type. Note that Azure Static Web Apps supports multiple frameworks and since our project is a Angular project, we should select the Angular option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frbou7s9n8os7kxhspys2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frbou7s9n8os7kxhspys2.png" alt="Image description" width="800" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we need to set the path to the root of the Angular project which is /. By doing so, the runner responsible for processing the code deployment pipeline will be able to run the &lt;em&gt;ng build&lt;/em&gt; command to generate the outputs in the &lt;em&gt;dist&lt;/em&gt; directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffbjwe9v0qmsmkwhrpdbg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffbjwe9v0qmsmkwhrpdbg.png" alt="Image description" width="800" height="148"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the last step, we need to define the application build output path and for Angular projects we need to inform the dist folder and the project name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flvncz41xel4zi8c7iy5k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flvncz41xel4zi8c7iy5k.png" alt="Image description" width="800" height="156"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, press enter to start creating the resource on Azure and creating the repository on GitHub.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmvk61y10gakq668bunv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmvk61y10gakq668bunv.png" alt="Image description" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the run is complete, we have an instance of Azure Static Web Apps provisioned in Azure and ready to use, and the repository on GitHub with our code. At the end, the code deployment pipeline will be executed automatically by GitHub Actions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4bgsk77l2wq1bvrbrunf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4bgsk77l2wq1bvrbrunf.png" alt="Image description" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr815dyaiq2gfcq5en3pp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr815dyaiq2gfcq5en3pp.png" alt="Image description" width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1udlax7j0y22lwjw0pk9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1udlax7j0y22lwjw0pk9.png" alt="Image description" width="800" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are getting this type of error as shown below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fca4q63lmnnno2mv8w1yg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fca4q63lmnnno2mv8w1yg.png" alt="Image description" width="800" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just remove the following line, in the &lt;em&gt;browserslistrc&lt;/em&gt; file in the root of the project&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgd6fl5g9o45mm9c7rpkj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgd6fl5g9o45mm9c7rpkj.png" alt="Image description" width="800" height="308"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And try to deploy the app or run the app again.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjzcqeusek0zf18lnivvj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjzcqeusek0zf18lnivvj.png" alt="Image description" width="800" height="845"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let's open the Azure Portal to get the link of our the Web Site in Azure Static Web App resource.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcet06qcqambak3qoblqg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcet06qcqambak3qoblqg.png" alt="Image description" width="800" height="207"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the link copied, paste it into your browser to see the result or you can simply click on the link to be redirected automatically.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8ayf67627ilg9t7wxb3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8ayf67627ilg9t7wxb3.png" alt="Image description" width="800" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Azure Static Web Apps is a powerful feature that makes it easy and fast to build and deliver a modern front-end project.&lt;/p&gt;

&lt;p&gt;Did you like this post? Want to talk a little more about it? Leave a comment with your questions and ideas or get in touch through &lt;a href="https://www.linkedin.com/in/renicius-pagotto" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>devto</category>
      <category>offers</category>
      <category>crypto</category>
      <category>web3</category>
    </item>
    <item>
      <title>Azure Static Web Apps - The Big Picture</title>
      <dc:creator>Renicius Pagotto</dc:creator>
      <pubDate>Sat, 11 Feb 2023 18:23:45 +0000</pubDate>
      <link>https://dev.to/reniciuspagotto/azure-static-web-apps-the-big-picture-1e16</link>
      <guid>https://dev.to/reniciuspagotto/azure-static-web-apps-the-big-picture-1e16</guid>
      <description>&lt;p&gt;Hey everyone, today we're going to talk about Azure Static Web App and how this feature can help you improve and speed up the deployment of static web apps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Azure Static Web Apps is a new cloud-based service that automatically builds and deploys your web app to Azure directly from your repository. It's is fully integrated with popular source code managers like GitHub, GitLab, BitBucket and Azure DevOps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Azure Static Web Apps is a global service, so your app's static resources are distributed globally and cached.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once your project is created, the CI/CD pipeline is also created with the project and runs automatically, making your project available in minutes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Built-in API support provided by Azure Functions​&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Free SSL certificates, which are automatically renewed​&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Unique preview URLs to preview Pull Request changes&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Architectural Considerations
&lt;/h2&gt;

&lt;p&gt;Static web apps can be created using popular frameworks like React, Angular, Vue, Svelt or even Blazor, as they consist of a collection of static content like HTML, CSS and Javascript, which usually depend on an API to provide data.&lt;/p&gt;

&lt;p&gt;Azure Static Web Apps supports Azure Functions, so it is possible to create an API together in the project, that is, in addition to creating a static project that will be in an app/ directory in the project, it is also possible to develop an endpoint using the Azure Functions that will be in an api/ folder within the same project, with this we can have a separation of static content and API, allowing each to be scaled using the most appropriate and cost-effective technology.&lt;/p&gt;

&lt;p&gt;This architecture with static content servers, serverless backends (Azure Functions) and automated CI/CD workflows simplifies your development workflow, allowing you to focus your attention on application logic and user experience components of your modern web application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcwfteh2igsqijpys8211.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcwfteh2igsqijpys8211.png" alt="Image description" width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  When to use it?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In creating modern web applications with front-end structures such as Angular, React, Vue, Next and other frameworks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In creating landing pages and personal websites using only HTML, Javascript and CSS.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Show me the code
&lt;/h2&gt;

&lt;p&gt;For this demo, let's create a project that contains just one HTML file that will represent a very simple landing page.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; account&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://portal.azure.com" rel="noopener noreferrer"&gt;Azure&lt;/a&gt; account&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;Visual Studio Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurestaticwebapps" rel="noopener noreferrer"&gt;Azure Static Web App extension&lt;/a&gt; for Visual Studio Code&lt;/li&gt;
&lt;li&gt;&lt;a href="https://git-scm.com" rel="noopener noreferrer"&gt;Git&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once all prerequisites are installed, open Visual Studio and create a directory with the name of your choice. In this directory, we will create an HTML file and define an HTML tag with a text as shown in the image below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fycvvvrcgc420wct4m2wf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fycvvvrcgc420wct4m2wf.png" alt="Image description" width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With that, we basically have a code ready to carry out the deployment and the next step is exactly that.&lt;/p&gt;

&lt;p&gt;Press F1 and search for Azure Static Web App: Create Static Web Apps and select.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvew3rxecixhqbl0kj1yv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvew3rxecixhqbl0kj1yv.png" alt="Image description" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next step, we need to select the Azure subscription, if you are not logged into your Azure account with Visual Studio Code, an option to connect will appear.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Falanur8joj22bjzan39o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Falanur8joj22bjzan39o.png" alt="Image description" width="800" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once we select the signature, a pop-up appears on the screen informing that it is necessary to create a repository to store the code, so click on the Create button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpao6fn3pvtpctemet40o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpao6fn3pvtpctemet40o.png" alt="Image description" width="800" height="578"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next step, we need to create a message to confirm before pushing our code to the repository. Type the message you want and press Enter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs0s79wfsg9m2da4pta3l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs0s79wfsg9m2da4pta3l.png" alt="Image description" width="800" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the Azure Static Web Apps extension needs access to your GitHub account to store the code. Click the Allow button to be redirected to authenticate your account.&lt;/p&gt;

&lt;p&gt;The popup below will not appear if you are already logged into your account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz5n4529yi633nkc2tqyn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz5n4529yi633nkc2tqyn.png" alt="Image description" width="800" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next step, we return to the Azure Static Web Apps settings and now we need to define the name to be given to the service.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh0r1wwqlqiv64ytgtlnc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh0r1wwqlqiv64ytgtlnc.png" alt="Image description" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next option we need to define a name for the GitHub Repository.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh8y171ej69ach8hm2fsh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh8y171ej69ach8hm2fsh.png" alt="Image description" width="800" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next step is to define the region where the resource will be created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmfrizk6q6vwiw0gmv3zx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmfrizk6q6vwiw0gmv3zx.png" alt="Image description" width="800" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now it's time to define the project type. Note that Azure Static Web Apps supports multiple frameworks and since our project is a simple index.html file, we should select the Custom option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fos1dz4sznarf5hkj29zs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fos1dz4sznarf5hkj29zs.png" alt="Image description" width="800" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we need to define the path to reach the index.html file, but as the index is at the root of the directory, just define / for this option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9bn2eo0qu6cadset4yrn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9bn2eo0qu6cadset4yrn.png" alt="Image description" width="800" height="210"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the last step, we need to define the application build output path, however as our application is a simple HTML file, we don't need to define anything, however if the project was from some other framework, we would need to define the path to the dist folder or whatever another pattern.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd6lv7a3vzqmxcezrzpiq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd6lv7a3vzqmxcezrzpiq.png" alt="Image description" width="800" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Press enter to start creating the resource.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuopzfgxuqu84p06gq2j1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuopzfgxuqu84p06gq2j1.png" alt="Image description" width="800" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's go to the Azure portal to check the resource that was created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft8j0dns16w4uz506y0cr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft8j0dns16w4uz506y0cr.png" alt="Image description" width="800" height="154"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Selecting the resource, let's copy the url and paste it in our browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F42186q0amo4u4um3k7k9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F42186q0amo4u4um3k7k9.png" alt="Image description" width="800" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Futaz2cngouag82o9zknm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Futaz2cngouag82o9zknm.png" alt="Image description" width="800" height="235"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Github Actions
&lt;/h2&gt;

&lt;p&gt;After completing all the steps, a directory called github is created in your project and inside it we can see that a yml has been created. This yml file represents the project's deployment pipeline.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhty1hwvkvhjocgktt3s1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhty1hwvkvhjocgktt3s1.png" alt="Image description" width="800" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that this pipeline was triggered automatically on GitHub.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk32p9s7ln9wi6ipd54ja.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk32p9s7ln9wi6ipd54ja.png" alt="Image description" width="800" height="196"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Temporary URL
&lt;/h2&gt;

&lt;p&gt;There is an amazing feature which is the possibility of having a temporary URL to analyze the changes made to the code in the Pull Request. Once the pull request is finished, the url will no longer be available for use.&lt;/p&gt;

&lt;p&gt;To start the demo, create a new branch based on the main branch, feel free to name it whatever you like. Now, being in this new branch, let's add some new text in the code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8yx2hdis8oehbao5ee27.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8yx2hdis8oehbao5ee27.png" alt="Image description" width="800" height="625"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let's commit and push the new code&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F62lopdpn9v96e3vc6r2u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F62lopdpn9v96e3vc6r2u.png" alt="Image description" width="800" height="727"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next step, we'll open a Pull Request and wait for the pipeline to finish executing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnfuopd4i01qwyuzvv48d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnfuopd4i01qwyuzvv48d.png" alt="Image description" width="800" height="347"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2sq0d0622m7nu7xc1z1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2sq0d0622m7nu7xc1z1.png" alt="Image description" width="800" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To get the temporary URL, click the Actions tab and select the run based on your new branch.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovdflkz9pfvntdi6d5t6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovdflkz9pfvntdi6d5t6.png" alt="Image description" width="800" height="209"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click Build and Deploy Job in the left menu and then select Build and Deploy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F17xzbripg3ifqsy2dl9w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F17xzbripg3ifqsy2dl9w.png" alt="Image description" width="800" height="248"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scroll down to the bottom to see the URL.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5qxiwki66d9apz1aico5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5qxiwki66d9apz1aico5.png" alt="Image description" width="800" height="493"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, copy and paste into your browser to see the change.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7qq0229csk286ceaf2qv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7qq0229csk286ceaf2qv.png" alt="Image description" width="800" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Azure Static Web Apps is a powerful feature that makes it easy and fast to build and deliver a modern front-end project.&lt;/p&gt;

&lt;p&gt;Did you like this post? Want to talk a little more about it? Leave a comment with your questions and ideas or get in touch through &lt;a href="https://www.linkedin.com/in/renicius-pagotto" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Azure Static Web Apps with React and Visual Studio Code</title>
      <dc:creator>Renicius Pagotto</dc:creator>
      <pubDate>Sat, 11 Feb 2023 17:23:05 +0000</pubDate>
      <link>https://dev.to/reniciuspagotto/azure-static-web-app-with-react-and-visual-studio-code-5c73</link>
      <guid>https://dev.to/reniciuspagotto/azure-static-web-app-with-react-and-visual-studio-code-5c73</guid>
      <description>&lt;p&gt;Hey everyone, in today's post we are talking about how deploy an React Application to Azure Static Web App using Visual Studio Code.&lt;/p&gt;

&lt;p&gt;To understand what is Azure Static Web App, visit &lt;a href="https://dev.to/reniciuspagotto/azure-static-web-apps-the-big-picture-1e16"&gt;Azure Static Web Apps - The Big Picture&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://nodejs.org/en/download" rel="noopener noreferrer"&gt;NPM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;Visual Studio Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurestaticwebapps" rel="noopener noreferrer"&gt;Azure Static Web App extension&lt;/a&gt; for Visual Studio Code&lt;/li&gt;
&lt;li&gt;&lt;a href="https://git-scm.com" rel="noopener noreferrer"&gt;Git&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installing React Framework
&lt;/h2&gt;

&lt;p&gt;Once all the prerequisites are installed on your machine, the next step is to install React, for that run the command below.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install -g create-react-app&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a ReactJS project
&lt;/h2&gt;

&lt;p&gt;Now that you have React installed, you can create a new react project directory by running the command below&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npx create-react-app &amp;lt;project-name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After creating the project, let's open it in Visual Studio Code. You can open the project using the interface or by typing the command below in your command line tool.&lt;/p&gt;

&lt;p&gt;code .&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Always access the project root before opening in Visual Studio Code or you can open VS Code first and then open the project root. Always avoid opening the folder of the project you created in the previous folder, as this can lead to errors in the build and consequently in the pipeline.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy9o1tnumupaleast950y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy9o1tnumupaleast950y.png" alt="Image description" width="800" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next step is the deployment, so Press F1 and search for Azure Static Web App: Create Static Web Apps and select.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs2dsvq957tmxipobpi87.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs2dsvq957tmxipobpi87.png" alt="Image description" width="800" height="318"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next step, we need to select the Azure Subscription, but if you are not logged into your Azure account with Visual Studio Code, an option to make the connection will be displayed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6xmkgijw66i5a4q34dm0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6xmkgijw66i5a4q34dm0.png" alt="Image description" width="800" height="151"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next option, we need to define the name to be given to the service in Azure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff7uolctuhwkeb3yhymlk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff7uolctuhwkeb3yhymlk.png" alt="Image description" width="800" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next step, it's time to define a name for the GitHub repository&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ymj07blwunp4uhhen17.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ymj07blwunp4uhhen17.png" alt="Image description" width="800" height="234"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next step is to define the region where the resource will be created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frw5vf2pkea3i63mt5sih.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frw5vf2pkea3i63mt5sih.png" alt="Image description" width="800" height="275"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now it's time to define the project type. Note that Azure Static Web Apps supports multiple frameworks and since our project is a React project, we should select the React option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe5evrkx7xb1u79zm0vcw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe5evrkx7xb1u79zm0vcw.png" alt="Image description" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here we need to set the path to the root of the React project. By doing this, the executor responsible for deploying the code will be able to run the &lt;em&gt;npm run build&lt;/em&gt; command to generate the outputs in the build directory. Let's set / to this option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6wsqz36n876n9mw1pf7s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6wsqz36n876n9mw1pf7s.png" alt="Image description" width="800" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the last step, we need to define the application build output path and for React projects we need to inform the &lt;em&gt;build folder&lt;/em&gt; that it's generate by build command.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feg1p83akh9vbufh6j7fk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feg1p83akh9vbufh6j7fk.png" alt="Image description" width="800" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, press enter to start creating the resource on Azure and creating the repository on GitHub.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd44pt21b38rheefl8zwz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd44pt21b38rheefl8zwz.png" alt="Image description" width="800" height="245"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the run is complete, we have an instance of Azure Static Web Apps provisioned in Azure and ready to use, and the repository on GitHub with our code. At the end, the code deployment pipeline will be executed automatically by GitHub Actions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkf4j4hg71963hgjkx6vu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkf4j4hg71963hgjkx6vu.png" alt="Image description" width="800" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff4braghyqls8vq7lj90k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff4braghyqls8vq7lj90k.png" alt="Image description" width="800" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkwt7j4urtqfie0qpza1m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkwt7j4urtqfie0qpza1m.png" alt="Image description" width="800" height="283"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let's open the Azure Portal to get the link of our the Web Site in Azure Static Web App resource.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foipcgb4742rmiz7fav3w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foipcgb4742rmiz7fav3w.png" alt="Image description" width="800" height="241"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the link copied, paste it into your browser to see the result or you can simply click on the link to be redirected automatically.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcq6h4t4yp2mpc1fz4rh3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcq6h4t4yp2mpc1fz4rh3.png" alt="Image description" width="800" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Azure Static Web Apps is a powerful feature that makes it easy and fast to build and deliver a modern front-end project.&lt;/p&gt;

&lt;p&gt;Did you like this post? Want to talk a little more about it? Leave a comment with your questions and ideas or get in touch through &lt;a href="https://www.linkedin.com/in/renicius-pagotto" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>devto</category>
      <category>announcement</category>
      <category>community</category>
      <category>socialmedia</category>
    </item>
    <item>
      <title>Understanding Azure Event Hubs Capture</title>
      <dc:creator>Renicius Pagotto</dc:creator>
      <pubDate>Thu, 22 Dec 2022 12:38:45 +0000</pubDate>
      <link>https://dev.to/reniciuspagotto/understanding-azure-event-hubs-capture-110</link>
      <guid>https://dev.to/reniciuspagotto/understanding-azure-event-hubs-capture-110</guid>
      <description>&lt;p&gt;Hello everyone, today we are going to talk about data capture in Azure Event Hubs and understand how this feature can empower data processing and storage.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Event Hubs Capture?
&lt;/h2&gt;

&lt;p&gt;It's a feature of Azure Event Hub that allows Azure Blob Storage or Azure Data Lake Storage Gen 1 and Gen 2 to automatically receive all events sent to the hub with the flexibility to specify a time interval or size.&lt;/p&gt;

&lt;p&gt;According to Microsoft, setting up Capture is fast, there are no administrative costs to run it, and it scales automatically with Event Hubs throughput units in the standard tier or processing units in the premium tier.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft0k9trc63to4qzsbgiaf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft0k9trc63to4qzsbgiaf.png" alt="Image description" width="800" height="374"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For more information, please visit &lt;a href="https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-capture-overview" rel="noopener noreferrer"&gt;Azure Event Hubs Capture&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Important
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The destination storage (Azure Storage or Azure Data Lake Storage) account must be in the same subscription as the Azure Event Hubs.&lt;/li&gt;
&lt;li&gt;Azure Event Hubs does not support capturing events in an Azure Premium Storage account.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When to use?
&lt;/h2&gt;

&lt;p&gt;A good scenario to use Azure Event Hubs Capture is for event retention where, once captured, we can replay those events.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8bpv5tvh931n57k9e0d4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8bpv5tvh931n57k9e0d4.png" alt="Image description" width="800" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another use case would be Event Sourcing, where you can store all the events that happened in your application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbqsj08g3byl6fdvvwsj2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbqsj08g3byl6fdvvwsj2.png" alt="Image description" width="800" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another scenario that Azure Event Hubs Capture allows you to focus on data processing instead of data capture.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to create a Azure Event Hubs resource?
&lt;/h2&gt;

&lt;p&gt;Open the &lt;strong&gt;Azure Portal&lt;/strong&gt; and in the search engine type Azure Event Hubs and select the resource.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc82d9kt16phlkcb15b5i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc82d9kt16phlkcb15b5i.png" alt="Image description" width="800" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select &lt;strong&gt;+Create&lt;/strong&gt; option&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8zxdx23g6zua3jkyorro.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8zxdx23g6zua3jkyorro.png" alt="Image description" width="762" height="666"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we need to provide some information that will be used to create the resource, feel free to provide the names you want. Once completed, at the bottom of the page select &lt;strong&gt;Review + create&lt;/strong&gt; to validate the information and select &lt;strong&gt;Create&lt;/strong&gt; when validation is complete to create the resource.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0nxpois5gnx9rtzg8q23.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0nxpois5gnx9rtzg8q23.png" alt="Image description" width="800" height="912"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This operation may take a few minutes and after that your resource will be available to be used in the application.&lt;/p&gt;

&lt;p&gt;Now, we need to create a Hub that will receive the application's events. From the left menu, select &lt;strong&gt;Event Hubs&lt;/strong&gt; and then select &lt;strong&gt;+ Event Hub&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F00e1ijo0t8v6wvw9w5k3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F00e1ijo0t8v6wvw9w5k3.png" alt="Image description" width="800" height="778"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We need to provide some information for creating the Hub, again feel free to name it as you wish. Once completed, at the bottom of the page, select &lt;strong&gt;Review + create&lt;/strong&gt; to validate the information and select &lt;strong&gt;Create&lt;/strong&gt; when validation is complete to create the resource.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbhezjoin09qu1qlanbfl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbhezjoin09qu1qlanbfl.png" alt="Image description" width="800" height="872"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, the hub will be available for use.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fppw4w1yxlj2y2s687ece.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fppw4w1yxlj2y2s687ece.png" alt="Image description" width="800" height="196"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to enable Event Hub Capture?
&lt;/h2&gt;

&lt;p&gt;Now, it's time to enable the Capture feature, but before that, you need to create an Azure Blob Storage and a container or an Azure Data Lake to use to receive the events. In my demo scenario I will use Azure Blob Storage.&lt;/p&gt;

&lt;p&gt;After creating the resource that will receive the events, open the Event Hub we created above and select the &lt;strong&gt;Capture&lt;/strong&gt; option, select &lt;strong&gt;Avro&lt;/strong&gt; as serialization format and enable capture.&lt;/p&gt;

&lt;p&gt;Apache Avro is a data serialization system, for more information visit &lt;a href="https://avro.apache.org/" rel="noopener noreferrer"&gt;Apache Avro&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj43eecvv7ttrtkl9v210.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj43eecvv7ttrtkl9v210.png" alt="Image description" width="800" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we need to define some information that Azure Event Hubs Capture will use to capture the events and send it to the target resource. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fio7di5ergnbqtu2x3n02.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fio7di5ergnbqtu2x3n02.png" alt="Image description" width="800" height="639"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Below we have the explanation of the information:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Time window&lt;/strong&gt; - The time interval in which the data will be collected, in this case every 5 minutes the data will be captured and sent to the target resource.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Size window&lt;/strong&gt; - The amount in MB of events that the process will capture. The default value is 300 MB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Do not emit empty files when no events occur during the Capture time window&lt;/strong&gt; - Once the checkbox is checked, the capture will only capture events that have information, if no events are found, then nothing will be sent to the target destination.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Capture Provider&lt;/strong&gt; - Here we define the destination of events which can be Azure Blob Storage or Azure Data Lake.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Azure Storage Container or Data Lake Store&lt;/strong&gt; - This information is based on the previous one, if you set the &lt;strong&gt;Capture Provider&lt;/strong&gt; as Azure Blob Storage then you need to select the container to receive the events, if you set it as &lt;strong&gt;Azure Data Lake&lt;/strong&gt; then you need to inform the Data Lake name and Data Lake Path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sample Capture file name formats&lt;/strong&gt; - Here we define the path format for storing the event.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Capture file name format&lt;/strong&gt; - This format will follow the format of the &lt;strong&gt;Sample Capture File Name Formats&lt;/strong&gt; field.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Below is a simple example of the way to find the event in Azure Blob Storage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;e.g. customer-event/customer-created/0/2022/12/20/13/06/53&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In my case, I chose Azure Blob Storage as the Capture Provider and defined the container that will receive the events.&lt;/p&gt;

&lt;p&gt;After filling, select &lt;strong&gt;Save changes&lt;/strong&gt; to definitely enable the feature.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmdz3czya5ngnsc5qxdix.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmdz3czya5ngnsc5qxdix.png" alt="Image description" width="800" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once capture is enabled, all events are automatically captured every 2 minutes in 300MB batches and sent to Azure Blob storage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Show me how it works
&lt;/h2&gt;

&lt;p&gt;To demonstrate how it works, I created an event producer to publish them in the event hub.&lt;/p&gt;

&lt;p&gt;Basically, this producer is an API project that contains an HTTP POST endpoint that, once the request is made, will publish an event in the hub of a created user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        [HttpPost]
        public async Task&amp;lt;IActionResult&amp;gt; SendEvent()
        {
            var eventHubConnectionString = _configuration.GetValue&amp;lt;string&amp;gt;("EventHub:Connection");
            var eventHubName = _configuration.GetValue&amp;lt;string&amp;gt;("EventHub:ProductHubName");

            var producerClient = new EventHubProducerClient(eventHubConnectionString, eventHubName, new EventHubProducerClientOptions
            {
                RetryOptions = new EventHubsRetryOptions
                {
                    MaximumRetries = 5,
                    Delay = TimeSpan.FromSeconds(2)
                }
            });

            var eventBatch = await producerClient.CreateBatchAsync();

            var obj = new
            {
                Name = "Renicius Pagotto",
                Email = "test@test.com",
                Age = 30
            };

            eventBatch.TryAdd(new EventData(Encoding.UTF8.GetBytes(JsonSerializer.Serialize(obj))));
            await producerClient.SendAsync(eventBatch);

            return Ok($"The event has been published on {DateTime.Now}");
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below is the postman request&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo5yhvl3icl5ob8l1jr04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo5yhvl3icl5ob8l1jr04.png" alt="Image description" width="800" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now is the time to view the event in Azure Blob Storage and for that, we must use the format that was defined in the capture resource, which basically represents the file path.&lt;/p&gt;

&lt;p&gt;In my scenario, my time zone is GMT-3 which means I need to add 3 hours from the time the message was posted so I can get the correct time as Azure works with UTC.&lt;/p&gt;

&lt;p&gt;So to find the event in Azure Blob Storage the path is 2022 - 12 - 20 - 13 - 18 - 27&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F09al9hwhmlvnu1bndlxv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F09al9hwhmlvnu1bndlxv.png" alt="Image description" width="800" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And opening the file, we can see the information we posted.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv8d5gl2f7gfs03pcehxx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv8d5gl2f7gfs03pcehxx.png" alt="Image description" width="800" height="194"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Project: &lt;a href="https://github.com/reniciuspagotto/eventhub-producer-consumer" rel="noopener noreferrer"&gt;https://github.com/reniciuspagotto/eventhub-producer-consumer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Did you like this post? Want to talk a little more about? Leave a comment with your questions and ideas or get in touch through &lt;a href="https://www.linkedin.com/in/renicius-pagotto" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>blobstorage</category>
      <category>azureeventhubs</category>
      <category>eventhubcapture</category>
    </item>
  </channel>
</rss>
