You don't have access to this class

Keep learning! Join and start boosting your career

Aprovecha el precio especial y haz tu profesión a prueba de IA

Antes: $249

Currency
$209
Suscríbete

Termina en:

1 Días
23 Hrs
8 Min
47 Seg

Publicación y ajustes de mi Web API

13/17
Resources

How to test local web applications successfully?

Learning how to develop and test local web applications can be an incredibly satisfying experience. The ability to see your ideas come to life can fill you with happiness as you see your application working correctly. When working with local servers, it is important to follow certain steps to ensure proper API deployment and communication with different HTTP clients. Here's how to efficiently manage and test your web application locally.

What to do after creating your SQL database?

Once you have created your SQL data table, the next step is to make sure that your web application correctly displays the stored information. This process is commonly done using a web application API with a suitable framework, such as the one provided by Visual Studio. This way, you can view your data in a JSON structured format.

  • Running the application: Initially, use the dotnet run command in your terminal. This will automatically open a tab in your browser.
  • Check the data: Make sure that the /api/happy path displays a JSON with the correct data stored in your database.

How to make requests from different clients?

When testing applications, it is crucial to evaluate their performance from different client interfaces. Even if you primarily use a web browser, tools like Postman can offer a more robust way to interact with your API.

  • Using Postman: Copy your API URL from the browser and paste it into Postman. Send HTTP requests to check that the API responds correctly.
  • Manage SSL certificates: In case of problems with SSL certificates, you can disable verification, which is useful during local testing.

How to avoid writing repetitive code?

Postman offers a very valuable tool to save time when developing applications that interact with APIs. This tool allows you to automatically generate code snippets in various programming languages based on the request you make.

  • Automatic code generation: Select the code tab in Postman and choose the programming language of your choice. Copy and paste the generated code to integrate it into your application.

What is the next step to make the application public?

Once you have performed the necessary tests and your application is working properly, the natural step is to make it publicly accessible. This involves deploying your Web API on an externally accessible server, commonly on platforms such as Azure.

  • Automatic deployment: Use Visual Studio Code to create the necessary folder with dotnet publish. Adjust it so that your application is ready to be uploaded to a hosting platform, such as Azure.
  • Continuous integration: Consider implementing continuous integration and continuous deployment (CI/CD) to improve efficiency for future upgrades.

Why is it essential to explore the full course to optimize your Azure development?

Completing your application development does not mean the end of your learning. It is beneficial to take the time to delve deeper into how to automate the deployment process using continuous integration practices. Reviewing these topics through a specialized Azure Web Apps course will allow you to optimize your workflow for future deployments and development.

By following these steps, you will not only be taking your application to the next level, but you will be solidifying your skills as a developer by expanding your knowledge of infrastructure and testing tools. Continue to improve and explore new paths in web development.

Contributions 22

Questions 2

Sort by:

Want to see more contributions, questions and answers from the community?

Si no les aparece deploy to web app deben instalar la extensión azure app service

tienen que dar permiso al server de la BD para que acceda ademas de tu ip a la ip de los servicios de azure(app services) para que no tenga problemas de acceder desde azure app service a tu server de base de datos

A la fecha la forma que he creado la web_app por visual code. Es por medio de la extensión. Entrar al icono correspondiente de las extensiones y despues que han ingresado sus credenciales se mostrará la suscripción con lo siguiente.

Click derecho en App Service para crear una Web App.

Ingresas el nombre de la aplicación a llamar y el cssto de la creación de la web app y listo.

Si no te sirve el link, puedes usar esta:

https://localhost:5001/Contact

Comando utilizado en la clase:
donet publish -c Release -o ./publish

Crear una nueva regla de seguridad

Si tienes problemas y no te muestra la app publicada, a pesar de que estas seguro que hiciste todo bien, es porque, probablemente, no has creado una nueva regla de seguridad con la IP que usa la WebAPI.

Para ello sigue estos pasos.

  1. Entra a tu grupo donde esta la base de datos (en mi caso es platziSQLGroup)
  2. Ve al Servidor, y ve a la parte de Firewall y redes virtuales
  3. En la pagina de tu web-api, selecciona la seccion de Dominios personalizados y copia la direccion IP qur tienes.
  4. Pega esa direccion ip en la nueva regla de dominio del lado de tu servidor.

Listo, ya esta registrado para que puedas probar tu API.

No me aparecen mis datos en la webapi publicada en Azure. ¿A alguien más le pasó?

No me sale la opción para publicar 😭

Recuerden habilitar en el server de la base de datos en la seccion de Firewall (Allow Azure services and resources to access this server)

Nooo puedo creer, yo hace 2 semanas necesita esa funcionalidad de Postman y no la sabia

Final dramatico… Acceso a tu que!!! (proximamente) ;p

El profesor es muy buena onda, pero pieso que este curso debería ser de C# no de Azure

Aún no entiendo si es un curso de SQL en Azure o de creación de APIs en Azure.

Muy facil pueblicar codigo

super

Pero solo acepta cosigo del ecosistema de .NET, que tal Node o Php?

Me parece mejor idea usar integración continua para crear la api pública en azure.

En lugar de contactos cree una bd de neoceratopsida, un clado de dinosaurios, y valla infierno me arme yo solo con los nombres…

Para los nuevos estudiantes, cuando les pregunte en que .Core no le den a net5, mejor es la versión netCore 3.1, porque el acceso no es denegado; en la url les saldrá error 404 pero ponen despues de la ruta /Contact y ya sale.

No me arroja los resultados de la consulta al hacerlo por la url publicada de azure, me dale en la peticion error 500 error de servidor