Quantcast
Channel: codetails
Viewing all 97 articles
Browse latest View live

Event: Windows 10 Dev Readiness Webcasts

$
0
0
Coming soon is a series of live webcasts that deliver first-hand guidance on how you can leverage the new Windows 10 development model. The webcasts will be presented and moderated by Microsoft MVPs around the world at no charge and are a great opportunity for you to not only learn the foundations of Universal App Development [...]

Resolve – TF255050: A connection cannot be made to the Report Server WMI provider

$
0
0
When setting up reporting services in a remote server for TFS below error might occur. ******************************************************************************************************* TF255050: A connection cannot be made to the Report Server WMI provider. Verify the following: 1. You have entered the correct name for the server, including the instance name. 2. The Windows Management Instrumentation service is running on tfsssrs. [...]

Resolve – TF400069: You must install either SQL Server Analysis Services version 11.0 …

$
0
0
Setting up TFS AT (Application Tier) and DT (Data Tier) in separate machines (not a single server installation) might raise below error in Analysis Services configuration for TFS. ******************************************************************************************************* TF400069: You must install either SQL Server Analysis Services version 11.0 or the SQL Server Client Tools on the application tier to ensure that the Analysis [...]

Fixing Warning – TF255119: The Windows Service Control Manager could not be contacted on

$
0
0
TFS setup in distributed topology might give ht below warning in configuration readiness checks. ******************************************************************************************************* TF255119: The Windows Service Control Manager could not be contacted on <sqlserver>. The following service cannot be verified as installed, running, and set to start automatically: SQL Server Analysis Services. Manually verify that the service is functioning correctly. *******************************************************************************************************

5 steps to targeting multiple .NET frameworks

$
0
0
When designing an API or libraries, we aim to have maximum coverage of available .NET frameworks so that we can have maximum number of clients adopt our APIs.  The key challenge in such scenarios is to have a clean code and an efficient way to manage multiple versions of code, Nuget packages and builds. This article [...]

Resolve – TF250049 and TF250067

$
0
0
Setting up SharePoint extensions for TFS in a remote server might cause below error. ******************************************************************************************************* TF250049: The following URL for Team Foundation Server could not be verified: <TFSUrl>. The following error was received: TF250067: No connection could be made to Team Foundation Server at the following address: <TFSUrl>. Either the specified URL does not point [...]

Tech Nibbles 05 Jul, 2015

$
0
0
Welcome to Codetails! Our worth read list for 05 Jul, 2015 has 31 articles that are a must for developers, designers and architects who are working on Microsoft Technologies. Free ebook: Microsoft Azure Essentials: Azure Web Apps for Developers Download all formats (PDF, Mobi and ePub) at the Microsoft Virtual Academy. Below you’ll find the ebook’s [...]

Passing Parameters to PS/DSC Scripts in vNext Release Templates – VS Release Management

$
0
0

In the vNext Release Templates there are few ways to pass parameters/configuration variables to a PS/DSC Script. Variables in five different levels can be used for this.

Global Variables – Defined at the Release Management Server level in Administration – > Settings – > Configuration Variables.

001

Server Variables – Defined at the Registered Target Server level in Configure Paths –> Servers –> Server –> Configuration Variables. The values defined in Server Variables will override the values of the variables defined in Global Variables.

002

Component Variables – Defined at the Release Component level in Configure Apps –> Components –> Component –> Configuration Variables. The values defined in Component Variables will override the values of the variables defined in Global and Server Variables.

003

Action Variables – Defined in the Release Template, Deploy Using PS/DSC action in Configure Apps –> vNext Release Templates –> vNext Release Template –> Deploy Using PS/DSC. The values defined in Action Variables will override the values of the variables defined in Global, Server and Component Variables.

004

All above four levels of Configuration Variables are supported with encrypted value by selecting the type Encrypted.

2.2

image

These variables can be managed in the release template using Configuration Variables and Resource Variables.

image

image

Variables in Configuration Script File  – These variables will be defined in a configuration script file and should be available with the build output. These files will allow to source control configuration variables for each stage. There is no encryption for the variables defined in a script file. The values defined in Script File Variables will override the values of the variables defined in Global, Server,  Component and Action Variables.

