Title: Error when using define( &#8216;MICROSOFT_AZURE_CNAME&#8217;,&#8221;) within theme
Last modified: July 30, 2022

---

# Error when using define( ‘MICROSOFT_AZURE_CNAME’,”) within theme

 *  [mhosker](https://wordpress.org/support/users/mhosker/)
 * (@mhosker)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/error-when-using-define-microsoft_azure_cname-within-theme/)
 * Hi,
 * Firstly, I will start by saying – excellent plugin! Invaluable for my sites.
 * I have recently installed this plugin on a multi site instance with a custom 
   theme including pre defined Azure storage options within the theme.
 * All good and working fine, however when trying to view images on the front end
   they were not loading.
 * Upon further investigation I noted images `srcset` attributes were not linking
   to my custom CNAME but instead to “`.blob.core.windows.net`” (which obviously
   was not resolving) despite this attribute being set using `define` within my 
   theme `functions.php`.
 * Further digging got me to the `windows_azure_storage_wp_calculate_image_srcset`
   function where I was able to track down the issue, that being the use of `WindowsAzureStorageUtil::
   get_storage_url_base( false )` when setting `$base_url`.
 * After some more time I realized the `MICROSOFT_AZURE_CNAME` defined constant 
   was not available within that function, which led me to add it into `wp-config.
   php` and voila – it worked!
 * I am guessing this “issue” is caused by namespaces for defined constants in WordPress
   themes?
 * Can any modifications be made to support using `define( 'MICROSOFT_AZURE_CNAME','')`
   within the theme files vs `wp-config.php`?
 * Should be noted all other functionality worked perfectly with it defined in the
   theme, e.g CNAME showed correctly in WP admin and the `img` `src` attribute was
   set correctly.
 * Thanks.
 * Mike

The topic ‘Error when using define( ‘MICROSOFT_AZURE_CNAME’,”) within theme’ is 
closed to new replies.

 * ![](https://ps.w.org/windows-azure-storage/assets/icon-256x256.png?rev=2486101)
 * [Microsoft Azure Storage for WordPress](https://wordpress.org/plugins/windows-azure-storage/)
 * [Support Threads](https://wordpress.org/support/plugin/windows-azure-storage/)
 * [Active Topics](https://wordpress.org/support/plugin/windows-azure-storage/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/windows-azure-storage/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/windows-azure-storage/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [mhosker](https://wordpress.org/support/users/mhosker/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/error-when-using-define-microsoft_azure_cname-within-theme/)
 * Status: not resolved