Deploy Sql Database Project to Azure with appveyor failure - azure

I have the next error when I deploy a Sql Database Project with Appveyor to Azure:
Error publishing database: Could not deploy package. Unable to connect to master or target server 'ods'. You must have a user with the same password in master or target server 'ods
So, in this article Can't deploy Sql Database Project to Azure recommend add to Azure SQL Firewalls all the ip address allowed for Appveyor, but I still received the same error , what other thing may cause this issue?

I hope you have created your Azure SQL Database logical server as explained here, please use the "Server Admin Login" credentials on your connection string. It seems Appveyor requires access to the master database and the Server Admin Login has all required permissions.

Related

Azure DeploymentGroup access

I'm trying to register my Deployment group in windows server but I'm getting below error
TF400813: Resource not available for anonymous access. Client authentication required.
but I have admin access in server.
Assuming you are using Azure DevOps Server. Please check if the 'Team Foundation Background Job Agent service' is running or not. Besides, you can try to deploy the agent with a PAT, then clean caches on your client machine and try it again to check if that works.

Microsoft Integration Runtime Configuration Manager Failed to connect to the database. Error message: Bad JSON escape sequence:

I have successfully configured Self-Hosted Integration Runtime in Azure Data Factory on Azure Portal as well as Self-Hosted IR Node on my local machine and linked service connects successfully to my local sql server from Azure Portal
but when I test connection within IR connection manager on my local machine to connect to local sql server it gives me this error
can anyone help
The problem is Server name with single back slash. I copied Server name from ssms which uses
R\SQLEXPRESS
but then i checked the connection string that Self-Hosted on Azure is using to connect to on premise SQL Server it uses double back slashes
R\\SQLEXPRESS
and after changing to double back slash it works
You could refer to my working steps as below.
1.Follow this guide Create Self IR on the portal.
2.Get the Auth Key to start the ADF IR local management.
3.Fill the sql server name and database name in the Diagnostics Tag.

local database will not deploy to Azure

I am new to Azure & have searched everywhere but here for help. I have a local MVC 5 app w/ simple database. I am using VS 2015 Community w/ all updates.
Problem: Using visual studio, my web app works perfectly in Azure, BUT my local database will not deploy. The db works perfect locally, but when I deploy, only the web app shows up...the database is not there in Azure. I get a generic message saying "There was an error processing your request". I have tried creating the db in Azure and connecting w/ no luck. Everything but the database deploys. Any suggestions are appreciated. Thanks, everybody.
Jeff
You do not deploy the database in Azure. Instead, you create a database in Azure, and then, under deployment, you point your app's connectionstring to that instead.

How to connect to azure SQL from TeamCity on azure VM for publishing