7

Passing Action Variables

To pass the Customer Name to the below script Action Variable can be used.

1

This script should be available in build output.

4

Component Should be setup to download the script to target server.

2

In the Deploy Using PS/DSC action the configuration variable CustomerName can be set like below.

3

When release triggered the scripts get downloaded to target server.

5

The value passed for CustomerName can be verified in the log.

6

Passing Component Variables

When component variable is only set it is getting passed to the script.

13

14

Action Variable Value Overriding Component Variable Value

When both Component and Action variable values set action variable value gets the precedence.

15

16

Setting Variables Using Script File

Configuration Variables can be set using a Script File as well.

7

This configuration variable script file should be available in build output.

10

When release triggered configuration variable script file is also copied to the target server.

11

Release PS/DSC script uses the configuration variable value defined in the configuration script file.

12

Script File Values Overriding Action and Component Variable Values

When value is defined for configuration variable in Component, Action and in a Configuration File the Configuration File get the precedence.

17

18


TFS on Azure – 01. Setup Virtual Network for AD in Azure

$
0
0

Prerequisite of setting up an AD (Active Directory) in Azure is to setup a virtual network.  Step by step guide is below.

In Azure Management Portal go to Networks and click on Create a Virtual Network.

01

Provide a name for the Virtual Network and select the closest region.

02

Keep the DNS Server and VPN Connectivity empty for the time being since after setting up AD in and DNS server this can be configured later.

03

Set 256/24 for Classless Inter-Domain Routing (CIDR). More information on CIDR can be found in below links.

http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing

http://searchnetworking.techtarget.com/definition/CIDR

http://compnetworking.about.com/od/workingwithipaddresses/a/cidr_notation.htm

04

Once the final step of wizard submitted, the Virtual Network creation starts.

05

In few minutes Virtual Network is ready for use.

06

Event: Windows 10 Dev Readiness Webcasts

$
0
0

Coming soon is a series of live webcasts that deliver first-hand guidance on how you can leverage the new Windows 10 development model. The webcasts will be presented and moderated by Microsoft MVPs around the world at no charge and are a great opportunity for you to not only learn the foundations of Universal App Development in Windows 10, but also to connect with some of the top experts in your country and/or language. Bring your Windows Store app development questions and have them answered live, by the experts, and learn how to take advantage of the great opportunities ahead in the Universal Windows Platform.

  • Each webcast will deliver the same content in different countries from June 8 – 12.
  • They will last from one to three hours, depending on the amount of community interaction.

 

View the agenda and register for these free webcasts at: http://ln.ganshani.com/win10mvp2015

I’m also glad to have some of my SEA MVP friends Walter Wong and Tim Chew present a session on Universal Windows Platform.

 

Resolve – TF255050: A connection cannot be made to the Report Server WMI provider

$
0
0

When setting up reporting services in a remote server for TFS below error might occur.

*******************************************************************************************************

TF255050: A connection cannot be made to the Report Server WMI provider. Verify the following:

1. You have entered the correct name for the server, including the instance name.

2. The Windows Management Instrumentation service is running on tfsssrs.

3. The service is not blocked by Windows Firewall.

4. You have the required permissions to connect.

Details:

The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

*******************************************************************************************************

01

Verify reporting services running and all ports as specified in the “Ports required for installation of Team Foundation Server” are open.

02

03

04

05

WMI Service is running in report server.

05.2

WMI Service is allowed in Firewall of the report server.

06

Report server URLs populated after all above set.

7

 

Tech Nibbles 11 Jul, 2015

$
0
0

Welcome to Codetails!

