Azure function app deployment through intellij - azure

I'm trying to deploy azure function app from intelliJ, getting following error when run mvn azure-functions:deploy
"The specified function app does not exist. Creating a new function app..."
after above getting status code : 400
Not sure why 400 since there is nothing printed or returned.

In pom, check functionResourceGroup of properties, resource group has some naming restrictions
Alphanumeric, underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed characters.
Maven Plugin for Azure Functions seems not to provide concrete error message as it does for functionAppName.

In my case I had multiple subscriptions attached to my account, since I was not setting any subscription upon login, azure was using default subscription and was not finding the function app.
I set the subscription in which function app was created then it worked properly.
az login -u <> -p <>
and then set the subscription
az account set
after above run the azure deploy. it worked for me.

Related

Unable to deploy Azure Function App - error with storage account

Lately I've had trouble with deploying a Function App via Azure CLI. Last week on Tuesday, I was still able to deploy a Function App via Azure CLI.
This week, like any other day before that, I used fairly common Azure Function Tools command func azure functionapp publish. The version of Azure Function Tools I am using is 3.0.3233.
Now I am getting this error every time:
Retry: 1 of 3
Error creating a Blob container reference. Please make sure your connection string in "AzureWebJobsStorage" is valid
Retry: 2 of 3
Error creating a Blob container reference. Please make sure your connection string in "AzureWebJobsStorage" is valid
Retry: 3 of 3
Error creating a Blob container reference. Please make sure your connection string in "AzureWebJobsStorage" is valid
I checked that AzureWebJobsStorage setting has a correct value, I even connected to storage account connection string via Azure Storage Explorer app.
Just in case, I created a new Function App in another region and I still get the same error.
Has anyone else encountered this error? I suspect this is an error in the tool itself, maybe a faulty build?
I suspect that AzureWebJobsStorage is not present/invalid in App Settings section of the function app in the Azure portal.
Make sure that it is added there and you are not deleting those settings through CLI/templates and recreating them without AzureWebJobsStorage.
I answer to my own question. It seems that this was a transient error. Without changing any code, today I was able to redeploy my function app. Cheers.
If you don't have "Allow storage account key access" enabled , you get this error.
There could be other scenarios as well. But the error does not say anything .

Can't find app with name error while publish the azure function

I tried to create an azure function using following link in Ubuntu system(16.04).
[azure function][2]
Deployment using arm template and create a local azure function using vs code.
Folder contains following files
LocalFunctionProj.csproj, HttpExample.cs, host.json, local.settings.json
azure function is created successfully in portal after deployment.But when i tried to publish the local azure function ,it shows an error Can't find app with name "HttpExample" while using following command
func azure functionapp publish HttpExample
Is anything wrong in my step.
Also i tried this command after 30 mnt when function created in portal
screen shot
I had a similar issue when I followed a tutorial about Azure Functions Core Tools from Microsoft Learning.
In my case, I had the error Can't find app with name X, because I had a wrong subscription set in my local Azure CLI. The command from below changes subscription for the one that is created with "Microsoft Learning Sandbox". Note that, in your case, the name of the subscription can be different.
az account set --subscription "Concierge Subscription"
If it's not the issue, your question suggests that your function app name should be HttpExample. You need to ensure beforehand that there's a function app with such a name in the subscription you are logged into with Azure CLI.
Moreover, there is a ProvisioningState: Failed in the screenshot, which could also be an issue.
If you want to publish the local app into azure ,you must create the functional app before in azure portal.Also the name of the azure function is portal should be same as the local azure app.otherwise you can't publish the app.

What is a proper endpoint format for creating an Event Grid subscription

