You need a hosting environment. Then you deploy to the environment.
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/?view=aspnetcore-8.0
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I have followed the instructions for creating an application that can pull data using the Microsoft Graph API:
Currently I can only get the data by running the VS project. I want to convert/deploy this project as a GET web API so that I can pull data using the web link and automate the query process.
Can someone please help me this request?
Any help will be much appreciated.
You need a hosting environment. Then you deploy to the environment.
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/?view=aspnetcore-8.0
Hi Jorziño, Currently I can only get the data by running the VS project
which means you are now able to pull data via Graph API by calling request like https://localhost:port/get-data-endpoint
. This link can only be used in your own machine. To make it to be public and open, we require a server and application host, deploy the app to the server, then make the server and the port we select to be public, it might be complex for you. So I'm afraid that using the out-of-box cloud service - Azure web app is a good option for you. It has free pricing tier to host a web application, but we need to sign up for free and create subscription in advance.
Then we can try to publish the application to Azure via Visual Studio. My demo is using an .Net 6 MVC application. Just right click on the project name and click "Publish",
Then choose Azure as the publish target, and then choose Azure App Service(windows).
Next you will need to sign in with the account you sign up just now, and let's create a new resource group(used to put Azure services worked like a folder) and create a new service plan (define where you host your app, and how much CPU/Memory you want to use, let's choose the free pricing tier for test purpose).
After we create the web app instance along with the resource group it placed and the service plan it used, we choose this instance and click finish. Then we will close the configuration Dialog and then click the Publish button to publish the application to Azure. After the progress is completed, it will automatically open your browser to visit a website like webappname.azurewebsites.net
and you can visit this site in any client.
Here's the tutorial for using VS to publish web app to Azure, you can follow this tutorial as well.
==========================================
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Tiny