Our Tech Nibbles list for 11 Jul, 2015 has 8 articles that are a must read for developers, designers and architects who are working on Microsoft Technologies or are passionate about Microsoft.

  • Build native iOS, Android and Mac apps in C#
    Mobile development skills are in demand, and Xamarin for Students gives you an edge over the competition. With Xamarin for Students, you can build native iOS, Android, and Windows apps with Xamarin Studio and Visual Studio, for free.
    More: http://xamarin.com/student
  • Visual Studio 2015 – Analyzing Architecture with Code Maps in Visual Studio 2015
    Our starting point was the Roslyn solution opened in Visual Studio, and already built. To get there, we cloned the Git repository from https://github.com/dotnet/roslyn, using the Git cloning experience on the Connect tab of the Team Explorer window of Visual Studio, and then opened the RoslynLight.
    Blair McGlashan More: https://msdn.microsoft.com/en-us/magazine/mt238403.aspx

Thanks,
Codetails Team

PS:  You can also follow us on our Facebook Page for regular updates

Send Custom Build Notes with TFS Build Using PowerShell

$
0
0

One of the teams, required a customized build note including only Bug, User Story work items listed with few details. The default alert email of the TFS 2013 only send an email in below format which does not say which is the type of the work item associated with the build. It just said “work item <id>” for any work item and team was not happy about that.

image

Very interesting solution provided here with PS scripts by MIKAEL DEURELL.

Few issues were there in the sample script provided in MIKAEL DEURELL‘s article the team who requested this specific build note is not happy about.

1. Since it depends on the date of the last good build to get the associated work items for current build, it is not possible to queue a build for a previous changeset to make it the last good build and another with latest changeset will not send the associated work items correctly.

2. It sends all the work items and the team only wanted user story and bug WITs.

3. If a task work item associated it does not send the parent work item.

4. Team wanted the note to be formatted in a more readable format.

To overcome these issues the enhanced version of the sample script provided in MIKAEL DEURELL‘s article  is below.

[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Client")  
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Common")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Build.Client")  
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Build.Common")  
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.VersionControl.Client")  
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.VersionControl.Client.VersionSpec")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.WorkItemTracking.Client")  

$tfsCollectionUrl = "http://tfsserver:8080/tfs/projectcollection"
$server = new-object Microsoft.TeamFoundation.Client.TfsTeamProjectCollection(New-Object Uri($tfsCollectionUrl))
$buildServer = $server.GetService([Microsoft.TeamFoundation.Build.Client.IBuildServer])
$buildDetail = $buildServer.QueryBuilds("teamprojectname", "builddefinitionname") | where { $_.BuildDefinition.LastGoodBuildUri -eq $_.Uri } #| select BuildNumber

$buildDetail.BuildNumber | Out-File "$PSScriptRoottmpBuildNumber.txt"

$versionControlServer = $server.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer])
$workItemStore = $server.GetService([Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore])
$LinkingService = $server.GetService([Microsoft.TeamFoundation.Client.TswaClientHyperlinkService])

$lastGoodBuildStartTime = $buildDetail.StartTime
$changesetVersionSpec = New-Object Microsoft.TeamFoundation.VersionControl.Client.ChangesetVersionSpec($buildDetail.SourceGetVersion.Substring(1)) 
$latest = [Microsoft.TeamFoundation.VersionControl.Client.VersionSpec]::Latest
$recursionType = [Microsoft.TeamFoundation.VersionControl.Client.RecursionType]::Full
$historySinceLastGoodBuild = $versionControlServer.QueryHistory("$/Orca/Main", $latest, 0, $recursionType, $null, $changesetVersionSpec, $latest,[Int32]::MaxValue, $true, $false)

$historySinceLastGoodBuild.Length | Out-File "$PSScriptRoottmpHistoryCount.txt"

$workItemsSinceLastGoodBuild = $historySinceLastGoodBuild | foreach-object {$_.workitems}

$workItemsSinceLastGoodBuild.Length | Out-File "$PSScriptRoottmpWorkItemCount.txt"

$tabName = "WorkItemTable"

#Create Table object
$WorkItemTable = New-Object system.Data.DataTable $tabName

#Define Columns
$colWorkItemType1 = New-Object system.Data.DataColumn WorkItemType,([string])
$colId = New-Object system.Data.DataColumn Id,([int])
$colTitle = New-Object system.Data.DataColumn Title,([string])
$colState = New-Object system.Data.DataColumn State,([string])
$colAssignedTo = New-Object system.Data.DataColumn AssignedTo,([string])
$colWILink = New-Object system.Data.DataColumn WILink,([string])

