Website channel with ID 0 does not exist

2025/05/27 3:09 PM

My site runs fine locally, however once deployed to azure, I get the error "Website channel with ID 0 does not exist" at points where I am trying to get the webSiteChannelContext. The site loads fine in the CMS, I can edit the pages without problem. However, on the live site I get an error page due to the above issue with the site context.

What could cause this?


Environment

Answers

2025/05/27 3:10 PM
Answer

The website channel domain needed to be changed from localhost to the azure url

2025/05/27 3:32 PM

It's also worth noting that code executing within the administration UI outside of the Page Builder is not associated with a website, even if you access the administration UI through the same domain as one of your website channels.

Within the admin UI (outside of the Page Builder) the website channel context ID will be 0.

To answer this question, you have to login first.