I'm learning how to configure TeamCity right now.
My TeamCity runs on Azure VM. My SQL DB is on Azure SQL.
I have solution with web project and SQL project. I've created publish config in SQL project for publishing to Azure SQL. From Visual Studio on my PC I can publish DB project with this publish config to Azure SQL.
From Teamcity on Azure VM I can publish Web project from solution to my Azure Web App. But when I try to publish the SQL project to Azure SQL from TeamCity I get following error:
*** Could not deploy package.
Unable to connect to target server.
Process exited with code 1
Step Command Line failed
The current IP of my Azure VM is set in Azure SQL firewall config.
The command line build step is such:
"<Path to sqlpackage.exe>\sqlpackage.exe"
/Action:Publish
/SourceFile:<path to generated dacpac in previous build step>\<db proj name>.dacpac
/Profile:<path to publish config>\azureSql.publish.xml
UPDATE:
Here is the content of publish config:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<IncludeCompositeObjects>True</IncludeCompositeObjects>
<TargetDatabaseName>MyDbName</TargetDatabaseName>
<DeployScriptFileName>MyDbName.Database.sql</DeployScriptFileName>
<TargetConnectionString>Data Source=tcp:<myuser>.database.windows.net,1433;Persist Security Info=True;User ID=<user name>;Pooling=False</TargetConnectionString>
<ScriptDatabaseOptions>True</ScriptDatabaseOptions>
<BlockOnPossibleDataLoss>False</BlockOnPossibleDataLoss>
<ProfileVersionNumber>1</ProfileVersionNumber>
</PropertyGroup>
</Project>
You can have this error because of tons of reasons. Can you check this for me:
You are able to connect to SQL Azure DB from Azure VM (using command line tool, management studio, etc).
You configured your deploy script correctly. Try to run the same command from local machine.
Generally, if you need to connect to SQL Azure from Azure DC, you need just to allow "azure services" to access your database. Check this one also.
My guesses ordered by relevancy:
Firewall (both TC and Azure Sql server)
Connection info:
myuser.database.windows.net should be dbname instead
You need to tell sqlproj to keep password as part of config
it`s better to keep the password outside of source code. Read it as part of integration server build process from secure storage and refer to sqlpackage docs to learn how to specify the target connection string.
If items above do not help use /Quiet:False option to get more details on failure.

TFSPreview.com and Azure certificates not playing well at deployment

So I setup TFS continuous deployment and I'm running into a situation where my build compiles just alright but fails in the deployment phase when communicating with Azure. My log looks like
Get Default Azure Cloud Service Publish Profile
Set Project to build CSPack
Run MSBuild for Project
Run Visual Studio Test Runner for Test Sources
Publish Output
Deploy application to Azure
8/23/2012 7:20:04 AM - Preparing deployment for rcfoapi with SubscriptionID: mysubscriptionidhere.veryverylong.andkeepsgoing...
8/23/2012 7:20:04 AM - Connecting...
An attempted http request against URI https://management.core.windows.net:8443/mysubscriptionidhere.veryverylong.andkeepsgoing
/services/hostedservices/myrolenamehere?embed-detail=true
returned an error: (403) Forbidden.
Additional Exception Information:
Error Code: AuthenticationFailed
Message: The server failed to authenticate the request. Verify that the
certificate is valid and is associated with this subscription.
Typically, a response of (403) Forbidden from a Windows Azure
Management API means that the X509 certificate used to
authenticate the call is not valid. The certificate may have
been revoked or expired. Reconnect your Windows Azure
subscription to your Team Foundation account.
I tried the 'Disconnect from TFS' link in the Azure portal, then verified that the certificate in the 'certificates' section of the Azure portal. I confirmed using the fingerprint hash that the same certificate is also in my local computers' certificate store ('my' store). Then I relinked TFS back via the Azure portal.
But I still get the same error. Any idea?
Update:
I also tried a few additional steps, nothing seems to be working :(
Deleted the entire cloud service
Created a new cloud service (with same name)
VS2012 deployed to the cloud service on both production and staging (because I need to service operational for front use and back testing)
Verified the Windows Azure Tools certificate in the portal's cloud service 'certificate' section (which matches my local copy). I understand this will be different from the one between TFS and Azure
Went to TFSPreview.com => top left gear => project administration => services => no linked services seen
Went to user profiles => connections => OAuth connection listed (MANAGE-PROD CLOUDAPP by Windows Azure) => removed it
Within the Azure portal, linked the newly setup cloud service back to TFSPreview.com
Locally in VS2012, disconnected TFS ('team' => 'disconnect')
Locally in VS2012, logged out of TFS ('team' => 'connect' => 'sign out' at the bottom)
Signed back into TFS, connected to the team project
Made a trivial change => check in => triggered continuous deploy
=> Same error as before :?
Thanks
TFS Preview is not using the same cert you have on your local dev box. When you connect the accounts Azure gives TFS a different cert and it is possible that is the one that has expired or is no longer there. If you have multiple projects connected to Azure the only option is to go into the admin site on TFSPreview (the gear in the upper right) and disconnect all projects that are connected to that subscription and then rerun the connection wizard. This will ensure we get a new valid certificate for your azure subscription. When you reconnect the subscription to the project we will find the existing build definitions and not create new ones.
I had the same issue and for me the solution was to renew the certificate. See here: http://support.microsoft.com/kb/2780289
This can happen if your certificate needs to be renewed in the Azure control panel.
It can also happen if you don't have a staging or production environment deployed first. I'm not entirely sure why since it deploys a new one, but this fixed the issue for me just now.

Resources