#Add the Columns
$WorkItemTable.columns.add($colWorkItemType1)
$WorkItemTable.columns.add($colId)
$WorkItemTable.columns.add($colTitle)
$WorkItemTable.columns.add($colState)
$WorkItemTable.columns.add($colAssignedTo)
$WorkItemTable.columns.add($colWILink)

$workItemsSinceLastGoodBuild |
foreach-object { 
    if ($_.Type.Name -eq "Task") 
    {
        # Get parent work item of task
        foreach($link in $_.WorkItemLinks)
        {
             if ($link.LinkTypeEnd.Name -eq "Parent")
             {
                $ParentWorkItem = $workItemStore.GetWorkItem($link.TargetId)

                #Create a row
                $row = $WorkItemTable.NewRow()

                #Enter data in the row
                $row.WorkItemType = $ParentWorkItem.Type.Name
                $row.Id =  $ParentWorkItem.Id
                $row.Title =  $ParentWorkItem.Title
                $row.State =  $ParentWorkItem.State
                $row.AssignedTo =  $ParentWorkItem.Fields["Assigned To"].Value
                $row.WILink = $LinkingService.GetArtifactViewerUrl($ParentWorkItem.Uri).AbsoluteUri

                #Add the row to the table
                $WorkItemTable.Rows.Add($row)

                break
             }
        }
    }
    else 
    {
        # Adding associated work item other than task

        #Create a row
        $row = $WorkItemTable.NewRow()

        #Enter data in the row
        $row.WorkItemType = $_.Type.Name
        $row.Id =  $_.Id
        $row.Title =  $_.Title
        $row.State =  $_.State
        $row.AssignedTo =  $_.Fields["Assigned To"].Value
        $row.WILink = $LinkingService.GetArtifactViewerUrl($_.Uri).AbsoluteUri

        #Add the row to the table
        $WorkItemTable.Rows.Add($row)

    }

}

$WorkItemTable.Rows.Count | Out-File "$PSScriptRoottmpWorkItemTableCount.txt"

$style = "<style>BODY{font-family: Arial; font-size: 10pt;}"
$style = $style + "TABLE{border: 1px solid black; border-collapse: collapse;}"
$style = $style + "TH{border: 1px solid black; background: #dddddd; padding: 5px; }"
$style = $style + "TD{border: 1px solid black; padding: 5px; }"
$style = $style + "</style>"


$messageBody = $WorkItemTable |sort WorkItemType,Id -Unique | Select-Object WorkItemType, Id, State, Title, AssignedTo, WILink | ConvertTo-HTML -head $style | Out-String

$Recipients = @("user1@yourOrg.com", "user2@yourOrg.com", "user3@yourOrg.com")

Send-MailMessage -From "tfs@yourorg.com" -To $Recipients -SmtpServer "YourSMTPServer" -Body $messageBody -Subject "$Env:TF_BUILD_BUILDNUMBER Build Notes" -BodyAsHtml

One more enhancement could be made to the script to generate the note in pre build and send it in post build. That is by changing the below script segment to write to a temp file in pre build.

$messageBody = $WorkItemTable |sort WorkItemType,Id -Unique | Select-Object WorkItemType, Id, State, Title, AssignedTo, WILink | ConvertTo-HTML -head $style | Out-String

$Recipients = @("user1@yourOrg.com", "user2@yourOrg.com", "user3@yourOrg.com")

Send-MailMessage -From "tfs@yourorg.com" -To $Recipients -SmtpServer "Ad-ex2003.domainx.local" -Body $messageBody -Subject "$Env:TF_BUILD_BUILDNUMBER Build Notes" -BodyAsHtml

Above can be changes as shown below so that it writes to a temp file in pre build.

1
$WorkItemTable |sort WorkItemType,Id -Unique | Select-Object WorkItemType, Id, State, Title, AssignedTo, WILink | ConvertTo-HTML -head $style | Out-File "$PSScriptRoot..tmpBuildNote.txt"

In post build the temp file content can be read like shown below and send the email.

