Micrsft Dynamics AX Using Micrsft Dynamics AX 2009 Versin Cntrl Integratin With Micrsft Team Fundatin Server White Paper This white paper describes hw t use the versin cntrl integratin capabilities f Micrsft Dynamics AX 2009 using Micrsft Team Fundatin Server. Date: July 02, 2009
Table f Cntents Intrductin... 3 The Develpment Envirnment... 4 Team Fundatin Server... 4 Versin Cntrl Administratin Server... 4 System Settings... 5 Develper Machines... 6 Versin Cntrl Parameters... 6 Security... 7 Team Server Security... 7 Team Fundatin Server Security... 7 Daily Wrk... 8 Object Life Cycle... 8 Add t Versin Cntrl... 8 Check Out... 9 Und Check-ut... 9 Check In... 9 Quality Checks... 9 Renaming Objects... 9 Deleting Objects... 9 Label Editr...10 Get Latest...10 Synchrnizatin...10 Synchrnizatin Lg... 10 Shw Histry...11 Pending Objects...11 Change List...11 Wrking Offline...11 Cde Prmtin... 12 Layer Prmtin... 12 Build Prcess... 13 Branching... 14 Primary TFS Prject...15 Prject Interactin...17 Labeling... 17 Labeling as Part f a Prxy Build...17 Surce Cde Reset... 18 Best Practices... 20 2
Intrductin The MrphX Integrated Develpment Envirnment (IDE) can integrate varius Versin Cntrl Systems (VCS). This white paper describes the fllwing: The develpment envirnment This sectin describes typical hardware and sftware tplgies and setups that yu use fr develpment under versin cntrl in the MrphX IDE in Micrsft Dynamics AX 2009. Security This sectin describes hw t implement security by cntrlling access t Team Server (the ID server) and prjects in TFS. Daily wrk This sectin describes the versin cntrl functinality that yu use daily when yu develp under versin cntrl. Fr example, checking an bject in and ut and using the histry f an bject t investigate changes r rll back t a previus versin f the bject. Cde prmtin This sectin describes the prcess f mving new r mdified bjects frm the develpment envirnment t the testing envirnment, and then t the prductin envirnment. Layer prmtin This sectin describes the prcess f replacing the entire layer Applicatin Object Data (AOD) file in the destinatin envirnment with the AOD file frm the surce envirnment. Build prcess This sectin describes the prcess f prmting cde that is in the versin cntrl system frm ne envirnment t anther using an XPO r AOD file. Branching This sectin describes hw yu can use branching fr remediatin and bug fixes in previusly released versins withut interrupting nging develpment activities. Labeling This sectin describes hw yu can use labeling t mark milestnes in the develpment lifecycle. Surce cde reset This sectin describes hw yu can, as a last resrt, reset yur surce cde. Best practices This sectin describes sme best practices t fllw while develping under versin cntrl in the MrphX IDE in Micrsft Dynamics AX 2009. 3
The Develpment Envirnment The develpment envirnment cnsists f a server with a TFS installatin, a versin cntrl administratin server, and varius lcal develpment machines. Fr mre infrmatin abut setting up these cmpnents, see http://g.micrsft.cm/fwlink/?linkid=152452. Team Fundatin Server The Team Fundatin Server shuld have: Micrsft SQL Server (lcal r remte) Micrsft Visual Studi Team Fundatin Server Micrsft Visual Studi Team Explrer The SQL Server installatin can be lcal r remte. Nte: If SQL Server 2008 is used, the Team Fundatin Server SP1 Integrated Installatin prcess must be fllwed. Fr mre infrmatin, see the Team Fundatin Installatin Guide fr Visual Studi Team System. Versin Cntrl Administratin Server The versin cntrl administratin server shuld have: Micrsft SQL Server (lcal r remte) Micrsft Dynamics AX 2009 Develper installatin (with AOS) Micrsft Dynamics AX 2009 Team Server Master repsitry flder Visual Studi Team Explrer The SQL Server installatin can be lcal r remte. Nte: If SQL Server 2008 is used, the Team Fundatin Server SP1 Integrated Installatin prcess must be fllwed. Fr mre infrmatin, see the Team Fundatin Installatin Guide fr Visual Studi Team System. 4
System Settings The glbal versin cntrl settings that are made by the Administratr are set n the System settings frm in Micrsft Dynamics AX. Use the System settings frm t specify the Team Server infrmatin and best practice settings. Befre yu cnfigure the glbal versin cntrl settings, yu must enable versin cntrl n the Versin cntrl parameters frm. Yu can specify the fllwing settings n the System settings frm. Setting Status line Micrsft SQL Server r Oracle Team Server name Team Server Database name Cmpiler warnings Cmpiler errrs Cmpiler t-ds Best practice errrs Run title case update Object rules Additinal subflders Test prject Descriptin The text entered fr the status line will appear as a captin at the bttm f the Micrsft Dynamics AX client. Specify the database type. Specify the name f the Team Server (ID server) yu set up. Specify the name f the ID server database yu set up. If set t Reject, the cde t check in cannt cntain cmpiler warnings. If set t Reject, the cde t check in cannt cntain cmpiler errrs. If set t Reject, the cde t check in cannt cntain t-d cmments. If set t Reject, the cde t check in cannt cntain best practice errrs. This setting des nt affect bjects that have best practice warnings r infrmatin. Fr mre infrmatin, see Best Practices fr Micrsft Dynamics AX Develpment in the prduct dcumentatin. If selected, the name f each bject is checked fr crrect casing. Applicatin bject names, such as methds r table fields, shuld begin with a lwercase letter. Incrrect casing is fixed. Fr mre infrmatin, see Naming Cnventins in the prduct dcumentatin. Object types r names can be prhibited in the Object rules tab. Fr mre infrmatin, see the prduct dcumentatin. Yu can select where new bjects are created by using the Additinal subflders tab. Mre than ne flder can be specified, and the develper will be prmpted t chse ne f the lcatins when a new bject is created. A descriptin shuld als be prvided fr each flder value. Specify the test prject t run when yu check in cde. 5
Develper Machines Each develper machine shuld have: Micrsft Dynamics AX 2009 Develper installatin (with AOS) Micrsft SQL Server (lcal r remte) Lcal repsitry flder Visual Studi Team Explrer (ptinal) The SQL Server installatin can be lcal r remte. Nte: Cnsider the flder yu chse fr the lcal repsitry flder. If a Team Explrer instance that runs against the surce cntrl server shares a lcal repsitry flder with a Micrsft Dynamics AX 2009 client and a change is checked in by using Team Explrer, the Micrsft Dynamics AX 2009 client will nt reflect thse changes when yu synchrnize the Micrsft Dynamics AX 2009 client unless yu select Frce when yu synchrnize. Installing Team Explrer n develper cmputers is ptinal. Each develper machine must have a cmplete lcal installatin f Micrsft Dynamics AX 2009, with the exceptin f SQL Server, which can be shared. If SQL Server is shared, each develper shuld have a separate Micrsft Dynamics AX database t avid cnflicts during develpment. Virtualizatin f the develpment envirnment is typical. Althugh it is nt a functinal requirement fr TFS, develpers shuld run a 3-tier thin client t implement ptimal client/server cde. Versin Cntrl Parameters Lcal versin cntrl settings are set by the administratr n the versin cntrl administratin server and by develpers n each develper machine. Yu can specify the fllwing settings n the Versin cntrl parameters frm. Setting Surce cntrl status Versin cntrl system Repsitry flder Clr checked-ut bjects in the AOT Warn when reverting bjects Team Fundatin Server URL Team Fundatin prject name Descriptin Set t Enable t wrk under versin cntrl. Set t Team Fundatin Server t use TFS fr versin cntrl. Specify the repsitry flder yu created. If selected, bjects will be blue in the AOT f the develper wh checks ut the bject. If selected, the develper will be warned befre bjects are reverted. Specify the TFS URL. The default prt is 8080. Fr example, http://fts:8080. Specify the prject yu created in TFS. 6
Security There are tw security aspects fr versin cntrl integratin with TFS: Access t Team Server (the ID server) Access t varius TFS prjects Team Server Security When Team Server (the ID server) is installed, yu create a new grup called Dynamics Team Server Users. Any cmputer that uses Team Server must be a member f this grup. T add develper machines t this grup, the administratr fllws these steps: 1. Click Start > Administrative tls > Cmputer management. 2. Expand Lcal Users and grups. 3. Click Grups, and then duble-click Dynamics Team Server Users. 4. Click Add t add a new member. 5. Click Object Types. 6. Select the Cmputers check bx, and then click OK. 7. Click Lcatins t change the lcatin (if needed). 8. Select a lcatin/dmain frm the list, and then click OK. 9. Type the bject/cmputer name fr each develper cmputer, click Check Names, and then click OK. Team Fundatin Server Security TFS has security related t the specific develpment prjects that are in the TFS envirnment. Each user must be granted access t the apprpriate prjects in TFS thrugh explicit permissins r thrugh membership in a grup that has sufficient permissins. T add develpers t this grup, the administratr fllws these steps: 1. Open Micrsft Visual Studi. 2. Frm the View menu, click Team Explrer. 3. Right-click the apprpriate prject and then click Team Prject Settings > Grup Membership. 4. Select the apprpriate grup and then click Prperties. 5. In the Add Member frame, select the Team Fundatin Server Grup r Windws User r Grup, and then click Add. 6. Add the users in the Select Users, Cmputers, r Grups windw. Separate each user name with a semicln. 7. Click OK twice. 7
Daily Wrk The typical versin cntrl tasks that yu perfrm are: Add bjects t versin cntrl Check ut bjects Check in bjects Rename bjects Delete bjects Wrk with labels Wrk with bject versins Wrk ffline Object Life Cycle The fllwing diagram demnstrates the life cycle f AOT bjects under versin cntrl. There are tw ways t create a new bject. 1. Create a new bject in the AOT in the usual way. 2. Overlayer an existing bject. Because bjects are stred per layer in TFS, verlayering an bject will effectively create a new bject. Add t Versin Cntrl After an bject has been created, it must be added t versin cntrl. The bject can then be checked ut by ther develpers fr develpment activities. T add an bject t versin cntrl, right-click the bject and then click Add t Versin Cntrl. After yu add an bject t versin cntrl, yu must check it in. 8
Check Out When versin cntrl is enabled, yu have read-nly access t AOT bjects. T edit an bject, yu must check it ut. Checking the bject ut will nt lck the bject, s ther develpers can als check ut the bject and edit it. Und Check-ut Yu can chse nt t check yur changes in t versin cntrl. If yu und check-ut, yur changes will be discarded and the bject will revert t the versin f the bject that is in the repsitry. Check In T persist the changes yu make t a checked-ut bject, yu must check the bject back in. When yu check an bject in, the Check in frm displays. All the bjects yu check in will be accepted r rejected. By default, the Check in frm will display all bjects yu have pen. Yu can remve bjects frm the list by pressing ALT+F9. When yu check in bjects, prvide a detailed descriptin f the wrk yu did in case yu later decide t revert t a particular versin f an bject. Quality Checks The cde yu check in must cmply with the quality checks that are set up by the administratr n the System settings frm. The available checks are: Cmpiler errrs Cmpiler warnings Cmplier t-ds Best practice errrs Renaming Objects After an bject has been added t versin cntrl, it can still be renamed. When an bject is renamed, a cpy f the bject is created with the new name and the bject with the ld name is deleted. T cmplete a deletin, the bject must be checked in. T check in an bject fr deletin, use the Pending bjects frm. Even thugh a new bject is created when yu rename an bject, the histry f the deleted bject is maintained. When yu rename an bject, yu must update all references t the bject. T update interdependencies between bjects, d as fllws: 1. In the AOT, right-click the bject yu have renamed and then click Add-Ins > Crss-reference > Used by. 2. Check ut all the bjects that are listed. 3. Update the references and then check in the bjects. Deleting Objects Yu can delete bjects that are under versin cntrl as yu wuld rdinarily delete an bject. The deletin will take effect when the bject is checked in. Use the Pending bjects frm t check in the bject. Yu can und a deletin befre yu check the bject in. 9
Label Editr Wrking with labels is similar t wrking with applicatin bjects. T change a label, yu must check ut the label file. T check ut the label file, d as fllws: 1. Click Micrsft Dynamics AX > Tls > Develpment tls > Label > Label editr. 2. Click Versin cntrl and then click Check ut. When yu have finished adding r editing labels, check the file back in. Label files allw multiple check-uts. When yu create a new label, Team Server (the ID server) allcates a new ID number while yu have the label file checked ut. This prevents a pssible cnflict in the label IDs if tw peple add labels at the same time. If the value f the label changes since yu last checked ut the label file and yu attempt t edit the same label, yur change will be rejected. The rejected changes are displayed in the Inflg. Yu can then check ut the label file again t reslve the cnflicts. T minimize the risk f cnflicts, the label file shuld be checked ut nly fr shrt perids f time. Get Latest T synchrnize a single applicatin bject t get the changes that ther develpers have made t an bject, use the Get latest cmmand. Yu cannt use this cmmand when yu have the bject checked ut. Synchrnizatin After yu create a lcal repsitry flder n yur develper machine, yu must synchrnize yur lcal repsitry flder with the bjects in the versin cntrl system t ppulate yur lcal repsitry. Later, yu can synchrnize yur lcal repsitry with the versin cntrl system t reflect changes made by ther develpers. T synchrnize all bjects, click Micrsft Dynamics AX > Tls > Develpment tls > Versin cntrl > Synchrnize. Synchrnizatin des nt affect new bjects that yu created r bjects that yu have checked ut. Cnsider the flder yu chse fr the lcal repsitry flder. If a Team Explrer instance that runs against the surce cntrl server shares a lcal repsitry flder with a Micrsft Dynamics AX 2009 client and a change is checked in by using Team Explrer, the Micrsft Dynamics AX 2009 client will nt reflect thse changes when yu synchrnize the Micrsft Dynamics AX client unless yu select Frce when yu synchrnize. Installing Team Explrer n develper cmputers is ptinal. If yu select Frce, all applicatin bjects will be synchrnized, even if they have nt changed. A frced synchrnizatin can take a lng time. Cnsider installing a new build as an alternative. If yur versin cntrl system is set up t include flders in additin t thse used fr the AOT and the label files, yu can chse which f these flders t synchrnize. This is dne n the Pick flders frm that pens after yu click OK n the Synchrnizatin frm. Synchrnizatin Lg TFS tracks bject versins n the client. When yu synchrnize, the latest versin is cpied frm TFS t yur lcal repsitry. Each file must be imprted int Micrsft Dynamics AX t be reflected in the AOT. A lg entry is created fr each file t validate that each file is imprted. If the synchrnizatin fails, use the Synchrnizatin Lg frm t select the paths f failed elements and then click Prcess. 10
Shw Histry Yu can view the histry f an bject. Yu can view the versin number, the actin perfrmed n the bject, the date and time f the actin, the user wh perfrmed the actin, the change number f the actin, and the check-in cmment. Yu can get mre histrical infrmatin by using the fllwing cmmands n the Histry frm. Cmmand Change list Cmpare Open new windw View file Descriptin Displays a list f ther bjects that were included in the check-in with the bject. Displays the Cmparisn frm that allws yu t perfrm a line-by-line cmparisn f tw versins f an bject. The Cmparisn frm lists all checked-in versins f an bject and all nrmal layer bject versins. Opens the AOT with the selected versin f the bject t investigate bject prperties. Opens an.xp file f the specified bject versin in Ntepad. Pending Objects Yu can view a list f bjects that are checked ut by using the Pending bjects frm. Yu can select bjects t check in r yu can discard the check-ut. Depending n the versin cntrl settings, ther develpers may be able t wrk cncurrently n the same bjects yu have pending. Frm the Pending bjects frm yu can als create a prject r imprt bjects. Change List Yu can track all check-ins perfrmed in TFS by using the Changes frm. Yu can view the change number, the date and time f the change, the user wh submitted the change, and check-in cmments. Yu can see the bjects that are included in a change by clicking the Cntents buttn. The initial change includes all AOT bjects. If yu click the Cntents buttn fr the first change, it will take a lng time t pen the Cntents frm. Wrking Offline Yu can still develp in Micrsft Dynamics AX when yu are nt cnnected t the versin cntrl server. Check ut the bjects yu want t mdify befre yu g ffline, and then check them in again when yu are recnnected. Yu cannt create bject IDs when yu are ffline. Yu must be cnnected t Team Server (the ID server) because it cntrls the allcatin f bject IDs. If yu need t create an bject that requires an bject ID, fllw these steps: 1. Create the new bject ffline. 2. Exprt the bject. 3. Cnnect t versin cntrl. 4. Delete the new bject. 5. Imprt the new bject (this will assign an bject ID). 6. Add the bject t versin cntrl and check it in. 11
Cde Prmtin Cde prmtin cnsists f deplying new r mdified bjects frm the develpment envirnment t the testing envirnment, and then t the prductin envirnment. This prcess varies based n the architecture f the versin cntrl envirnment and the versin cntrl system settings. Fr example, yu can utilize a single TFS prject envirnment r a multiple TFS prject envirnment. In a single TFS prject envirnment, a single TFS prject cntains all the cde t be deplyed t the testing and prductin envirnments. In a multiple TFS prject envirnment, multiple TFS prjects cntain all f the cde t be deplyed t the testing and prductin envirnments. Bth prcesses vary based n whether the system settings allw the check-in f bjects that cntain errrs r warnings. We recmmend that yu temprarily change these settings t be mre permissive prir t the build. Yu can then enable the settings again and check items ut and check them in t enfrce the best practice checks. Layer Prmtin Layer prmtin (r migratin) is a methd f deplying changes t anther envirnment. In layer prmtin, the entire layer Applicatin Object Data (AOD) file in the destinatin envirnment is replaced using the surce envirnment. Yu can nly use this methd if all mdificatins in the destinatin envirnment are included in the surce envirnment, and there is n in-prgress develpment activity in the surce envirnment. The fllwing steps demnstrate hw yu can deply changes t anther envirnment using layer prmtin. 1. Check users. 12 Make sure that n users are using the destinatin envirnment. 2. Stp AOS. Stp the Applicatin Object Server (AOS) service n the surce and destinatin envirnments. 3. Rename the AOD r label file. Rename the apprpriate AOD r label file in the destinatin envirnment. Fr example, change the axcus.ad file t axcus.ad.ld. 4. Cpy AOD r label file. Cpy the apprpriate AOD r label file frm the surce envirnment t the destinatin envirnment. 5. Delete AOI file. Delete the Applicatin Object Index (AOI) file frm the destinatin envirnment. 6. Restart AOS. Restart the Dynamics AX Object Server service n bth envirnments. Restarting the service n the destinatin envirnment may take several minutes because the AOI file must be rebuilt. 7. Synchrnize the database. Synchrnize the SQL bjects by using the Synchrnize Database prcess (Administratin > Peridic > SQL Administratin > Table Actins > Synchrnize Database). 8. Validate. Check the updated envirnment t make sure all bjects functin crrectly. 9. Recmpile. Optinally recmpile the applicatin if yu discvered issues when yu validated (Administratin > Peridic > Cmpile applicatin).
Build Prcess The build prcess varies with each deplyment based n the architecture f the versin cntrl envirnment, the versin cntrl system settings, and the invlved prjects. The fllwing serves as an example fr hw a build prcess can be implemented. Fr a typical build prcess, d as fllws: 1. Cnslidate cde. If a single Micrsft Dynamics AX prject is t be deplyed, skip this step. If the cde is cntained in a single TFS prject envirnment, the cde can be cnslidated t a single repsitry by synchrnizing the master build with the versin cntrl administratin server. If the cde is cntained in multiple TFS prjects, yu must create a master build f each TFS prject. Then create a master repsitry by cpying all the master builds int a single repsitry. Nte: Make sure that bjects that are in multiple repsitries are nt verwritten. Any duplicate bject issues must be reslved befre yu cntinue. 2. Create a single master.xp file. Create a single master.xp file frm the repsitries created in the previus step. If a single Micrsft Dynamics AX prject is t be deplyed, right-click the prject in the Prjects frm and click Exprt. The entire prject will be cnslidated int ne.xp file. If the cde is cntained in a single TFS prject envirnment, create a master.xp file. Right-click the rt nde f the AOT and then click Exprt. Specify the apprpriate layer in the Applicatin Object Layer field. If the cde is cntained in multiple TFS prjects, create a cnslidated master build. T create a cnslidated master build by using the CmbineXPO tl, d as fllws: 1. Create a directry called CmbineXPO. 2. Cpy the CmbineXPOs.exe tl t the CmbineXPO directry. Nte: The CmbineXPO tl can be fund at http://g.micrsft.cm/fwlink/?linkid=156593. 3. Cpy the repsitry layer flder (fr example, usr, cus, var) t the CmbineXPO directry. 4. Remve.xp files that are nt incuded in the build (ptinal). 5. Create a batch file named runme.bat. This will create a single.xp file based n the VCS layer file. 6. Add instructins t the batch file. Fr example, CmbineXPOs.exe cus MasterBuild.xp 7. Run the batch file. 8. Check users. Make sure that n users are using the destinatin envirnment. Optinally restart the AOS. 9. Deply the.xp file. Deply the.xp file t the destinatin envirnment by clicking the Imprt buttn. 10. Synchrnize the database. Synchrnize the SQL bjects by using the Synchrnize Database prcess (Administratin > Peridic > SQL Administratin > Table Actins > Synchrnize Database). 11. Validate. Check the updated envirnment t make sure all bjects were imprted and cmpiled. 13
12. Recmpile. Recmpile the applicatin if yu discvered issues when yu validated (Administratin > Peridic > Cmpile applicatin). Branching Branching enables cncurrent develpment within the Micrsft Dynamics AX 2009 envirnment and prvides a means f remediatin and bug fixes in previusly released versins withut interrupting nging develpment activities. This cncurrent develpment is accmplished by prviding each endeavr by a develper with a separate surce cde repsitry that cntains the specific items and versin that is needed t cmplete the effrt. Fr an example f hw yu can incrprate branching, see the Micrsft Dynamics AX 2009 Branch Supprt Plan using Team Fundatin Server that is included at the end f this white paper. Branching ccurs when a snapsht f cde is taken at a specific pint f the main, r baseline, prject. This baseline is usually represented by a label. The snapsht is knwn as the child branch, and the surce f the snapsht is called the parent branch. Merging is the prcess f cpying the surce cde t a separate TFS prject, r synchrnizing changes between tw separate prjects r branches. Merging takes place nly within TFS. Basic develpment practices can be applied in this envirnment. N develpment activities ccur directly n the main (baseline) branch. Changes that are made in develpment branches are merged int the main branch. There is n direct interactin between any ther branches. The main TFS prject is branched t create the develpment prject. Changes made in the develpment prject are merged int the main branch fr testing. The merge frm the develpment branch t the main branch can be autmated by using a script. If the merge is autmated, cnsider yur develpment practices and best practice settings. If the best practice settings are set t lw, yu may nt want t autmate merging because it is imprtant t keep the main branch functinal. The release branch is a cntingency branch that is used fr ht fix develpment fr released versins. This branch is created fr either remediatin r t address issues that arise in released versins. After the develpment activities are cmpleted n this branch, the changes are merged int the main branch, and then t the develpment branch. The labeling f releases is a prerequisite fr branching at a pint in time. Each branch must be deplyed t a stand-alne TFS prject t cntinue develpment activities within that branch. Changes t the child branch are synchrnized using a TFS prcess called merging. 14
Primary TFS Prject In sme cases, a primary prject is created t grup all develpment activities int a single TFS prject. This is ptinal and has n direct interactin with Micrsft Dynamics AX. The fllwing example shws a primary TFS prject fr develpment. In this case, all activity that is nt related t Micrsft Dynamics AX is stred in the primary TFS prject with child prjects fr each f the branches used fr Micrsft Dynamics AX develpment. The child prjects are required because the versin cntrl integratin des nt recgnize the layers that are used in the primary prject. The versin cntrl integratin requires definitin and layer flders immediately belw the prject level. This example illustrates the practice f creating separate prject branches. In this case, devteam1 represents develpers wrking in gegraphically r functinally separate areas. Each separate develpment branch requires a separate intermediate TFS prject and a separate develpment envirnment fr develpment activities. This cncept can als be used fr the release prject t allw fr remediatin and issue management in multiple versins f released cde. 15
If yu use a primary TFS prject, institute a best practice that requires all updates t be merged frm the intermediate TFS prjects t the primary TFS prject. D nt merge intermediate prjects with each ther. The fllwing diagram demnstrates the interactin between the primary and intermediate prjects in TFS. 16
Prject Interactin The cnfiguratin f the interactins is as fllws: Autmated script (mving cde between intermediate and primary TFS prjects) DAX DEV (DMODAX09) TFS DMO DEV Primary Prject Manual script (mving cde between intermediate and primary TFS prjects) TFS DEV DAX DEV DAX MAIN (Dynamics MAIN) TFS MAIN TFS MAIN DAX MAIN (Dynamics MAIN) Manual human interventin (mving cde between branches in the primary TFS prject) Labeling TFS DEV TFS MAIN TFS MAIN TFS DEV DAX REL TFS REL TFS REL DAX REL TFS MAIN TFS REL TFS REL TFS MAIN In TFS, labels are used t mark milestnes in the develpment lifecycle, particularly prduct releases. Labels are imprtant t release branching, where the main prject is branched at a pint in time fr remediatin r issue management. Labels can be applied t surce cde thrugh ne f the fllwing methds: Using the cmmand line utility Frm the TFS cntext menu Autmatically during the build prcess in TFS The TFS build prcess requires the installatin f the Team Fundatin build utility, which is typically installed n a separate machine. Yu can use the build utility t create a prxy build that will label all the surce cde in the prject based n parameters that are entered during the build prcess. These labels are stred in TFS and can be used fr subsequent branching. Fr mre infrmatin n labeling, see the Team Fundatin Server Administratin Guide. Labeling as Part f a Prxy Build Yu can use autmated labeling, bug tracking, and prject management functinality f TFS by creating a build that is generated by TFS. This build crrespnds t the build that is generated by the MrphX IDE. The TFS prxy build generates a build number and a crrespnding label fr the surces that match t the Micrsft Dynamics AX wrk. The label and build number can be used t manage wrk items, assciate bugs with builds, and merge cde like any ther prject using TFS. T create the prxy build, d as fllws: 1. Open Micrsft Visual Studi. 2. Create a new prject (File > New > Prject). 3. In the New Prject windw, select the Empty Prject template. Select the Create directry fr slutin and Add t Surce Cntrl check bxes. Name the prject and click OK. 17
The TFS prxy build is a Visual Studi prject with a single build target that des nthing. Yu can insert a custm batch file int this task t perfrm activities. Fr example, an empty Micrsft Visual Studi prject may lk like this: <?xml versin="1.0" encding="utf-8"?> <Prject TlsVersin="3.5" DefaultTargets="Build" xmlns="http://schemas.micrsft.cm/develper/msbuild/2003"> <PrpertyGrup Cnditin=" '$(Cnfiguratin) $(Platfrm)' == 'Debug AnyCPU' "> </PrpertyGrup> <PrpertyGrup Cnditin=" '$(Cnfiguratin) $(Platfrm)' == 'Release AnyCPU' "> </PrpertyGrup><Target Name="build"> <Message Text="This is an empty build task"/> <!--Insert any custm build scripts here <Exec Cmmand="myCustmBuild.cmd"></Exec> --> </Target> </Prject> Create a new TFS build definitin by using the steps utlined at http://g.micrsft.cm/fwlink/?linkid=152448. Yu can schedule the TFS build n an apprpriate interval. Assciate it with builds that are generated frm the MrphX IDE s that the label that is generated frm TFS matches the build yu are testing. Yu can als create labels using the Team Explrer user interface. Fr mre infrmatin, see the Team Fundatin dcumentatin. Surce Cde Reset As a last resrt, yu can reset yur cde. Resetting yur cde invlves rebuilding a release envirnment based n the current prductin envirnment, deleting dwnstream TFS data by using the TFS merge functin, and then refreshing the dwnstream data based n the rebuilt release envirnment. This is a lengthy prcess. The phases that fllw explain hw t d this and shuld be fllwed sequentially as given. Phase ne In Micrsft Dynamics AX, yu must first exprt develpment activity that is nt included in the prductin envirnment in preparatin fr the surce cde reset. D as fllws: 1. Make sure all cde is checked in. Make sure any cde that is nt under versin cntrl is exprted t.xp files. Yu can imprt that cde after the reset is cmplete. 2. Synchrnize the master develpment installatin. 3. Exprt the versin cntrl mdificatins that are nt in the current prductin envirnment t.xp files. 4. Perfrm the abve steps fr all ther prjects that are affected by the surce cde reset. 18
Phase tw Delete all data in the release r ht fix prject. This serves as a starting pint. Cascade and delete activities t the ther affected prjects and branches. D as fllws: 1. Stp autmated update scripts that affect the prjects and branches that are invlved in the reset. 2. Select the prject that will serve as the starting pint fr the reset and delete all TFS data belw the flders that are designated as merge flders. In a TFS prject that is assciated with Micrsft Dynamics AX, the layer flders are usually the merge flders. Delete the cntents f these flders. Fr example, cus r usr. 3. Use the TFS merge functinality t merge the delete activity t all ther prjects and branches that will be affected by the reset. The merge relatinships between the prjects r branches shuld be set up prir t the reset. 4. Nte: Merge the delete activity. D nt delete the data in each prject. Deleting the data in prjects and branches will destry the relatins between the bjects. 5. Repeat the activity merge fr each prject and branch that is affected by the reset. Phase three Reset the surce prject t the state f the current prductin envirnment and merge the repsitry t all related prjects and branches. D as fllws: 1. Stp the Dynamics AX Object Server service fr the surce prject envirnment. 2. Cpy the layer flder (fr example, cus) frm yur lcal repsitry t the Temp directry. Delete the layer flder in yur lcal repsitry. 3. Delete the axapd.ai index file frm the develpment database flder. This flder is usually lcated at Prgram Files\Micrsft Dynamics AX\50\Applicatin\Appl. Rename the layer AOD files. Fr example, axcus.ad and axusr.ad. 4. Make sure all users are lgged ut f the prductin envirnment. 5. Stp the Dynamics AX Object Server service n the prductin envirnment. 6. Cpy the layer AOD files frm the prductin envirnment t the surce prject envirnment. 7. Open Micrsft Dynamics AX in the surce prject envirnment in the layer that cntains the mdificatins. 8. Create a new VCS repsitry. Click Micrsft Dynamics AX > Tls > Develpment tls > Versin cntrl > Setup > Create repsitry. The Create repsitry cmmand adds all bjects in the current layer t the VCS and checks in the activity. 9. Use the TFS merge functinality t merge the delete activity t all ther prjects and branches that will be affected by the reset. The merge relatinships between the prjects r branches shuld be set up prir t the reset. Nte: Merge the delete activity. D nt delete the data in each prject. Deleting the data in prjects and branches will destry the relatins between the bjects. 10. Synchrnize the master develpment installatin and imprt all mdificatins that yu exprted in phase ne. 11. Repeat the activity merge fr each prject and branch that is affected by the reset. 19
Phase fur Clear each develper installatin and synchrnize each develper installatin t the respective master develpment installatin. D as fllws: 1. Stp the Dynamics AX Object Server service n each develper installatin. 2. Cpy the layer flders frm yur lcal repsitry t the Temp directry. Delete the layer flders in yur lcal repsitry. 3. Delete the axapd.ai index file frm the develpment database flder. This flder is usually lcated at Prgram Files\Micrsft Dynamics AX\50\Applicatin\Appl. Rename the axcus.ad file. 4. Restart the AOS in the develpment installatin. 5. Open Micrsft Dynamics AX and check the AOT t ensure that there are n custmizatins in the cus layer. 6. Click Micrsft Dynamics AX > Tls > Develpment tls > Versin cntrl > Synchrnize. Select the Frce ptin. 7. Imprt.xp files that are nt under versin cntrl. 8. Verify that all bjects were included, and repeat fr each develper installatin. Best Practices Sme recmmended best practices are as fllws: TFS merge relatinships and paths shuld be defined in advance. Always begin merge activities at an endpint in the path. If a primary prject is used, merge activities shuld always begin in an intermediate prject and flw thrugh the primary prject t all remaining prjects and branches. A viable MrphX prject structure shuld be established fr each implementatin. This is imprtant t restre incmplete wrk if a TFS reset is required. Sme ptins include: One prject that cntains all f the bjects and mdificatins fr a prject r phase. One prject fr each planned mdificatin. The prject structure mimics the AOT structure. One master prject where each mdificatin is a subprject. The subprject structure mimics the AOT structure. Rules shuld be established fr the check-in f in-prcess mdificatin activities. The TFS SQL databases shuld be included in a SQL Server maintenance plan and in the netwrk backup plan. Include Reprt Server and WSS databases in the backup plan. Full and transactin lg backups are required because many f the TFS databases use a full recvery mdel. A data recvery prcess fr TFS data shuld be established. The Micrsft Dynamics AX 2009 Team Server database shuld be included in a database maintenance plan. Security shuld be practively managed. If Team Explrer is installed n each develper installatin, develpers shuld nly have access t the TFS prject they use. Only administratrs shuld have access t all TFS prjects. 20
21
Micrsft Dynamics is a line f integrated, adaptable business management slutins that enables yu and yur peple t make business decisins with greater cnfidence. Micrsft Dynamics wrks like and with familiar Micrsft sftware, autmating and streamlining financial, custmer relatinship and supply chain prcesses in a way that helps yu drive business success. U.S. and Canada Tll Free 1-888-477-7989 Wrldwide +1-701-281-6500 www.micrsft.cm/dynamics The infrmatin cntained in this dcument represents the current view f Micrsft Crpratin n the issues discussed as f the date f publicatin. Because Micrsft must respnd t changing market cnditins, this dcument shuld nt be interpreted t be a cmmitment n the part f Micrsft, and Micrsft cannt guarantee the accuracy f any infrmatin presented after the date f publicatin. This dcument is fr infrmatinal purpses nly. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT. Cmplying with all applicable cpyright laws is the respnsibility f the user. Withut limiting the rights under cpyright, n part f this dcument may be reprduced, stred in r intrduced int a retrieval system, r transmitted in any frm r by any means (electrnic, mechanical, phtcpying, recrding, r therwise), r fr any purpse, withut the express written permissin f Micrsft Crpratin. Micrsft may have patents, patent applicatins, trademarks, cpyrights, r ther intellectual prperty rights cvering subject matter in this dcument. Except as expressly prvided in any written license agreement frm Micrsft, the furnishing f this dcument des nt give yu any license t these patents, trademarks, cpyrights, r ther intellectual prperty. 2009 Micrsft Crpratin. All rights reserved. Micrsft, the Micrsft Dynamics Lg, FRx, Micrsft Dynamics, SharePint, SQL Server, Team Server, Visual Basic, Visual Studi, Windws, and Windws Server are either registered trademarks r trademarks f Micrsft Crpratin, FRx Sftware Crpratin, r Micrsft Business Slutins ApS in the United States and/r ther cuntries. Micrsft Business Slutins ApS and FRx Sftware Crpratin are subsidiaries f Micrsft Crpratin. 22