Sql-server – Google Cloud with SQL Server Express – add database permissions

google-cloud-platformgoogle-cloud-sqlsql server

I've recently setup a google cloud server for the first time and I installed the asp.net framework which is marketed as "Windows dev stack featuring IIS, SQL Express and ASP.NET". I'm familiar with SQL Server, c# asp.net and would like my first project done with these technologies for simplicity.

I manually installed sql server data tools, I can jump on the RDP and log into the localhost sql server via SSMS but my windows account does not have permissions to add a new database or create a user who does have permissions. I can see the sa user in there but do not know the password.

How can I add a sql server database into the local sql server express?

Best Answer

Using Developers Console, you can check the sa username's password in two different places :

  • under Compute Engine > VM instances, click on your deployed ASP.NET instance and look for c2d-property-saPassword value under Custom metadata.

  • under Deployment Manager > Deployments , click on your deployment. In right pane look for SQL Server Express Administrator and Initial SQL Express Administrator password values.

Using PowerShell command line from inside of your deployed ASP.NET Windows instance, you can run this one-line command to get the sa initial password:

Invoke-RestMethod http://metadata.google.internal/computeMetadata/v1/instance/attributes/c2d-property-saPassword -Headers @{"Metadata-Flavor"="Google"}

Related Topic