$messageBody = Get-Content "$PSScriptRoot..tmpBuildNote.txt" | Out-String

$Recipients = @("user1@yourOrg.com", "user2@yourOrg.com", "user3@yourOrg.com")

Send-MailMessage -From "tfs@yourorg.com" -To $Recipients -SmtpServer "yourSMTPserver" -Body $messageBody -Subject "$Env:TF_BUILD_BUILDNUMBER Build Notes" -BodyAsHtml

The build scripts should be checked in to TFS as shown below.

image

If there is multiple script then a run script can be used to call other scripts. For example pre build run script for above shown picture is below.

Invoke-Expression "$PSScriptRootGenerateBuildNotes.ps1"
Invoke-Expression "$PSScriptRootApplyVersionToAssemblies.ps1"

TFS build definition can be set to call the pre build and post build scripts.

image

With this build note as shown below can be obtained.

image

Tech Nibbles 19 Jul, 2015

$
0
0

Welcome to Codetails!

Our Tech Nibbles list for 19 Jul, 2015 has 11 articles that are a must read for developers, designers and architects who are working on Microsoft Technologies or are passionate about Microsoft.

  • Hangfire
    An easy way to perform fire-and-forget, delayed and recurring tasks inside ASP.NET applications. No Windows Service required. Backed by persistent storages. Open and free for commercial use.
    More: http://hangfire.io/
  • Visual Builder of React JS
    This tool is a visual builder of React JS components for your web application. In builder you can easily combine available components with each other, and see how they look and feel right on a web page.
    More: https://www.npmjs.com/package/react-ui-builder

Thanks,
Codetails Team

PS:  You can also follow us on our Facebook Page for regular updates

Tech Nibbles 26 Jul, 2015

$
0
0

Welcome to Codetails!

Our Tech Nibbles list for 26 Jul, 2015 has 13 articles that are a must read for developers, designers and architects who are working on Microsoft Technologies or are passionate about Microsoft.

  • Build Your Own Messaging App in XAML
    One of the most popular features of Xamarin.Forms is the ability to use your existing XAML experience to build UIs for iOS, Android and Windows Phone. Moments, a Snapchat clone built with Xamarin.Forms and Microsoft Azure, originally made use of the C# API for creating user interfaces.
    Pierce Boggan More: https://blog.xamarin.com/build-your-own-messaging-app-in-xaml/
  • VexFlow
    The score below was rendered in your browser. If you’re a programmer interested in rendering music notation in your own applications, take a look at The VexFlow Tutorial.
    More: http://www.vexflow.com/
  • Edit this webpage with your voice
    Commands you can speak Element selection Select the (element) Ex: “select the header” Ex: “select the footer” Select the largest image Select the text (text) Ex: “select the text GET INFORMATION” Ex: “select the text WITH YOUR VOICE” Select its parent Select its first child Select its last child
    More: https://shaungallagher.github.io/say_restyle/
  • ReSharper 9.1.2 for Visual Studio 2015 RTM
    Visual Studio 2015 and .NET Framework 4.6 were both released to market yesterday. Kudos to Microsoft for making this finally happen. We thought we would come up with a quick guide to help you sort out what to expect from ReSharper integration into the final RTM build of Visual Studio 2015.
    Jura Gorohovsky More: http://blog.jetbrains.com/dotnet/2015/07/21/resharper-9-1-2-for-visual-studio-2015-rtm/
  • Same Day Xamarin Support for Visual Studio 2015
    Today, Microsoft is unveiling the final release of Visual Studio 2015 in a global webcast, and we are joining the celebration! Now Released to Market (RTM) for full use in production, Visual Studio 2015 includes many new features and improvements that make it easier to build apps quickly, includin
    Miguel de Icaza More: https://blog.xamarin.com/same-day-xamarin-support-for-visual-studio-2015/
  • NCover 5.1 Beta Program
    When we originally released NCover 5 last year, we were excited to share a lot of great new features including Condition Coverage and even more ways to share coverage results across the organization.
    More: http://www.ncover.com/blog/ncover-5-1-beta-program/
  • CSS Gradients: A Syntax Crash Course
    In the past most websites used images heavily to create a fancy UI. Thanks to various CSS properties this trend has changed. This tutorial will help you to learn about CSS gradients.You can use gradients to replace images in various UI elements as well as in backgrounds.
    Baljeet Rathi More: http://www.sitepoint.com/css-gradients-a-syntax-crash-course/

