Diego's great opportunity came with the appointment of Raimond of Burgundy as Count of Galicia. Raimond (or Raymond) it may be recalled, was married to Alfonso's only legitimate daughter, Urraca, and Diego was a great Francophile. Supposedly on the recommendation of the cathedral community, Diego Gelmirez' name was put forward for the post of Chancellor. This would have been sometime between 1087 and 1093. Diego would most likely have been in his twenties - an important role for such a young man, but our hero, as we have seen, was both capable and ambitious. And, like all succesful men, he knew how to develop good connections.
In the Historia Compostelana, Diego Gelmirez is described variously at this time as the Count's scribe or notary. His service to the Count no doubt broadened his experience and he travelled with him extensively, at one point accompanying his patron on campaign to the battle lines against the Moors during which he only just managed to escape with his life. Diego was very good at getting out of scrapes.
One real advantage to this role was that those who served prominent members of the royal family were often rewarded with ecclestical preferment and it wasn't long before Diego's potential was recognised. Raimond appointed him administrator of the "Temporalities" or assets of the Church of Santiago. No-one could have fitted the post better.