Jump to content
dschrenker

Azure Installation

Recommended Posts

Has anyone installed PasswordState on the Microsoft Azure Cloud?

 

I am currently looking at looking at using a Windows Server VM front-end and the Azure SQL Database for our implementation. It looks like this should be possible I just wanted to know if someone has done it. 

 

Thanks.

Share this post


Link to post
Share on other sites

Hi dschrenker,

 

Yes, we believe some of our customers have done this themselves, although we have not tested it ourselves - we had to make a small change a few builds ago, to allow the creation of the Passwordstate database to work, as it wasn't previously working in Azure.

 

Regards

Click Studios

Share this post


Link to post
Share on other sites

Hi Everyone, just updating this forum post with news that we do now support Azure and AWS cloud based databases in Passwordstate.  This has been available since build 7668.  Please refer to the manual for more information, or send us an email at support@clickstudios.com.au

 

Regards,

Click Studios

Share this post


Link to post
Share on other sites

It looks like support in a new installation has been added a long time ago. But we want to move an existing installation to Azure.

If I simply update the web.config with the new (Azure) SQL database information, Passworstate throws an error page (without details).

Is there any difference in the connectionString in the web.config file (compared to local SQL DB)?

Share this post


Link to post
Share on other sites

Hello,

We added database support for Azure in build 7668 - are you using this build or later? If so, then the database connection string is the same - just a different host name to connect to, and SQL account and Password of course.

Can you let us know what process you followed for restoring your database, and for creating the passwordstate_user SQL account and assigning db_owner rights to the database? These steps need to be done before modifying your web.config file.

Regards

Click Studios
 

Share this post


Link to post
Share on other sites

We are running the latest version V8.7 (Build 8729).

 

For deployment we use the deploy to azure option within SQL server.

 

For creation of the user we use (in master DB):

CREATE LOGIN "passwordstate_user"
	WITH PASSWORD = '<password>' 
GO

and assigning the db_owner rights (in individual DB):

CREATE USER "passwordstate_user"
	FOR LOGIN "passwordstate_user"
	WITH DEFAULT_SCHEMA = dbo
GO

EXEC sp_addrolemember N'db_owner', N'passwordstate_user'
GO

Using the ODBC tool on the webserver I can connect to the Azure SQL database succesfully.

 

If I only change the server/database/user information the connectionString in the web.config it looks like this:

<add name="PasswordstateConnectionString" connectionString="Data Source=<sqlserver>.database.windows.net;Initial Catalog=passwordstate;User ID=passwordstate_user;Password=<pwd>" providerName="System.Data.SqlClient" />

If I restart the IIS site it shows a passwordstate error occurred, please check the debuginfo table, bla bla. Nothing else, I can't find any logging (local or in event log) and it doesn't log error to the database.

 

Not that it matters much, but we use the serverless SQL database version (preview).

Share this post


Link to post
Share on other sites

Hello,

 

Sorry, I thought you were still using version 7 as you posted in the version 7 forum.

That all looks correct to me, although I'm not sure what serverless SQL database is - if you mean Microsoft's offering of Azure SQL where you do not manage a virtual machine, then your database connection string looks correct to me. Do you have to open a firewall rule for allowing access to this SQL instance?

Regards

Click Studios

Share this post


Link to post
Share on other sites

I recently experienced the same issue as "OMO ITC" when attempting to export the existing Passwordstate 8 database from an SQL Express installation to an Azure SQL instance. What made it particularly difficult to troubleshoot/debug was the lack of error messages or logs entries:

  • No details on the error was shown on the errorpage
  • Nothing was logged to the DebugInfo table of the database (which was suggested on the errorpage)
  • Nothing was logged to the Windows eventlogs of the webserver or the IIS errorlogs ("%windir%\System32\LogFiles\HTTPERR")
  • Nothing was logged to the Azure SQL instance by default

After enabling diagnostics settings for the Azure database and retrying, there was finally indications as to what had gone wrong. It was initially attempting to insert a row to the auditing table with a null-value in the id column, but that column does not allow null-values. It then attempted to log this error to the DebugInfo table, but the exact same problem occurred. After inspecting the tables, I found that there were settings missing on the tables (primary keys, identity specification(is identity) and possibly more).

 

I had attempted various methods of exporting and importing the database. The only method found that seemed to include the above settings was when using Microsoft Data Migration Assistant. After performing the migration through DMA, adding the SQL user, modifying the connectionstring of the web.config and restarted the passwordstate and iis related services, it was finally possible to login to PasswordState without errors.

 

Hopefully this post will help anyone in need of performing migrations to Azure SQL in the future =)

Share this post


Link to post
Share on other sites

Hi ECP,

Thanks for sharing. It seem that whatever "export" feature you were using, was not migrating the database schema properly, as the 'Identity Specification' attribute on fields was not set - and this is what dictates that the ID fields automatically increment when data is inserted.

We've also been doing a little testing with SQL Server Management Studio ourselves, and then menu below seems to work well with this sort of migration. This is possibly using the same Date Migration Assistant you're referring to.

azuredb.png

 

Regards

Click Studios

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...