Thanks,
Codetails Team

PS:  You can also follow us on our Facebook Page for regular updates


Deploy Azure DB via Web App – Using VS 2013 Release Management – Part 2 – Setup RM Component and Template to Deploy

$
0
0

In the Part 1 of this post, creating a web deployment package with dacpac, is explained. To deploy the dacpac to Azure DB via web deployment package, a Release Management template should be setup. The same component created in article “How to Deploy to Azure Websites with TFS build 2013 and VS Release Management 2013”, can be enhanced to deploy the database, using the dacpac file in web deployment package.

21

22

In the Configuration Variables tab the newly added token __DemoAzureDBCon__ (adding the token in publish profile explained in Part 1) is set as a variable.

23

Next step is setting up an Azure DB. To do this create an SQL database in Azure management portal.

24

Select Create a new Azure DB server, to create a new DB server for Azure DB. Make sure to select Allow Azure services to access server option.

25

Database created in Azure with above options.

26

A web app in Azure is created to deploy the web application.

27

28

32

Copy the connection string (ADO.Net connection string) from the database connection strings and add it in the created web app settings, as a SQL Database connection.

28.1

Make sure to update the correct password to the connection string (Copied one has {your_password_here}).

Server=tcp:ch-demodbsvr01.database.windows.net,1433;Database=DemoAzureDB1;User ID=ch-dbsvradmin@ch-demodbsvr01;Password={your_password_here};Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;

28.2

In the Web App download the publish profile.

29

From the publish profile copy the values and set the parameters in the Release Management template.

30

  • WebAppName = Package zip file name (Package created with TFS build in Part 1).
  • PublishUrl = Publish Profile –> PublishUrl.
  • PublishUser = Publish Profile –> userName
  • PublishPassword = Publish Profile –> userPWD
  • AzureWebAppName = Publish Profile –> msdeploySite
  • DemoAzureDBCon = Publish Profile –> SQLServerDBConnectionString

31

With this template a release can be triggered using the build (Part 1).

33

Web Application gets deployed.

34

image

Database deployed with Web App.

35

Created Azure DB can be viewed in SQL Object Explorer in VS.

36

Allow the IP if prompt.

37

38

39

Deploy Azure DB via Web App – Using VS 2013 Release Management – Part 1 – Package SQL dacpac with Web Deploy Package in TFS Build

$
0
0

As explained in the post “How to Deploy to Azure Websites with TFS build 2013 and VS Release Management 2013” a tool can be created in VS 2013 Release management to deploy web sites to Azure. Below are the steps to deploy a azure database with the web application, using the same tool (enhanced to handle database deployments).

In the solution taken for as example a Web application project and a Database project created.

1

For demo purpose one table added to the database and created in localdb (db server provided with Visual Studio).

2

3

4

5

6

This database is added to the Web Application project by defining a connection string in the web.config file.

7

In the publish profile (for details on creating a publish profile for the web application refer the article here) database connection should be defined as a token understandable by the VS 2013 Release Management (__ as prefix and suffix).

8

Once this is published the required deployment packages created.

9

But the .dacpac file to deploy the db is not added to the web package zip file. It is required to get .dacpac inside the web package to deploy it with web application deployment.

10

In order to get the .dacpac file to web package change the publish profile (pubxml) content as shown below.

Current

11

Changes highlighted.

  • DB Connection object group enabled.
  • Default created “DbDacFx” object type is disabled.
  • Added new “DbDacFx” with dacpacAction Deploy and path set to relative path of the .dacpac file being built for the SQL project. Note that bin\debug path is set here which is not going to work with TFS builds.

12

Then there should be a project dependency added to build the SQL project before the web application project to make sure the availability of .dacpac file.

16

