b34r
b34r

Reputation: 599

Build Number in SQL Azure

I have an Azure web service and accompanying sql-azure db that both need to expose a version number. The service is straight forward: update the assemblyinfo to generate based on revision & build, and just expose that.

How can I do something similar in the db? I had toyed with an auto-incremented number, but that increments the 'version' even if I deploy the same bits twice and does not guarantee continuity across servers with the same bits. And, because it's sql-azure, I don't believe I can pull the value from assemblyinfo, can I?

If I can expose the same build number the service shows, that'd be great, but it's not required.

Upvotes: 1

Views: 337

Answers (1)

Vyas Bharghava
Vyas Bharghava

Reputation: 6510

  1. Have a Version table in the database
  2. Use a custom MSBuild Task to get the build number
  3. You can update a sql file with the 'MERGE' with build number using FileUpdate MSBuild community task
  4. Execute it as part of deployment.

Now, you'll have same version number in both database & your assemblies.

Upvotes: 1

Related Questions