Azure Static Web Apps publica sitios web en un entorno de producción mediante la creación de aplicaciones desde un repositorio de GitHub.Azure Static Web Apps publishes websites to a production environment by building apps from a GitHub repository. En este inicio rápido, va a compilar una aplicación web con su marco de front-end preferido desde un repositorio de GitHub.In this quickstart, you build a web application using your preferred front-end framework from a GitHub repository.
Si no tiene ninguna suscripción a Azure, cree una cuenta de evaluación gratuita.If you don’t have an Azure subscription, create a free trial account.
En este artículo se usan repositorios de plantillas de GitHub para facilitar la creación de un nuevo repositorio.This article uses GitHub template repositories to make it easy for you to create a new repository. Las plantillas incluyen aplicaciones de inicio compiladas con diferentes marcos de front-end.The templates feature starter apps built with different front-end frameworks.
Nota
Azure Static Web Apps requiere al menos un archivo HTML para crear una aplicación web.Azure Static Web Apps requires at least one HTML file to create a web app. El repositorio que se crea en este paso incluye un solo archivo index.html.The repository you create in this step includes a single index.html file.
Haga clic en Crear repositorio a partir de plantilla.Click the Create repository from template button.
Ahora que se ha creado el repositorio, puede crear una aplicación web estática desde Azure Portal.Now that the repository is created, you can create a static web app from the Azure portal.
Para empezar, configure la nueva aplicación y vincúlela a un repositorio de GitHub.Begin by configuring your new app and linking it to a GitHub repository.
Una vez que inicie sesión con GitHub, escriba la información del repositorio.Once you sign in with GitHub, then enter the repository information.
A continuación, agregue los detalles de configuración específicos de su plataforma de front-end preferida.Next, add configuration details specific to your preferred front-end framework.
Haga clic en el botón Revisar y crear.
Después de validar la solicitud, puede continuar con la creación de la aplicación.After the request validates, you can continue to create the application.
Haga clic en el botón Crear
Una vez que el recurso es creado, haga clic en el botón para acceder a los recursos. Una vez que el recurso es creado, haga clic en el botón para acceder a los recursos
Hay dos aspectos para implementar una aplicación estática.There are two aspects to deploying a static app. El primero aprovisiona los recursos de Azure subyacentes que componen la aplicación.The first provisions the underlying Azure resources that make up your app. El segundo es un flujo de trabajo de Acciones de GitHub que crea y publica la aplicación.The second is a GitHub Actions workflow that builds and publishes your application.
Para poder navegar a un nuevo sitio estático, la compilación de implementación debe terminar de ejecutarse.Before you can navigate to your new static site, the deployment build must first finish running.
En la ventana Información general de Static Web Apps se muestran una serie de vínculos que le ayudarán a interactuar con la aplicación web.The Static Web Apps overview window displays a series of links that help you interact with your web app.
Al hacer clic en el banner con el texto «Click here to check the status of your GitHub Actions runs» (Haga clic aquí para comprobar el estado de las ejecuciones de las Acciones de GitHub»), se le dirigirá a las Acciones de GitHub que se ejecutan en el repositorio.Clicking on the banner that says, «Click here to check the status of your GitHub Actions runs» takes you to the GitHub Actions running against your repository. Una vez que haya verificado que el trabajo de implementación se ha completado, puede ir a su sitio web a través de la URL generada.Once you verify the deployment job is complete, then you can navigate to your website via the generated URL.
Una vez completado el flujo de trabajo de Acciones de GitHub, puede hacer clic en el vínculo con la dirección URL para abrir el sitio web en una pestaña nueva.Once GitHub Actions workflow is complete, you can click on the URL link to open the website in new tab.
Si no va a seguir usando esta aplicación, puede eliminar la instancia de Azure Static Web Apps mediante los siguientes pasos:If you’re not going to continue to use this application, you can delete the Azure Static Web Apps instance through the following steps:
Adición de una APIAdd an API
Gracias.
Gracias.