I have an Azure Function executed by Event Grid trigger. The function is debugged and functioning as designed. I was able to successfully create a subscription to an Event Grid topic using UI in the Azure Portal (click Add Event Grid subscription and complete the on-screen form).
The problem is I cannot get the endpoint format correct when attempting to use the CLI (Cloud Shell logged in as Administrator) to create a subscription. The basic template I'm using is
az eventgrid event-subscription create --resource-group $resourceGroup
--topic-name $topicName
--included-event-types $includedEventTypes
--name $eventSubscriptionName
--endpoint https://XXX.azurewebsites.net/admin/extensions/EventGridExtensionConfig?functionName=FunctionName&code=ABC123
I've tried copying the auto-populated endpoint, including its code parameter, from the UI. It works in the UI but not from CLI. When I run the above script using the endpoint and code provided in the portal, I get the following
The term 'code=<XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX> is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
If I omit the code, I get a message indicating the subscription failed because it couldn't validate the endpoint.
If I attempt to use the endpoint, in the form usually seen for function endpoints, https://XXX.azurewebsites.net/FunctionName, I also get complaints about validation.
What is the proper format for the endpoint when creating a subscription from the CLI in Cloud Shell? Do I include the code parameter or not? Where do I get the proper code?
Using:
Microsoft.NET.Sdk.Functions 1.0.19
Microsoft.Azure.EventGrid 1.4.0
Microsoft.Azure.WebJobs.Extensions.EventGrid 1.0.0
Try to wrap your function endpoint with quote sign, & seems a reserved sign in CLi syntax hence your parameter code is cut from the url.

Many Azure PowerShell commands fail: Must specify valid information for parsing in the string

Today we tried to deploy new build to our staging environment which based on Azure Web Apps using our release flow which normally runs good and requires to push one button. but today something is going wrong with Azure. the commands like Get-AzureWebSiteJob, Switch-AzureWebSiteSlot, Start-AzureWebsiteJob go crazy and return error like:
"Start-AzureWebsiteJob : Must specify valid information for parsing in the string."
after second third fourth attempt error is gone but is it normal situation ? and we should handle that using retry strategy ? or something went wrong with likely Service Management cmdlets?
It is really sad to see that because you never know when Azure cmdlets would like to go down....
PowerShell 5.0
Azure PowerSherr Module 4.3.1
Subscription in North Europe
Command:
Start-AzureWebsiteJob -Name "lms365-dirreader-prod-northeuropestage" -JobName "DirectoryReader-OnSchedule"

Deploy a resource group with App Service

I have published an API app from Visual Studio to a new resource group, also created an App Service Plan, so after the deployment the resource group contains 2 items:
AppServicePlan1
AppService1
Now I am trying to deploy these items to another resource group as follows:
Select 'Automation script' in the resource group settings
Click 'Deploy'
Select 'Create new' resource group, enter its name
Enter 'Serverfarms_AppServicePlan1_name' parameter value (new app service plan name, e.g. AppServicePlan2)
Enter 'Sites_AppService1_name' parameter value (new app service name, e.g. AppService2)
Tick 'Agree to terms and conditions'
Click 'Puchase'
The process fails with the following error message:
"The host name AppService1.azurewebsites.net is already assigned to another Azure website: AppService1."
I have tried different things - deploying app service plan, logic apps, etc. from one resource group to another works fine, but deploying an app service fails as described above.
I have tried changing the hostNames property in the template file to ["AppService2.azurewebsites.net"] manually - I'm not getting the error then (although I'm not sure, maybe something else also needs to be changed, e.g. properties enabledHostNames, hostNameSslStates?) and the deployment seems to work, however the 'deployed' app service can't be used as it contains only 1 file - hostingstart.html.
What am I missing?
I think you have everything correct - as you noticed when you use the generated automation script it will create everything with the same properties that currently exist. We try to parameterize the correct value (like the web app name) but there are some details that can be overlooked (like host names). After changing all that it sounds like you got it to deploy.
The "code" however is not part of the automation script - only the infrastructure and configuration. So you still need to deploy your app to have it be identical. You can folder app deployment into the JSON template (using webdeploy or github) but since that requires access to external artifacts, that's not done automatically.
That help?

Resources