With the above change when the web application is published as a web deploy package, the .dacpac file gets included in it.

13

The next step is to get this packaged via TFS builds. As explained in the article here TFS build can be setup for this purpose with build arguments specified below.

/p:CreatePackageOnPublish=true /p:DeployOnBuild=true;PublishProfile=”TFSAzureRelease”

14

As expected FS build fails with error, unable to find .dacpac file.

15

By changing the publish profile relative path to .dacpac file as below as will give a successful build.

17

18

Web deployment package in the drop now contains the .dacpac file.

20

Set parameter xml is created with the tokens added for DB connection.

19

In Part 2 let’s look at how to enhance the release management component, to deploy web application package (explained in article here), with the database .dacpac file to Azure DB.

Tech Nibbles 02 Aug, 2015

$
0
0

Welcome to Codetails!

Our Tech Nibbles list for 02 Aug, 2015 has 11 articles that are a must read for developers, designers and architects who are working on Microsoft Technologies or are passionate about Microsoft.

  • Microsoft Edge vs. Google Chrome: Which web browser is faster?
    Windows 10 comes with a brand new web browser called Microsoft Edge. It’s got a lighter design, it’s blazing fast and Cortana is baked right into it. Edge washes away everything we hated about Internet Explorer, but how does it compare to Google Chrome, the world’s most-used web browser?
    Raymond Wong More: http://mashable.com/2015/07/29/microsoft-edge-vs-google-chrome/
  • ECMAScript 2015 Goodies – Part 2 – const
    This is the second article in ECMAScript 2015 Goodies. In the first article, we have covered new keyword in the language – let, which allows us to define a true block level variable in the program. In this short article, we will cover another new keyword – const.
    More: http://prasadhonrao.com/ecmascript-2015-goodies-part-2-const/
  • Getting Started with Windows 10
    I’ve been making Windows 10 videos at night to help out friends and family, and because it’s fun. Windows 10 comes out July 29th, and it takes what was familiar about Windows 7 and what was great about Windows 8 and takes it forward.
    Scott Hanselman More: http://www.hanselman.com/blog/GettingStartedWithWindows10.aspx
  • Windows 10. GMUNK. ODESZA.
    What happens when you combine one of the world’s hottest conceptual visual artists (Bradley G. Munkowitz aka GMUNK) with the amazing music duo Odesza, and throw in some blasting lasers, smoke machines and falling crystal dust? Turn up your speakers and watch. Created at Microsoft by Swodniw. To se
    More: http://www.youtube.com/watch

Thanks,
Codetails Team

PS:  You can also follow us on our Facebook Page for regular updates

Restart Services with Dependant Services – Using PowerShell to Create RM Component

$
0
0

In release management there is a tool available to restart a service. This works fine as long as there is no other service depending on the service being restarted. If there is any dependant service this action throws an error.

1

image

Investigation in WWW revealed using a PowerShell to do this is not that easy. Few important links on this is here.

https://support.software.dell.com/appassure/kb/128574

https://social.technet.microsoft.com/Forums/scriptcenter/en-US/574d175f-c370-4bd5-9bf1-c5e400362dfa/powershell-script-to-restart-a-service-and-its-dependents-and-their-dependents?forum=ITCG&prof=required

http://www.blogmynog.com/2010/06/22/powershell-script-to-restart-service-and-dependents/

Each solution in above link had some sort of an issue. Some did not work if there is dependency in another dependant service. Some solution not have the correct order of stop start sequence.  Some does not start only the services that were running earlier.

Out of above

https://social.technet.microsoft.com/Forums/scriptcenter/en-US/574d175f-c370-4bd5-9bf1-c5e400362dfa/powershell-script-to-restart-a-service-and-its-dependents-and-their-dependents?forum=ITCG&prof=required

the question (by Scott W. Sander) itself had a great code segment. A little bit of enhancement to that script made below powershell script which is perfectly working.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Param (
[Parameter(Mandatory=$true)] [String]$ServiceName
)

[System.Collections.ArrayList]$ServicesToRestart = @()

