Currently working on an ASP.Net MVC 4 application using Entity Framework 5. Used CodeFirst for initial development phase. But have now disabled the Automatic Migrations and
Try the reseeding with trigger approach. I believe this should solve it example of its use and see more walkarounds at that link.
USE [TEST]
CREATE TABLE TEST(ID INT IDENTITY(1,1),VAL VARCHAR(10))
CREATE TRIGGER TGR_TEST_IDENTITY ON TEST
FOR INSERT
AS
DECLARE @RESEEDVAL INT
SELECT @RESEEDVAL = MAX(ID) FROM TEST
DBCC CHECKIDENT('TEST', RESEED, @RESEEDVAL)
INSERT INTO TEST(VAL)VALUES('a')
SELECT * FROM TEST
Since 'DBCC CHECKIDENT' is not supported in Azure now you can use the approach in this link In that link i got some work arounds
and then turning back on identity again when i am through with the insertion with the right key using
set identity_insert XXXTable off --this basically turns on IDENTITY
Note: this is not a good solution for a table that is receiving a massive insert request but might be useful for someone looking for a temporary way out