Jump to content

Azure SQL Dbs are in an inaccessible state on the Azure Portal


Recommended Posts

Guest Akshay_Manjeshwar
Posted

When I am not able to connect to the Azure SQL db, and I get this error message,

 

 

 

540x127vv2.png.4d083835bcc8672d37cd9cf8e6fa9cc6.png

 

 

 

My first step would be to check the status of the database on the Azure Portal, and in this case, I can see that the dbs are in inaccessible state.

 

 

 

687x67vv2.png.87f3c88b57e1ad8cb8517db4b0ac7171.png

 

 

 

When I check the Activity logs, I see the following events:

 

 

 

686x72vv2.png.bebcae7ba143cd51ca2ad816d55005c9.png

 

 

 

If I click on the JSON events, I can see the reasons why the dbs are inaccessible

 

 

 

747x99vv2.png.a32b1f9d79c8e8d0bf6ec07bb1504449.png

 

 

 

and there's another status which shows that the dbs are waiting for access to be reestablished again.

 

 

 

725x96vv2.png.8e00c94a446d2bbe23a5a1de006e8f93.png

 

 

 

When I click on Revalidate Key, at the bottom of the screen, it gives the correct error.

 

 

738x179vv2.png.7735f2c6ab9b9db455d4286732e701ed.png

 

 

 

Now when I go to Identity, I can see that the System assigned managed identity was turned to off.

 

 

726x167vv2.png.db6f23ab754f6fce5886988085348213.png

 

 

 

Resolution

 

===========

 

Step 1 : Turn it on.When I try to turn it on I get the following error msg

 

 

731x320vv2.png.2726aed7a326748cf831ceeac020ae5f.png

 

 

 

 

Step 2: The way to resolve this error is to go back to the Azure key vault access policies and then add the system assigned managed identity with the correct permissions: Get, Wrap and Unwrap keys.

 

706x240vv2.png.5b01ebc32c45e6fde7b0570e67c9f10a.png

 

 

 

Step 3: Click on Create. Select the permissions and then click Next

 

mediumvv2px400.png.2d2916770dc0726b50379e412e7318f1.png

 

 

 

Step 4: Use the system assigned managed identity and then click on Next

 

 

 

 

715x236vv2.png.16cc9d6e1d5fccda1806e37db9bde22d.png

 

Step 5: Click on Create.

 

 

 

Step 6: Once the access policy was created successfully, you can go back to the Identity tab of the SQL Server and then see the System assigned managed identity has been turned to On automatically.

 

 

 

Step7: Go back to TDE settings and click on Revalidate Key.

 

 

 

Step 8: You will see the access is back. Depending on the size of the dbs, it will take some time for the restoration process.

 

 

 

769x244vv2.png.84e9bbb1deb114c4285379a2bdf4e5a9.png

 

 

 

Step 9: Once the restoration process is completed, you will get a notification: Key Access restored.

 

 

 

Step 10: Dbs will be back in Online state as well and now you should be able to connect to the dbs as well.

 

 

 

764x84vv2.png.67c6fc46c701cb1741fb5770d363abac.png

 

 

 

Refer: Common errors with customer-managed keys in Azure Key Vault - SQL Server | Microsoft Learn

 

 

 

 

 

 

 

 

Continue reading...

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.

×
×
  • Create New...