function Custom-GetDependServices ($ServiceInput)
{
 #Write-Host "Name of `$ServiceInput: $($ServiceInput.Name)"
 #Write-Host "Number of dependents: $($ServiceInput.DependentServices.Count)"
 If ($ServiceInput.DependentServices.Count -gt 0)
 {
  ForEach ($DepService in $ServiceInput.DependentServices)
  {
   #Write-Host "Dependent of $($ServiceInput.Name): $($Service.Name)"
   If ($DepService.Status -eq "Running")
   {
    #Write-Host "$($DepService.Name) is running."
    $CurrentService = Get-Service -Name $DepService.Name
    
                # get dependancies of running service
    Custom-GetDependServices $CurrentService                
   }
   Else
   {
    Write-Host "$($DepService.Name) is stopped. No Need to stop or start or check dependancies."
   }
   
  }
 }
    Write-Host "Service to Stop $($ServiceInput.Name)"
    if ($ServicesToRestart.Contains($ServiceInput.Name) -eq $false)
    {
        Write-Host "Adding service to stop $($ServiceInput.Name)"
        $ServicesToRestart.Add($ServiceInput.Name)
    }
}

# Get the main service
$Service = Get-Service -Name $ServiceName

# Get dependancies and stop order
Custom-GetDependServices -ServiceInput $Service


Write-Host "-------------------------------------------"
Write-Host "Stopping Services"
Write-Host "-------------------------------------------"
foreach($ServiceToStop in $ServicesToRestart)
{
    Write-Host "Stop Service $ServiceToStop"
    Stop-Service $ServiceToStop -Verbose #-Force
}
Write-Host "-------------------------------------------"
Write-Host "Starting Services"
Write-Host "-------------------------------------------"
# Reverse stop order to get start order
$ServicesToRestart.Reverse()

foreach($ServiceToRestart in $ServicesToRestart)
{
    Write-Host "Start Service $ServiceToRestart"
    Start-Service $ServiceToRestart -Verbose
}
Write-Host "-------------------------------------------"
Write-Host "Restart of services completed"
Write-Host "-------------------------------------------"

image

To create a reusable Release Management tool setup as shown below.

2
A component using the tool can be created.

3

The component available for release template.

4

When used with Release template it manages to stop dependant services first and stop the requested service. Then restart the requested service and the dependant services.

5

image

image

Tech Nibbles 16 Aug, 2015

$
0
0

Welcome to Codetails!

Our Tech Nibbles list for 16 Aug, 2015 has 10 articles that are a must read for developers, designers and architects who are working on Microsoft Technologies or are passionate about Microsoft.

  • The PowerShell Conference 2015, Asia
    Join us for the first PowerShell Conference Asia held in Singapore bought to you by SAPIEN technologies. during this two day event, powershell speakers from asia and around the world will come together to bring attendees two days of great in depth powershell content.
    More: http://PowerShell.asia
  • Visual Studio On-Demand Videos “The Big List”
    One of my jobs as a Product Manager for Visual Studio is to enable product team Program Managers and developers to create videos of their new product features, and we’ve been very successful in creating hundreds of these on-demand videos over on Channel 9.
    Dmitry Lyalin More: http://www.lyalin.com/2015/08/14/visual-studio-on-demand-videos-the-big-list/
  • DevOpsDays Singapore 2015
    DevOpsDays is a 2-day unconference that will be held in Singapore on October 16th and 17th, 2015. This conference, which is now happening frequently around the globe, is the conference for bridging the gap between development and operations.
    More: https://ti.to/devopsdays-singapore/2015/en
  • Microservices in C# Part 3: Queue Pool Sizing
    This tutorial expands on the previous tutorial, focusing on the Queue Pool concept. By way of quick refresher, a Queue Pool is a feature of the Daishi.AMQP library that allows AMQP Queues to be shared among clients in a concurrent capacity, such that each Queue will have 0…1 consumers only.
    Paul Mooney More: http://insidethecpu.com/2015/08/14/microservices-in-c-part-3-queue-pool-sizing/

Thanks,
Codetails Team

PS:  You can also follow us on our Facebook Page for regular updates

Viewing all 97 articles
Browse latest View live




Latest Images