I am trying to implement a solution to automate the deployment of an api to multiple hosts. The api is a private one which links a mobile app to a on-prem DB.
Right now i have to connect to the said host with VPN, create a backup of the API, paste the new one, change the DB connectionString and then move to the next one.
The question is how can i simplify this process? I want to be able to deploy said API to all hosts using specific Server and Database variables to connect to their databases.
I am looking more for guidance, not a complete in-depth implementation but explaining the process a bit sure is welcomed :)
The API runs on ASP Core 6.0 using Azure Devops as a TFVC repo
Related
I have been using local databases to develop web applications in ASP.NET Razor Pages. My experience was that the local database creates itself simultaneously with the development of the web application.
Currently, I need to work with a cloud database set up in Microsoft Azure. This cloud database already contains tables. How can I connect to the cloud database and call these tables and their attributes in razor pages?
You need read the offical document first.
There are two ways you can set your sqldb connections. One is written in the appsetting.json file, and the other is set in the portal, as mentioned in the official documentation.
The difference between the two is that the setting priority in the portal is higher than the configuration in the code file, and the configuration will be overwritten when it is released.
For novices, you can get the Connection strings in the portal. Then you first ensure that your program can run normally, and replace the connection string in the appsetting.json file with the string provided in the portal. If normal CURD operation is possible, then the connection is successful.
I have an API published to Azure App Services, using ef core, connect to Azure SQL database. below are the steps and the problem:
The Azure SQL database is up and running OK, I setup two firewall rules, one for my local dev ip, one for Azure App. I can connect to Azure SQL from local without any issue, and I have done the migrations.
I copied the connection string from Azure SQL and put in the appsettings.json, running the API from my local and connect to Azure SQL without any issue.
I published my API to Azure App services without any issues, I can see my app running OK since it has static file.
Then I went to Azure App Services => Settings/Configuration => Connection strings, create one new connect string with the same key/value as I used in the appsettings.json, based on the document from Microsoft: https://learn.microsoft.com/en-us/azure/app-service/containers/configure-language-dotnetcore#access-environment-variables
But the problem is after I done these, my API still not working, the api call to SQL return error 500.
Anything I missed or did wrong?
Thanks!
Thanks for the comments CSharpRocks, I did by adding the client ip, but I figured that's not the right way, so resolved by set the "Allow Azure services and resources to access this server" to True, that works.
For Others looking for the answer I had followed the steps above and it still did not work for me. But when I went to Visual Studios --> Publish --> Service Dependency's --> Add Azure SQL Database That fixed it for me.
I working on my school project.My project purpose is movie rating application with ionic.When I will present my application on the phone.I need to get data on the internet.So I have to use cloud system for keep in web service and sql database.Oh also I will using sql database.I want to build database and web service on the azure.But its my first time for azure.How can I migrate my sql database to azure and how can I create web service in azure.Im rookie these things.I need a starting point.I searched on the web but cant find a good tutorial :(
If your SQL Database and WebService structure is not a requirement, you can also explore other options such as Mobile Apps. Mobile apps is a workload on Azure specifically built for such scenarios to connect with mobile devices and two way data communication. It uses what is called "Table storage" on Azure. You can start with that and later on move to a no-sql database such as DocumentDB for persistent storage and querying.
You can find a step by step tutorial below on how to create the Mobile apps and connect it to different platform such as Windows Phone, Android or iPhone. The link here is for Android. If you wish to use other platforms you can use the tab to switch to them. It will even give you a sample project that you can download and run directly which can get you started pretty quickly. I also have a blog post around this if you are interested.
https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-android-get-started/
Hope this helps!
I had a engineer design our .net application back in 2009, my guess is that it was coded using visual studio, and all I have is the installer application. We have been using it on our 1 or 2 local client machines very well for the past few years, but now I want to move this front end to the cloud. Instead of installing it as an application on our windows 7 machines.
It is a very simple application used in our small warehouse that keeps track of cargo/shipments etc. It uses Sql Server 2008 Express as a backend which is stored locally.
I know how to get the database in the cloud, their are many options for that, using Amazon or Azure, but how do i get the local client application to the cloud?
I dont have access to the visual studio code, i just have the runtime executable file..
I am sure there is no way to do this, and many of SO users will say i need to re-write the front end.
I have tried to contact the developer and they hav since closed down. Is their anyway i can run this in the cloud?
I welcome all options and solutions!
Thanks.
I believe you have two options for hosting this application:
If you are able to configure the database connection string, you could host the database in the cloud, and distribute the application to your end users. However, you've already stated that you know how to move the database, so I assume this isn't an option.
The only alternative is to run the entire application on a cloud server, and send the user interface to a client using terminal services. This makes it appear as if the application is running locally on the user's computer, while it is actually running on the server.
For an off-the-shelf solution to achieve this, you could consider using Microsoft's RemoteApp Azure service. I'm sure there are other similar offerings available.
I'm very new to Sync Framework, Still exploring different possibilities. Here is my Scenario.
We need to have an application (SQL Server and ASP.Net) which is hosted on our web server. Users can register and interact with it online. Another Copy of the application will be installed on our Client's Intranet server. Users can be registered over LAN on this server.
A third copy of the Application (SQL Express) will be installed on various laptops and windows 7 tablets. Users will use the application remotely without connectivity to LAN or internet. Once the device is back in network, it will sync data with the LAN server and LAN Server will sync to the Internet server.
I intend to do this using WCF services and Sync Framework for the sake of security, however I'm open for suggestions. Can someone please suggest me the correct way of doing this and point me to some tutorials samples to do this. I've been struggling with samples available online (mainly this one http://code.msdn.microsoft.com/Database-SyncSQL-Server-e97d1208) for a while and still have no success ..
Feel free to shoot any questions and I will answer them as best as I can.
have a look at this link and ignore/substitute the Azure specific stuff with SQL Server...it has a good discussion on the WCF specific components... Walkthrough of Windows Azure Sync Service Sample