Install an MSI into Azure Service Fabric node - azure

How can I install a MSI into service fabric remotely or after a deployment? I have an install I need on each node in the cluster. Using Remote Desktop and running the MSI is not an option. I need something that scales. Any thoughts?

You could take a look at Desired State Configuration (DSC) there is an extension which you can use within your ARM template, it is a big topic so here is a couple of links that might help get you started.
vmss with dsc
installing msi with dsc

I figured out how to do this using the SetupEntryPoint and ExeHost in the ServiceManifest.xml file. See the documentation here Documentation to SetupEntryPoint

Related

Azure DevOps (VSTS) - using Azure Az PowerShell on a Hosted Agent

We use Azure DevOps with a hosted VS2017 build agent. We would like to use the the new Az PowerShell module. However, the VS2017 hosted build agent has AzureRM installed on it. The documentation states You should not install Az side-by-side with AzureRM. Remove all AzureRM modules before installing Az. and this indeed is necessary because the two conflict. There is also no Az PowerShell build task.
So the question is, how do I use the Azure Az PowerShell module from an Azure DevOps hosted VS2017 build agent?
I suppose the answer is - you dont (for the time being). Because you wont have permissions to remove the azure powershell module. Ok, apparently you can do that.
Another way to make it work, use a docker container as a build agent (inside hosted agent). That can have Az module, obviously.
They cannot be installed side by side, however one can be installed in PowerShell (non core), and the other in PowerShell Core.
From the comments in the docs you specified:
Question: The document says not to install the modules side-by-side but is there any reason that we cannot run AzureRM in PowerShell 5.1 and AZ in PowerShell Core on the same machine?
Answer: No, no reason at all. In fact we are thinking of suggesting this as an advanced scenario for those with a substantial investment in AzureRM scripts

How to create startup tasks (or install dependencies) in Azure Web App?

There is a Cloud Service in Azure classic deployment model. In the Cloud Service you can add web role and set up a startup tasks. If your application has any dependencies that require installation on the destination VM or controll over IIS-related settings, you can use a startup tasks to provide an unattended deployment for this configuration. For example, if you need installed software on the backend side, you can run MSI in startup task to install it.
Unfortunately, I can't find this functionality in new Azure Resource Manager model. My Web App need some installed software on backend side, but I can't figure out how to install it. Could you help me with this?
You can't. Web App (or App Service) doesn't give you control over the underlying OS. You should consider containerizing your app and run it through using e. g. ACI or AKS.
A Cloud Service was nothing more than a VM with extended support in Visual Studio. Cloud Services are deprecated but you can still create a VM in Azure and install your dependencies.

How to roll out latest .net framework on Azure VM?

I created a Azure VM (windows sever 2016) using azure portal. It has .net 4.6.2 installed on it. Now I want to roll out latest available .net framework (4.7/ 4.7.1) on it. One option is to download required framework and install it on the VM. I am sure there should be some other better way to roll out .net framework on Azure VMs using Azure portal or ARM template. Please help me with the option available for the same.
Like the other answer says, you could use Azure Powershell DSC extensión, but there other ways to achieve that.
Usually you dont want the latest versión of the specific app\framework. You want the versión you've tested your app\code against (so its pretty static). You could créate a VM, install all the stuff you need and capture it. You will get an image and from that image you can deploy copies of the VM. That process can be automated with packer (so you dont have to build\recapture manually when\if you want to update something).
Another options is using Azure VM Script Extensión, which is a lot easier than diving into Powershell DSC.
Also, sometimes you could find an image in the gallery that corresponds to your needs (but I doubt that it is the case this time).
There is not currently a way in the Azure portal to deploy/upgrade .NET Framework in a VM. If this was something you were going to be doing a bunch I think you should use PowerShell Desired State Configuration (to install/update .NET Framework) in an Azure Resource Manager (ARM Template). This is a good walk through for what that process would look like.
If you use Run Command from the Azure Portal to run Start-Process you can get it to run a script from storage to install .net framework.

Azure service fabric create package command line

I've seen is possible to push Azure Service Fabric applications using PowerShell, but for this the package of the application is a pre-requisite, and in all tutorials I can only create it through visual studio.
Is there any way to create the package from command-line?
I plan to create my package on the build server.
The basic answer for command line is this:
msbuild Application.sfproj /t:Package /p:Configuration=[Debug|Release]
The article on setting up continuous integration that Raphael posted goes into more detail about how to set this up in a VSTS build definition.
Well, we have a good guide here:
https://azure.microsoft.com/en-us/documentation/articles/service-fabric-set-up-continuous-integration/#create-your-build-definition

Install an exe in azure virtual machine created in resource manager portal

I am new to azure RM model.Please help me to copy and install an exe in VM created in resource manager portal using powershell script or using API. Thanks in advance.
If you want to do the install the EXE remotely then the VM needs to be configured to allow for remote management - you can do this via WinRM. See: https://www.penflip.com/powershellorg/secrets-of-powershell-remoting/blob/master/accessing-remote-computers.txt and http://tarkus.me/post/64761019099/windows-azure-vms-remote-management
Setting this up is non-trivial (you need to ensure it's secure). You could also try adding an VM extension to the VM that will do the copy. Since the VM is already provision I think the only option here would be to use DSC though I've never added a DSC extension to a VM post-provisioning, it should work. That would require authoring and staging a DSC script in addition to adding the extension but definitely less complex than enabling remote management.
Simplest by far is as Gaurav suggested and log on to the VM and copy from there.

Resources