Thanks for looking.
I have a need to be able to create new Azure website and database instances from a Windows forms application I have created as an internal-use tool.
I am not sure if there is a C# API for this or if I need to use Powershell or some other CLI, but I would appreciate any advice.
All of the searching I have done on the subject has not turned up a simple, direct explanation as to how to do this or if it is even possible.
Using Azure Resource Manager (ARM) API's is the way to go these days - especially with your scenario. You've probably seen documentation that uses the old Service Management API's to do this. You could still do this, but I would strongly discourage it. ARM is where the investment in automation is landing going forward.
For your particular scenario, there is actually a tutorial here.
If you are using Visual Studio 2013 or 2015, then you can also use the ARM templates that it provides. For example, from Visual Studio, select File > New > Project and choose the Azure Resource Group project template.
The next window in the new project dialog is where you can select from some common deployment templates, such as what you are looking for, which is a Web App + SQL Database.
This project will contain the ARM template that describes your environment and a script that you can use to invoke ARM to deploy it.
To deploy the environment, right-click on the project in Visual Studio and select Deploy. Fill in the parameters that the template provides and you are on your way. If you look in the script that is generated (Deploy-AzureResourceGroup.ps1), you will see at the bottom of the script a call to New-AzureResourceGroup. What this does is basically merge your ARM template and parameters together and then sends them to Azure Resource Manager to provision the environment. In other words, you have everything here to automate this without having to do it from Visual Studio.
Related
I have developed a WinForms application. Now I want to upgrade my application by adding new features and optimizing it. One way to do this is by just copying the project folder and making changes in that copied project folder. I want to know is this the proper way of version controlling in software development by just copying the project folder for every new version or are there some systematic methods available to manage all the versions of my application. I really want to learn about these things. Please guide me.
Azure DevOps (formerly Visual Studio Team Services, or VSTS for short) is a free* online Microsoft system which incorporates source control, a general overview of it can be found here. There are other systems but I'd highly recommend this as it ties in with Visual Studio nicely.
Specifics on two type of version control Azure DevOps supports are:
Team Foundation Version Control
Git
Git seems to be becoming the preferred system now, it's what Microsoft default to and my workplace has now moved to that setup.
Each system allows you to check-in or commit a code change that you make, keeps a history of these changes and enables you to roll-back to and view previous code.
Once you have learnt those basics start looking at branches/repos, when you start working alongside another developer on the same project I'd recommend doing some more reading to learn how to resolve merge conflicts and best practices to avoid them.
*It's free for up to five developers
I notice (beginner) that when I generate a new .net web app in Visual Studio, it collects required packages from the web. I believe I need to connected to the web in order to create an app. Is there an offline mode where it stores the files needed?
When you create a new project, Visual studio will download the require NuGet packages (=dependencies) from the internet.
Technically you can add a local NuGet repository (=on your hard drive) but do you really want to do that?!
I found this article describing how to achieve that src
I really like working with Azure functions in the portal but am starting to need some more tooling that I'm used to for committing to my git repo, easily adding assemblies, and just plain working in a more familiar environment.
Is it possible to create your Azure function app and possibly the functions themselves in the portal and then move over to Visual Studio and import that function app as a project? Or am I approaching this wrong? I understand we can create straight from Visual Studio and then publish up to Azure and maybe that is the way we should be doing it in the first place.
A few pieces you could do. You can start development in the portal and then download the app settings (connection strings, etc.) via the azure-function-core-tools with a CLI command like func azure functionapp fetch-app-settings <appName> - but that will just pull the settings into an existing local project.
You could also go to the Platform Settings tab and open the App Service Editor which would let you download the workspace as pictured below. That will download the function project into a folder you could check into source control and use with CI/CD.
However one important note is the portal for C# projects use C# script files (.csx), and the Visual Studio tools for Functions create .NET assemblies (.dll), so if using C# you wouldn't be able to download the workspace and open it up in Visual Studio - you'd likely be better off just copy/pasting the code into a Visual Studio project.
Personally since the latest v3 update of VS 2017 I find starting in Visual Studio is even more convenient than the portal was for Function apps.
I would like to use GIT as version control on a Visual Studio 2013 project. It does however require you to create a project with Visual Studio Online. Does this mean that a copy of my code will be stored somewhere, or is the purpose of creating this project only to be allow other users to be added so that you can collaborate?
You don't have to use Visual Studio Online to use code control in Visual Studio. You can create the .git and use an external tool (like command line or source safe), or you can use the internal tool.
I think that the Visual Studio community edition struggles to create a git repo without being bound to the Visual Studio Online, but once its created, it works fine with various http remotes (I have a project here which uses two remotes, one being VSO and one being our gitlab repo that we use).
Storing your code remotely (but secured) on one of the major sites can be a major benefit to you in the long run. It gets you into good habits of committing and pushing your source, even when you're working alone.
VSO is basically a cloud-based version of TFS - Microsoft's source control, build and task management system.
In order to use the system for source control purposes, you need to use the "Check In" functionality on the Solution in the VSO project before the cloud-based version is updated. The initial project in VSO will likely be empty.
You can use VSO for collaboration but you don't have to.
Ive got Umbraco 7 installed on my web server with the usual default skins and such and, what I want to do is create my own template(s) to use on the site ill be creating. Now Ive looked at all the documentation in Umbraco and all it really spends its time doing is talking about using an existing template code then adding CSS, Javascript and such. that's all well and good, but I want to use visual studio to develop this site/Application. the problem is that the Visual Studio template developed by Warren Buckley doesn't work on Visual Studio 2013 at all and there's no sign of him sorting this out it would seem...
What I want to do is develop the various templates I need, then add Bootstrap, develop custom menus, Forms for Credit card processing, emailing, etc (Not sure where you do this in Umbraco.. Macros perhaps?) then manage the content only in Umbraco. The developers of Umbraco don't seem to grasp the existence of Visual Studio or updating any documentation concerning Visual studio 2013 or Umbraco 7.
In short, All I bloody want to do is develop this Friggin thing in VS 2013, then manage content in Umbraco.. Umbraco is installed and running, VS 2013 sees the file content and can communicate with the web server perfectly..
Any help on this would be hot!!!!
You should consider using NuGet. Just create an empty project in Visual Studio, go to Nuget Package Manager Console and type
Install-Package UmbracoCms
Then it installs everything you need, and once it's done you run the application and it jumps straight into the setup. You can choose a custom setup where you choose DB options and starter kits and so forth.
And it definitely works in Visual Studio, I've done it plenty of times.
First off, I'd recommend buying one month of Umbraco TV and watching the Implementor and Developer track: http://umbraco.tv/
Generally, you can edit css, js, views, and partial views in Visual Studio. You will need to create Document Types in the back-office because they are in the database. That is, unless you want to use a code-first style package like Ditto: https://our.umbraco.org/projects/developer-tools/ditto.
Also, the Templates actually have a record in the database. So you must create them in the back-office if you need to connect them to DocumentTypes / Content. Or you could use code-first.