Posts in Category: azure

Azure Function Publish Failed

I had a few instances last week where I was getting this incredibly descriptive error message. When I dug into the logs, I got an even more descript messaging saying that “Publishing had failed.”

Both lead me nowhere and after deleting publishing profiles, pulling them down, pushing them back, doing whatever I could, nothing seemed to function.

Cue finding out about this key in on my function itself – WEBSITE_RUN_FROM_PACKAGE 

By default, when you create your function in Azure, this is set to 1. However, for Web Deploy to work (i.e., from Visual Studio), this needs to be set to 0.

Once I did that, boom, publishing was working solidly like a rock once

Read More


Finding your Azure Tenant Id

If you’re connecting with the Dynamics Web API in a Function or Service, you need to know your Azure Tenant Id.  If you don’t have a custom domain, this is relatively simple, but if you do have a custom domain, it can be slightly obscured and/or completely hidden from what you are doing.

To find you Tenant Id, simply go to the Azure Active Directory, scroll down to Custom Domains and look for the domain that looks something like xxxxxxxx.onmicrosoft.com.

aad.PNG

That will be thetenant id that you will want to connect with, not your custom domain name.

Read More


Debugging Azure Functions Locally

If you’re storing configuration keys in Azure Functions, there is this really cool facility called Application Settings where you can create all these keys and access them when your function runs.

HOWEVER, when running your Azure Function locally, these keys do not automatically download and you need to add them into your local.settings.json file for them to be consumed.

After you have done this, next you need to make sure that this file is set to “Copy if newer” because if it isn’t you’ll never get to consume those values.

I ran into the above very innocently by trying to troubleshoot the granddaddy of all problems – why my AzureWebJobsStorage parameter was empty and I was not able to download what I needed from my Azure portal into it.

Amateur Tip: If this value

Read More


Eliminate Lazy Error Handling

Here is an error I received the other day…

“Authentication Failure”

Here is another…

“Format of the initialization string does not conform to specification starting at index 0, without any typo in connectionString”

And finally my favourite…

“The entity cannot be updated because it is read-only.”

They are all from different applications and implementations and have been my life for the past two days as I tried to figure them out and wasted an insane amount of time trying to figure out what they related to and what I had to do to resolve them.

Here were the resolutions (in order)…

“Multi-Factor authentication is not supported here.”

“You need to enter the string in a special way, but we won’t tell you how.”

“It’s not that the entity was read-only, it’s that a function was trying to modify it while

Read More


Azure Configuration Settings

If you’re still doing configuration in web.config files for your Azure services, it’s time to try something new and leverage something that has been there for quite some time – Application Settings.

In your Azure Portal, you will notice a section called Application Settings.  Within this section is everything you need to configure your application.  If you have some custom configuration data in your web.config file, a simple way to rely less on the web.config (and make your end administrator’s job a little more easier) is to expose these configuration values via Application Settings.

The process to create a new Application Setting is straight-forward, create the setting, add the value. (In this case I created a key called Tool).

Read More