Tag Archives: powershell

How to find out the latest ARM api version for given resource type?

If you’d like to find this out, for instance, for Service Fabric applications, then use this query: ((Get-AzureRmResourceProvider -ProviderNamespace Microsoft.ServiceFabric).ResourceTypes | where { $_.ResourceTypeName -eq “clusters/applications” }).ApiVersions which would yield this result: 2017-07-01-preview2016-09-012016-03-01 what means that you now can go … Continue reading

Posted in Programming | Tagged , , | Leave a comment

How to deploy Service Fabric application using ARM template and PowerShell, part 2: ARM

This is a series of blog posts: Part 1: PowerShell Part 2: ARM To publish an ARM template using whichever mechanism you’d like, first you need the actual ARM template. Here’s an example of an application consisting of one stateless … Continue reading

Posted in Programming | Tagged , , | 19 Comments

How to package Service Fabric application into SFPKG in .NET Core using MSBuild task

This task wouldn’t require much efforts but: Service Fabric doesn’t support packaging its “package” (which is not a real package but just a directory) into .sfpkg out-of-the-box. Only suggests to use ZipFile.CreateFromDirectory. MSBuildTasks doesn’t support .NET Core so we can’t … Continue reading

Posted in Programming | Tagged , , | Leave a comment

How to deploy Service Fabric application using ARM template and PowerShell, part 1: PowerShell

This is a series of blog posts: Part 1: PowerShell Part 2: ARM Prerequisites: You have your cluster up and running. How to achieve that is outside of the scope of this series Cluster has all necessary certificates deployed (such … Continue reading

Posted in Programming | Tagged , , | Leave a comment

How to remove ARM resources for Service Fabric application and service using PowerShell

First you need to remove the resource corresponding to the application itself: And then the resource corresponding to the service:

Posted in Programming | Tagged , , | Leave a comment

How to call LINQ extension methods such as Where and ToDictionary using PowerShell

If you have IEnumerable<XElement> and want to call various LINQ extension methods such as Enumerable.Where() or ​​Enumerable.ToDictionary() on it using PowerShell then first load the necessary assemblies: And here’s the code for Where(): and for ToDctionary():

Posted in Programming | Tagged , | Leave a comment

The BuildLayout of the application is invalid. Code is missing for service

If you’re getting these very rare but still mysterious errors: Started executing script ‘Deploy-FabricApplication.ps1’. Test-ServiceFabricApplicationPackage : The BuildLayout of the application in c:\Temp\TestApplicationPackage_3811564851592\icw0q1rk.bus\Release is invalid. Code is missing for service MyWebApiPkg. or Register-ServiceFabricApplicationType : The BuildLayout of the application in … Continue reading

Posted in Programming | Tagged , | Leave a comment

How to deploy Azure Data Factory pipeline and its dependencies programatically using PowerShell

Since ADF doesn’t provide a built-in way for automated deployment, in order to do this you have to write a custom script. Then you can run it on build server such as VSTS or TeamCity. If you’re in the interactive … Continue reading

Posted in Programming | Tagged , | 44 Comments

How to install PowerShell using PowerShell

This cmdlet is tricky to find in Google because searching for install powershell using powershell won’t give you much. So here it is: Install-WindowsFeature PowerShell or Install-WindowsFeature PowerShell-V2 P.S. How to find exact name of particual Windows Feature to install? … Continue reading

Posted in Infrastructure | Tagged | Leave a comment

How to start using recently uploaded Azure disk

After you uploaded a vhd and before you can start really using it you must mark it as a data disk or as an OS disk using the following command: Add-AzureDisk -DiskName ‘myvhd.vhd’ -MediaLocation http://example.blob.core.windows.net/container/myvhd.vhd -OS Windows

Posted in Infrastructure | Tagged , | Leave a comment