我正在嘗試爲我的Azure SQL數據庫安裝VSTS發佈管理。我正在使用「部署Azure SQL DACPAC」任務。 dacpac文件的路徑設置爲VSTS:部署Azure SQL DACPAC發佈管理引發錯誤
$(System.DefaultWorkingDirectory)\**\*.dacpac
雖然數據庫正確更新,但最終導致任務失敗。
"System.Management.Automation.ParentContainsErrorRecordException: *** Could not deploy package"
它看起來像所有的更新都應用到數據庫,但任務仍然會引發錯誤。登錄以下
2016-07-07T07:50:44.6118522Z Publishing to database 'mydb' on server 'myserver.database.windows.net'.
2016-07-07T07:50:45.7587428Z Initializing deployment (Start)
2016-07-07T07:50:52.5825349Z Initializing deployment (Complete)
2016-07-07T07:50:52.5835341Z Analyzing deployment plan (Start)
2016-07-07T07:50:52.7085342Z Analyzing deployment plan (Complete)
2016-07-07T07:50:52.7085342Z Updating database (Start)
2016-07-07T07:50:53.7000358Z Altering [dbo].[usp_Products_List]...
2016-07-07T07:50:53.7170379Z Creating [dbo].[usp_Products_GetById]...
2016-07-07T07:50:53.8745919Z An error occurred while the batch was being executed.
2016-07-07T07:50:53.8855912Z Updating database (Failed)
2016-07-07T07:50:53.9105905Z ##[debug]System.Management.Automation.RemoteException: *** Could not deploy package.
2016-07-07T07:50:53.9225921Z ##[debug][Azure RDFE Call] Deleting firewall rule 260745ad-327c-45ae-bcb8-5c6bb0e43797 on azure database server: myserver
2016-07-07T07:50:55.9753040Z ##[debug][Azure RDFE Call] Firewall rule 260745ad-327c-45ae-bcb8-5c6bb0e43797 deleted on azure database server: myserver
2016-07-07T07:50:55.9934761Z ##[error]System.Management.Automation.ParentContainsErrorRecordException: *** Could not deploy package.
存儲過程代碼
CREATE PROCEDURE [dbo].[usp_Products_GetById]
@pId int
AS
SET NOCOUNT ON;
SELECT [id]
,[description]
,[created_dt]
,[last_mod_dt]
,[active]
FROM [dbo].[Products]
WHERE [id] = @pId
GO
將其更改爲接受的答案。就像我在回答中所說的,我首先使用了FQDN。但腳本錯誤可能是第一種情況下啓動錯誤的原因。 – BeesNees